Disclosure of Invention
In view of the above problems, an object of the present invention is to provide an automatic testing method for CIFS sharing maximization.
In order to achieve the purpose, the invention is realized by the following technical scheme: an automatic testing method for CIFS sharing maximization comprises the following steps:
step 1: clearing the original NAS cluster;
step 2: creating a new NAS cluster;
and step 3: configuring a port ip for two nodes in the NAS cluster;
and 4, step 4: adding an AD domain;
and 5: creating a log file;
step 6: creating a storage pool;
and 7: creating a file system, a directory and a cifs share, and counting;
and 8: judging whether the count value reaches the maximum limit of the system; if so, exiting the test: if not, go to step 7.
Further, the step 1 specifically comprises:
step 11: clearing the original NAS node;
step 12: setting a first delay time;
step 13: clearing the original NAS cluster;
step 14: a second delay time is set.
Further, the step 2 further comprises: a third delay time is set.
Further, the step 3 specifically comprises: ports ip are configured for two storage controllers in the NAS cluster.
Further, the step 7 specifically includes:
step 71: creating a file system;
step 72: judging whether the file system is successfully established; if yes, outputting a success prompt and turning to step 73; if not, outputting a failure prompt to the log file and quitting the test;
step 73: creating a directory and a CIFS share for the file system;
step 74: judging whether CIFS sharing is successfully established; if yes, outputting a success prompt and turning to the step 8;
if not, outputting a failure prompt to the log file and quitting the test.
Further, the first delay time and the second delay time are both set to 600 seconds.
Further, the third delay time is set to 200 seconds.
Further, the step 73 further includes: the fourth delay time is set to 10 seconds.
Compared with the prior art, the invention has the beneficial effects that: the invention provides an automatic testing method for CIFS (common information platform) sharing maximization, which is characterized in that a file system is created in an infinite loop mode, a directory is created, and a cifS sharing is created by executing a script, and the automatic testing method can automatically quit when the creation is failed unless the maximum limit of the creation times of the system is reached. By the method, the automatic maximum test of the CIFS is realized, and only the script file needs to be run at the storage end, so that a large amount of test time and energy are saved, and the test efficiency is improved.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings.
The first embodiment is as follows:
the automatic testing method for the CIFS sharing maximization shown in FIG. 1 comprises the following steps:
step 1: the original NAS cluster is cleared.
Step 2: a new NAS cluster is created.
And step 3: and configuring a port ip for two nodes in the NAS cluster.
And 4, step 4: AD fields are added.
And 5: a log file is created.
Step 6: a storage pool is created.
And 7: file system, directory and cifs shares are created and counted.
And 8: judging whether the count value reaches the maximum limit of the system; if so, exiting the test: if not, go to step 7.
According to the automatic testing method for the CIFS sharing maximization, the file system is created in an infinite loop mode, the directory is created, the cifS sharing is created through executing the script, and the automatic exit can be realized when the creation is failed unless the maximum limit of the creation times of the system is reached.
Example two:
fig. 2 shows an automatic testing method for CIFS sharing maximization, which includes the following steps:
step 1: the original NAS node is cleared.
Step 2: the first delay time is set to 600 seconds.
And step 3: the original NAS cluster is cleared.
And 4, step 4: the second delay time is set to 600 seconds.
And 5: a new NAS cluster is created.
Step 6: the third delay time is set to 200 seconds.
And 7: ports ip are configured for two storage controllers in the NAS cluster.
And 8: AD fields are added.
And step 9: a log file is created.
Step 10: a storage pool is created.
Step 11: a file system is created.
Step 12: judging whether the file system is successfully established; if so, a success prompt is output and the process goes to step 13. If not, outputting a failure prompt to the log file and quitting the test.
Step 13: directories and CIFS shares are created for the file system.
Step 14: the fourth delay time is set to 10 seconds.
Step 15: judging whether CIFS sharing is successfully established; if yes, outputting a success prompt and turning to step 16;
if not, outputting a failure prompt to the log file and quitting the test.
Step 16: the number of tests was counted.
And step 17: judging whether the count value reaches the maximum limit of the system; if so, exiting the test: if not, go to step 11.
On the basis, the specific test.sh script content is as follows:
# script name: max _ cifs
Test content # test: reestablishing nas cluster, creating file system, creating directory under file system, and sharing cifs under directory #
# clean original nas Cluster
replacenas
sleep 600
restorenas
Sleep 600
# Create NAS Cluster
mknascluster
sleep 200
# pairs of two nodes in a cluster configure ports ip
cfgnasportip –gui –gw 100.7.47.254 –ip 100.7.40.125 –mask 255.255.240.0 –node node1 –port 1
cfgnasportip –gui –gw 100.7.47.254 –ip 100.7.40.126 –mask 255.255.240.0 –node node2 –port 1
# Add AD Domain
Joidad –user asministrator –passwd 123456a? –domain NASAD.COM –ip 100.7.40.23 –group NASAD –dns 100.7.40.22 –computername palm
# Create Log File
date1=$(date+%y%m%d)
touch mkfile.$date1
touch mkshare.$date1
# Create storage pool
mtop mkmdiskgrp -easytier auto -encrypt no -ext 1024 -guiid 0 -name Pool0 -warning 80%
# create File System, create directory, create cifs share, at this point: an infinite loop is set, and the system is always created unless the maximum limit is reached and the system is automatically exited when the creation fails
count=1
while true;do
echo"begin"
# Create File System
addfs –name file${count} –pool Pool0 –size 102400 –node node1
if[$?-eq 0]
then
# if the File System creation was successful, output a related success prompt
echo-e"---create file${count}successfully---"
else
# if the File System failed to create, output a failure prompt to the Log File, and exit the Loop
echo-e"---failed to create file${count}---">>mkfile.$date1
break
fi
Creating a directory for a file system
addnasdir–gui/fs/file${count}/file_dir${count}
sleep 10
setcifs –add –name cifs${count} -oplocks on –path/fs/file${count}/file_dir${count}–rights AU:li:rw
if[$?-eq 0]
then
# if the sharing creation is successful, output the associated success prompt
echo-e"---create share${count}successfully---"
else
# if the sharing creation failed, output a failure prompt to the log file, and exit the loop
echo-e"---failed to create file${count}---">>mkshare.$date1
break
fi
echo$count"test success......"
count=$((count+1))
done
During operation, the cluster can be automatically reset, a file system, a directory and sharing are established only by executing the-/test.sh at the storage end, and the maximum test of cifs sharing is simply and conveniently carried out.
According to the automatic testing method for the CIFS sharing maximization, a file system is created infinitely and circularly through executing a test. By the method, the CIFS can be automatically tested to the maximum extent, and the operation of the-/test.sh script file at the storage end is only needed, so that a large amount of testing time and energy are saved, and the testing efficiency is improved.
The invention is further described with reference to the accompanying drawings and specific embodiments. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and these equivalents also fall within the scope of the present application.