From fef3a09b65184347389ce81fcbff7bd5d00c79ff Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 29 Apr 2021 17:38:03 -0400 Subject: [PATCH 1/3] Modify test case makentp_extntpserver_value and add it to seven daily bundles --- xCAT-test/autotest/bundle/rhels_ppc_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/rhels_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle | 1 + xCAT-test/autotest/testcase/makentp/cases0 | 8 ++------ 8 files changed, 9 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 0d9eed54a..92129c212 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -3,6 +3,7 @@ tabdump_servicenode reg_linux_diskless_installation_hierarchy tabdump_servicenode reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value tabdump_servicenode updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 0e45189e3..f8b4cb4ad 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 29bda82ab..b5f2fadc0 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 63dfc7e00..3a0443bda 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index 7aaf23dc5..0b1d3e307 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 983d59527..753958701 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 84f8f6968..83ba17e6a 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index 28eef1e18..f63124129 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -56,12 +56,8 @@ check:output=~configuring management node: $$MN cmd:makentp -V check:rc==0 check:output=~configuring management node: $$MN -check:output=~checking if nptd is installed -check:output=~backing up the ntp configuration file /etc/ntp.conf -check:output=~ntp servers are: $$extntpserversip -check:output=~stopping ntpserver -check:output=~starting ntpserver -check:output=~enabling ntpserver +check:output=~Calling ... /install/postscripts/setupntp +check:output=~Daemon chronyd configured cmd:date check:output=~$$DATE cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock ;else hwclock ; fi From d7799b8c1a4a3f2eceafc4af1c2b29a035e536f7 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 29 Apr 2021 17:49:58 -0400 Subject: [PATCH 2/3] Some changes to cases0 were missed in the previous commit --- xCAT-test/autotest/testcase/makentp/cases0 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index f63124129..d956dda70 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,6 +46,8 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 +cmd:date | awk '{print $6}' > /tmp/abc123 +check:rc==0 cmd:date -s 20000101 check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock -w;else hwclock -w ; fi @@ -58,14 +60,18 @@ check:rc==0 check:output=~configuring management node: $$MN check:output=~Calling ... /install/postscripts/setupntp check:output=~Daemon chronyd configured -cmd:date -check:output=~$$DATE -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock ;else hwclock ; fi +cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;date | grep $Time check:rc==0 -check:output=~$$DATE +check:output=~\d +cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $Time;else hwclock | grep $Time ; fi +check:rc==0 +check:output=~\d cmd:extntpserver=`cat /tmp/extntpserver | awk -F = '{print \$2}'`;chtab key=extntpservers site.value=$extntpserver check:rc==0 cmd:rm -rf /tmp/extntpserver +check:rc==0 +cmd:rm /tmp/abc123 +check:rc==0 end start:updatenode_computenode_P_setupntp From 0e02c87a9a42b124af1c861d63fdcdce0a287774 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 30 Apr 2021 14:41:45 -0400 Subject: [PATCH 3/3] test case enhancement --- xCAT-test/autotest/testcase/makentp/cases0 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index d956dda70..b807e4893 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,7 +46,7 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 -cmd:date | awk '{print $6}' > /tmp/abc123 +cmd:date | awk '{print $6}' > /tmp/currentyear check:rc==0 cmd:date -s 20000101 check:rc==0 @@ -60,17 +60,17 @@ check:rc==0 check:output=~configuring management node: $$MN check:output=~Calling ... /install/postscripts/setupntp check:output=~Daemon chronyd configured -cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;date | grep $Time +cmd:curryear=`cat /tmp/currentyear`;date | grep $curryear check:rc==0 check:output=~\d -cmd:Time=`cat /tmp/abc123 | awk '{print $1}'`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $Time;else hwclock | grep $Time ; fi +cmd:curryear=`cat /tmp/currentyear`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $curryear;else hwclock | grep $curryear ; fi check:rc==0 check:output=~\d cmd:extntpserver=`cat /tmp/extntpserver | awk -F = '{print \$2}'`;chtab key=extntpservers site.value=$extntpserver check:rc==0 cmd:rm -rf /tmp/extntpserver check:rc==0 -cmd:rm /tmp/abc123 +cmd:rm -f /tmp/currentyear check:rc==0 end