From 37107a2ffdfcb9628198083cc8089f12f0929aef Mon Sep 17 00:00:00 2001 From: amy0701 Date: Wed, 6 Jul 2011 05:37:49 +0000 Subject: [PATCH] add cases0 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10014 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-test/autotest/testcase/tabprune/cases0 | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 xCAT-test/autotest/testcase/tabprune/cases0 diff --git a/xCAT-test/autotest/testcase/tabprune/cases0 b/xCAT-test/autotest/testcase/tabprune/cases0 new file mode 100644 index 000000000..f1d5b2890 --- /dev/null +++ b/xCAT-test/autotest/testcase/tabprune/cases0 @@ -0,0 +1,61 @@ +start:tabprune_h +description:tabprune -h +cmd:tabprune -h +check:rc==0 +check:output=~Usage +end + +start:tabprune_v +description:tabprune -v +cmd:tabprune -v +check:rc==0 +check:output=~Version +end + +start:tabprune_a_eventlog +description:tabprune eventlog -a +cmd:tabprune eventlog -a +check:rc==0 +check:output!~not a valid xCAT object type +end + +start:tabprune_V_a_eventlog +description:tabprune eventlog -V -a > /tmp/eventlog.csv +cmd:tabprune eventlog -V -a > /tmp/eventlog.csv +check:rc==0 +cmd:ls /tmp/eventlog.csv +check:rc==0 +check:output=~eventlog.csv +cmd:rm -f /tmp/eventlog.csv +end + +start:tabprune_p_auditlog +description:to remove 50% of the auditlog table,if the original number is odd number,the final result is 1;or else the final number is 0; +cmd:n1=`lsdef -t auditlog|wc -l`;tabprune auditlog -p 50;n2=`lsdef -t auditlog|wc -l`;echo $((n1-($n2-2)*2)) +check:rc=0 +check:output=~tabprune of auditlog complete +check:output=~(0|1) +end + +start:tabprune_i_auditlog +description:remove the records whose recid is less than the input recid number +cmd:n1=`lsdef -t auditlog|sed -n 2p|awk '{print $1}'`;tabprune auditlog -i $n1;n1=$(($n1-1));lsdef -t auditlog -l $n1 +check:rc=0 +check:output=~tabprune of auditlog complete +check:output=~Could not find an object named +end + +start:tabprune_V_n_auditlog +description:remove 3 records from the auditlog table and display the remove records +description:tabprune auditlog -V -n 3 +cmd:lsdef -t site +cmd:lsdef -t site +cmd:lsdef -t site +cmd:tabprune auditlog -V -n 3|tee result|wc -l +check:rc=0 +check:output=~4 +cmd:cat result +check:output=~recid,audittime +cmd:rm result +end +