From 5c799f6d4490cb65eac5593a18c266c740b7da19 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 1 Oct 2020 21:55:52 -0400 Subject: [PATCH 1/2] Extend the REST test cases to SLES --- xCAT-test/autotest/testcase/restapi/cases0 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 06eba7fa6..7a1e86558 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -4,10 +4,19 @@ label:restapi #Install the mod_ssl package on Red Hat cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 -cmd:sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf -cmd:sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi +check:rc==0 cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi check:rc==0 +#Configure the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then a2enmod ssl; a2enflag SSL; cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then service apache2 restart; fi +check:rc==0 cmd:scp /install/postscripts/ca/ca-cert.pem $$CN:/root check:rc==0 cmd:tabch key=xcat,username=__GETTABLEVALUE(key,system,username,passwd)__ passwd.password=__GETTABLEVALUE(key,system,password,passwd)__ @@ -22,8 +31,11 @@ check:rc==0 cmd:tabch -d key=xcat passwd check:rc==0 #Remove the mod_ssl package on Red Hat -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; rpm -qa | grep mod_ssl; fi -check:rc==1 +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi +check:rc==0 +#Clean up the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then rm /etc/apache2/vhosts.d/vhost-ssl.conf; service apache2 restart; fi +check:rc==0 end start:restapi_list_all_resources From e74c6a904bb15f5ae8a8f01d5676d28f2b32cb2c Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 2 Oct 2020 08:48:33 -0400 Subject: [PATCH 2/2] Include restapi.bundle to SLES bundles --- xCAT-test/autotest/bundle/sles_ppcle_daily.bundle | 1 + xCAT-test/autotest/bundle/sles_x86_daily.bundle | 1 + 2 files changed, 2 insertions(+) diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index a8cd4835e..63dfc7e00 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -7,6 +7,7 @@ assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index b4f20bab7..7aaf23dc5 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -7,6 +7,7 @@ assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command