From e4ddeacf105c5b2e8d442349b535d82cdf15f3f4 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 19 Apr 2017 21:25:16 -0400 Subject: [PATCH 1/3] This case is to verify bug 2225 to test rmimage could work correctly to remove all image files. The case bug is #2829 --- xCAT-test/autotest/testcase/rmimage/case0 | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rmimage/case0 diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 new file mode 100644 index 000000000..c87c1ec3a --- /dev/null +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -0,0 +1,26 @@ +start:genimage_stateless +descriptiion:This case is to verify bug 2225 to test rmimage could work correctly to remove all image files. +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi +cmd:copycds $$ISO +check:rc==0 +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:cp -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.gz +check:rc==0 +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Removing directory /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg +check:output=~Removing file /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/kernel +check:output=~Removing file /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/initrd-stateless.gz +check:output=~Removing file /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/initrd-statelite.gz +check:output=~Removing file /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +check:output=~Removing file /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.gz +check:output=~Removing directory /tftpboot/xcat/osimage/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:output=~Image files have been removed successfully from this management node. +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc!=0 +check:output=~kernel cannot be found at /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/kernel +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute;fi +end From a7bcc3585d2b12d9afbbbdeb43f314f5180e0e92 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 20 Apr 2017 03:10:30 -0400 Subject: [PATCH 2/3] update case name --- xCAT-test/autotest/testcase/rmimage/case0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 index c87c1ec3a..8f5f39415 100644 --- a/xCAT-test/autotest/testcase/rmimage/case0 +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -1,4 +1,4 @@ -start:genimage_stateless +start:rmimage_diskless_bug2225 descriptiion:This case is to verify bug 2225 to test rmimage could work correctly to remove all image files. cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi cmd:copycds $$ISO From 524c416208d6e89ff4b34794417419709181a4f2 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 21 Apr 2017 05:00:45 -0400 Subject: [PATCH 3/3] remove bug number in case --- xCAT-test/autotest/testcase/rmimage/case0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 index 8f5f39415..a5f1ea566 100644 --- a/xCAT-test/autotest/testcase/rmimage/case0 +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -1,5 +1,5 @@ -start:rmimage_diskless_bug2225 -descriptiion:This case is to verify bug 2225 to test rmimage could work correctly to remove all image files. +start:rmimage_diskless +descriptiion:This case is to test rmimage could work correctly to remove all image files. cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi cmd:copycds $$ISO check:rc==0