From b2aeb152c66525ca0e0fa8687e594f3a3921e3f6 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Wed, 8 Jun 2016 03:19:58 -0400 Subject: [PATCH] add a case to clean up the test environment and update the bundle files --- .../autotest/bundle/rhels6.7_ppc64.bundle | 1 + .../autotest/bundle/rhels6.7_x86_64.bundle | 1 + .../autotest/bundle/rhels6.8_ppc64.bundle | 1 + .../autotest/bundle/rhels6.8_x86_64.bundle | 1 + .../autotest/bundle/rhels7.2_ppc64.bundle | 1 + .../autotest/bundle/rhels7.2_ppc64le.bundle | 1 + .../autotest/bundle/rhels7.2_x86_64.bundle | 1 + .../autotest/bundle/sles11.4_ppc64.bundle | 1 + .../autotest/bundle/sles11.4_x86_64.bundle | 1 + xCAT-test/autotest/testcase/testenv/case0 | 23 +++++++++++++++++++ 10 files changed, 32 insertions(+) create mode 100644 xCAT-test/autotest/testcase/testenv/case0 diff --git a/xCAT-test/autotest/bundle/rhels6.7_ppc64.bundle b/xCAT-test/autotest/bundle/rhels6.7_ppc64.bundle index 243184594..ac261710d 100644 --- a/xCAT-test/autotest/bundle/rhels6.7_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.7_ppc64.bundle @@ -303,3 +303,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs redhat_migration1 redhat_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle index 2e7b87490..3fbc91c8b 100644 --- a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle @@ -206,3 +206,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs redhat_migration1 redhat_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle b/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle index 81ede5553..2763e12c7 100644 --- a/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle @@ -301,3 +301,4 @@ reg_linux_diskfull_installation_hierarchy reg_linux_diskless_installation_hierarchy reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle index cec465f07..f207c7154 100644 --- a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle @@ -204,3 +204,4 @@ reg_linux_diskfull_installation_hierarchy reg_linux_diskless_installation_hierarchy reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle b/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle index 243184594..ac261710d 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle @@ -303,3 +303,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs redhat_migration1 redhat_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle index 401756957..a23e9e257 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle @@ -194,3 +194,4 @@ switchdiscover_range_z switchdiscover_range_z_V redhat_migration1 redhat_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle index 2e7b87490..3fbc91c8b 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle @@ -206,3 +206,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs redhat_migration1 redhat_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle index b46de71a3..75ffb4dde 100644 --- a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle @@ -267,3 +267,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs sles_migration1 sles_migration2 +clean_up_env diff --git a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle index 8fd6db580..76fa7c6de 100644 --- a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle @@ -216,3 +216,4 @@ reg_linux_statelite_installation_hierarchy_by_ramdisk reg_linux_statelite_installation_hierarchy_by_nfs sles_migration1 sles_migration2 +clean_up_env diff --git a/xCAT-test/autotest/testcase/testenv/case0 b/xCAT-test/autotest/testcase/testenv/case0 new file mode 100644 index 000000000..7ecb5609f --- /dev/null +++ b/xCAT-test/autotest/testcase/testenv/case0 @@ -0,0 +1,23 @@ +start:clean_up_env +description:power off service node and compute node for next test usage +cmd:rpower $$SN stat >> /tmp/snstat +cmd:if [[ ! `cat /tmp/snstat |grep -i "Not Activated"` ]]; then rpower $$SN off;fi +check:rc==0 +cmd:rm -rf /tmp/snstat +cmd:if [[ "__GETNODEATTR($$SN,mgt)__" =~ "ipmi" ]]; then sleep 1800;else sleep 180;fi +cmd:rpower $$SN stat >> /tmp/snstat +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then cat /tmp/snstat |grep -i "Not Activated";else cat /tmp/snstat|grep off;fi +check:rc==0 +cmd:rm -rf /tmp/snstat +cmd:rpower $$CN stat >> /tmp/cnstat +cmd:if [[ ! `cat /tmp/cnstat |grep -i "Not Activated"` ]]; then rpower $$CN off;fi +check:rc==0 +cmd:rm -rf /tmp/cnstat +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" =~ "ipmi" ]]; then sleep 1800;else sleep 180;fi +cmd:rpower $$CN stat >> /tmp/cnstat +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then cat /tmp/cnstat |grep "Not Activated";else cat /tmp/cnstat|grep off;fi +check:rc==0 +cmd:rm -rf /tmp/cnstat +end