2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 19:20:24 +00:00
Files
xcat-core/xCAT-test/pods/man1/xcattest.1.pod
ellen56 a05837bdca new files for xCAT test
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7514 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2010-09-20 08:10:57 +00:00

123 lines
4.1 KiB
Plaintext

=head1 NAME
B<xcattest> - Run xcat test cases.
=head1 B<SYNOPSIS>
B<xcattest> [B<-?|-h>]
B<xcattest> [B<-f> I<configure file>] [B<-b> I<case bundle list>] [B<--restore>]
B<xcattest> [B<-f> I<configure file>] [B<-t> I<case list>] [B<--restore>]
B<xcattest> [B<-f> I<configure file>] [B<-c> I<cmd list>] [B<-l>] [B<--restore>]
=head1 B<DESCRIPTION>
This command is used to run xCAT automated test and output the result to /opt/xcat/share/xcat/tool/xcat/result. All test cases is in the directory /opt/xcat/share/xcat/tools/autotest. Now there are some cases for basic function of xCAT. Each case has a unique case name. The cases for I<command> is place in directory /opt/xcat/share/xcat/tools/autotest/I<command>. When xcattest is run with -c , it will run all cases in the specified directory. User can add custom cases in the corresponding directory or add new directory if there is no corresponding directory.
=head1 OPTIONS
B<-?|-h> Display usage message.
B<-f> I<configure file>
Read configuration information from the configure file, default configure file is /opt/xcat/share/xcat/tools/autotest/default.conf. See /opt/xcat/share/xcat/tools/autotest/*.conf.template for example.
B<-b> I<case bundle list>
Comma separated list of file which contains cases which will be run. Default to run all cases.
B<-t> I<case list>
Comma separated list of cases which will be run. Default to run all cases.
B<-c> I<cmd list>
Comma separated list of commands which the related cases will be run. Default to run all cases.
B<-l>
Display all available cases.
B<--restore>
Restore test environment after test.
=head1 RETURN VALUE
0 The command completed successfully.
1 An error has occurred.
=head1 TEST CASE
The cases is specified as:
#required, case name
B<start>:case name
#optional, precondition
B<os>:AIX|Linux
#optional, precondition
B<arch>:ppc/x86
#optional, precondition
B<hcp>:hmc/mm/bmc/fsp
#required, command need to run
B<cmd>:comand
#optional, check return code of last executed command
B<check:rc> == or != <I>return code
#optional, check output of last executed command
B<check:output>== or != or =~ or !~ I<output check string>
end
The I<output check string> can be regular expression.
=head1 EXAMPLES
1. To run all test cases related command rpower:
B<xcattest -c /tmp/config -c rpower>
2. To run custom bundle:
B<xcattest -l > /tmp/custom.bundle>
B<edit custom.bundle>
B<xcattest -b custom.bundle>
3. To run specified test cases, and restore test environment after test.
B<xcattest -t lsdef_t_o_l_z --restore>
4. To add a new case to test chvm. In the example, we assume that the min_mem should not be equal to 16 in the lpar profile of computenode. The case name is chvm_custom. It create a test lpar named testnode firstly, that change the min_mem of the lpar to 16 using chvm, then check if min_mem have changed correctly. At last, the testnode be remove to ensure no garbage produced in the cases.
B<add a new file filename in /opt/xcat/share/xcat/tools/autotest/chvm>
B<edit filename>
I<start:chvm_custom>
I<hcp:hmc>
I<cmd:lsvm $$CN > /tmp/autotest.profile>
I<check:rc==0>
I<cmd:mkdef -t node -o testnode mgt=hmc groups=all>
I<cmd:mkvm testnode -i $$MaxLparID -l $$CN>
I<check:rc==0>
I<cmd:perl -pi -e 's/min_mem=\d+/min_mem=16/g' /tmp/autotest.profile>
I<cmd:cat /tmp/autotest.profile|chvm testnode>
I<check:rc==0>
I<cmd:lsvm testnode>
I<check:output=~min_mem=16>
I<cmd:rmvm testnode>
I<cmd:rm -f /tmp/autotest.profile>
I<end>
=head1 INLINE FUNCTION
There are some inline functions in the automated test tool. The function can be called in test cases as __FUNCTIONNAME(PARAMTERLIST)__. The function can be used in I<command> and I<output check string>.
The functions are:
1. B<GETNODEATTR(nodename, attribute)> To get the value of specified node's attribute
2. B<INC(digit)> To get value of digit+1.
For example:
To run rscan command with hcp point of compute node specified in configuration file
cmd: rscan __GETNODEATTR($$CN, hcp)__ -z
=head1 FILES
/opt/xcat/bin/xcattest