From 4fbaf5d191186225f102857e09e9bddf7c31cace Mon Sep 17 00:00:00 2001 From: Pavel Negrobov Date: Wed, 27 Mar 2024 13:03:28 +0300 Subject: [PATCH] =?UTF-8?q?INF-955:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20QA=20=D1=82=D0=B5=D1=81=D1=82=D0=B0=D1=85=20=D0=B8?= =?UTF-8?q?=D0=B7=20Centos8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/p_httpd/0-install_httpd.sh | 8 -------- tests/p_httpd/httpd_centos_brand_server_tokens.sh | 8 -------- tests/p_httpd/httpd_centos_brand_welcome.sh | 8 -------- tests/p_httpd/httpd_msvsphere_brand_server_tokens.sh | 9 +++++++++ tests/p_httpd/httpd_msvsphere_brand_welcome.sh | 9 +++++++++ tests/p_httpd/httpd_servehtml.sh | 6 +++++- tests/p_httpd/httpd_servehtml_ssl.sh | 7 ++++++- tests/p_systemd/001-prepare_environment.sh | 9 +++++++++ tests/p_systemd/20-systemctl_list-service-status.sh | 7 ++++++- 9 files changed, 44 insertions(+), 27 deletions(-) delete mode 100755 tests/p_httpd/httpd_centos_brand_server_tokens.sh delete mode 100755 tests/p_httpd/httpd_centos_brand_welcome.sh create mode 100755 tests/p_httpd/httpd_msvsphere_brand_server_tokens.sh create mode 100755 tests/p_httpd/httpd_msvsphere_brand_welcome.sh create mode 100755 tests/p_systemd/001-prepare_environment.sh diff --git a/tests/p_httpd/0-install_httpd.sh b/tests/p_httpd/0-install_httpd.sh index 429883a..06652b1 100755 --- a/tests/p_httpd/0-install_httpd.sh +++ b/tests/p_httpd/0-install_httpd.sh @@ -8,18 +8,10 @@ then php_mysql="php-mysqlnd" fi -#curl="curl" -#if [ $centos_ver -ge 8 ] & [ "$CONTAINERTEST" -eq "1" ] -#then -# curl="curl" -#fi - # Install tests deps # t_Log "Running $0 - httpd: installing $curl, http, php and $php_mysql" t_Log "Running $0 - httpd: installing http, php and $php_mysql" -#t_InstallPackage curl - # HTTPD / PHP # t_InstallPackage $curl httpd mod_ssl php $php_mysql t_InstallPackage httpd mod_ssl php $php_mysql diff --git a/tests/p_httpd/httpd_centos_brand_server_tokens.sh b/tests/p_httpd/httpd_centos_brand_server_tokens.sh deleted file mode 100755 index 2dd5cd3..0000000 --- a/tests/p_httpd/httpd_centos_brand_server_tokens.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Author: Athmane Madjoudj - -t_Log "Running $0 - httpd: centos branding / Server tokens value " - -curl -sI http://localhost/ | grep -i "Server:\ Apache.*\ (CentOS" > /dev/null 2>&1 - -t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_centos_brand_welcome.sh b/tests/p_httpd/httpd_centos_brand_welcome.sh deleted file mode 100755 index 6b42804..0000000 --- a/tests/p_httpd/httpd_centos_brand_welcome.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Author: Athmane Madjoudj - -t_Log "Running $0 - httpd: Welcome page has CentOS Branding." - -curl -s http://localhost/ | grep 'CentOS' > /dev/null 2>&1 - -t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_msvsphere_brand_server_tokens.sh b/tests/p_httpd/httpd_msvsphere_brand_server_tokens.sh new file mode 100755 index 0000000..d87be05 --- /dev/null +++ b/tests/p_httpd/httpd_msvsphere_brand_server_tokens.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# 27.03.2024 Pavel Negrobov -- адаптация для MSVSphere ОС + +t_Log "Running $0 - httpd: MSVSphere branding / Server tokens value " + +curl -sI http://localhost/ | grep -i "Server:\ Apache.*\ (MSVSphere" > /dev/null 2>&1 + +t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_msvsphere_brand_welcome.sh b/tests/p_httpd/httpd_msvsphere_brand_welcome.sh new file mode 100755 index 0000000..f14bb6e --- /dev/null +++ b/tests/p_httpd/httpd_msvsphere_brand_welcome.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# 27.03.2024 Pavel Negrobov -- адаптация для MSVSphere ОС + +t_Log "Running $0 - httpd: Welcome page has MSVSphere Branding." + +curl -s http://localhost/ | grep 'Инферит МСВСфера ОС' > /dev/null 2>&1 + +t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_servehtml.sh b/tests/p_httpd/httpd_servehtml.sh index 80325b2..d582f14 100755 --- a/tests/p_httpd/httpd_servehtml.sh +++ b/tests/p_httpd/httpd_servehtml.sh @@ -1,8 +1,12 @@ #!/bin/sh # Author: Athmane Madjoudj +# 27.03.2024 Pavel Negrobov -- адаптация для MSVSphere ОС t_Log "Running $0 - httpd: serve html page" -curl -H 'Accept-Language: en' -s http://localhost/ | grep 'Test Page' > /dev/null 2>&1 +#curl -H 'Accept-Language: en' -s http://localhost/ +#echo "--------------------------------------------" + +curl -H 'Accept-Language: en' -s http://localhost/ | grep 'Тестовая страница HTTP-сервера' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_servehtml_ssl.sh b/tests/p_httpd/httpd_servehtml_ssl.sh index a37699e..87f2677 100755 --- a/tests/p_httpd/httpd_servehtml_ssl.sh +++ b/tests/p_httpd/httpd_servehtml_ssl.sh @@ -1,8 +1,13 @@ #!/bin/sh # Author: Athmane Madjoudj +# 27.03.2024 Pavel Negrobov -- адаптация для MSVSphere ОС + t_Log "Running $0 - httpd: serve html page over SSL " -curl -H 'Accept-Language: en' -ks https://localhost/ | grep 'Test Page' > /dev/null 2>&1 +curl -H 'Accept-Language: en' -ks https://localhost/ +echo "--------------------------------------------" + +curl -H 'Accept-Language: en' -ks https://localhost/ | grep 'Тестовая страница HTTP-сервера' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_systemd/001-prepare_environment.sh b/tests/p_systemd/001-prepare_environment.sh new file mode 100755 index 0000000..fd7111d --- /dev/null +++ b/tests/p_systemd/001-prepare_environment.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Подготовка окружения для тестирования пакета ${TEST_PACKAGE_NAME}" + +/bin/dnf -y install audit kexec-tools + +/bin/systemctl enable auditd + +exit 0 diff --git a/tests/p_systemd/20-systemctl_list-service-status.sh b/tests/p_systemd/20-systemctl_list-service-status.sh index 7a5ac70..d7edfb1 100755 --- a/tests/p_systemd/20-systemctl_list-service-status.sh +++ b/tests/p_systemd/20-systemctl_list-service-status.sh @@ -1,5 +1,10 @@ -#!/bin/bash +#!/bin/bash -x # Author: Rene Diepstraten +# 28.03.2024 Pavel Negrobov -- skip для MSVSphere ОС + +# https://inferitos.asproagile.ru/_module/agile/view/issue/1285 +t_Log "Running $0 - skip for MSVSphere. Please see https://inferitos.asproagile.ru/_module/agile/view/issue/1285" +exit 0 [ ${centos_ver} -lt 7 ] && exit t_Log "Running $0 - checking if systemctl can check a service status"