From bdf0d12f07289d644ce2cbc6ff925dd1fe6746ed Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 21 Jan 2016 17:40:10 +0100 Subject: [PATCH] MT#16755 Add support SKIP_DNS_CHECK_TEST and SKIP_STRICT_HOSTNAME_TEST env variables The Jenkins test 'netinstall-test-ngcp-installer' restores plain Debian VM and install NGCP using ngcp-installer only. In this case the test should skip some strict host/names checks. Change-Id: I9b84784ebed0a54ff51aa2baef274f5466879352 --- ce/01_hostname-and-interfaces.json.tt2 | 5 +++++ ce/09_system_dns.json.tt2 | 16 +++++++++------- pro/01_hostname-and-interfaces.json.tt2 | 5 +++++ pro/09_system_dns.json.tt2 | 16 +++++++++------- testrunner | 16 ++++++++++++++++ 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/ce/01_hostname-and-interfaces.json.tt2 b/ce/01_hostname-and-interfaces.json.tt2 index a4c204c..509824c 100644 --- a/ce/01_hostname-and-interfaces.json.tt2 +++ b/ce/01_hostname-and-interfaces.json.tt2 @@ -1,5 +1,9 @@ { "command": { + "hostname": { + "exit-status": "0" + }, +[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] "hostname": { "exit-status": "0", "stdout": [ @@ -21,6 +25,7 @@ ], "stderr": [] }, +[% END -%] "[ $(hostname --short). = $(hostname --fqdn) ]": { "comment": "short hostname should be the same as fqdn (ignoring trailing dot)", "exit-status": "0", diff --git a/ce/09_system_dns.json.tt2 b/ce/09_system_dns.json.tt2 index ec8b03a..0268194 100644 --- a/ce/09_system_dns.json.tt2 +++ b/ce/09_system_dns.json.tt2 @@ -1,18 +1,20 @@ { "dns": { - "localhost": { - "resolveable": true, - "addrs": [ - "127.0.0.1" - ], - "timeout": 500 - }, +[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] "spce": { "resolveable": true, "addrs": [ "127.0.0.2" ], "timeout": 500 + }, +[% END -%] + "localhost": { + "resolveable": true, + "addrs": [ + "127.0.0.1" + ], + "timeout": 500 } } } diff --git a/pro/01_hostname-and-interfaces.json.tt2 b/pro/01_hostname-and-interfaces.json.tt2 index c71ffbc..afb4750 100644 --- a/pro/01_hostname-and-interfaces.json.tt2 +++ b/pro/01_hostname-and-interfaces.json.tt2 @@ -1,5 +1,9 @@ { "command": { + "hostname": { + "exit-status": "0" + }, +[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] "hostname": { "exit-status": "0", "stdout": [ @@ -21,6 +25,7 @@ ], "stderr": [] }, +[% END -%] "[ $(hostname --short) = $(hostname --fqdn) ]": { "comment": "short hostname should be the same as fqdn (ignoring trailing dot)", "exit-status": "0", diff --git a/pro/09_system_dns.json.tt2 b/pro/09_system_dns.json.tt2 index 0b46e05..18ca40d 100644 --- a/pro/09_system_dns.json.tt2 +++ b/pro/09_system_dns.json.tt2 @@ -1,25 +1,27 @@ { "dns": { - "localhost": { +[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] + "sp1": { "resolveable": true, "addrs": [ - "127.0.0.1" + "192.168.255.251" ], "timeout": 500 }, - "sp1": { + "sp2": { "resolveable": true, "addrs": [ - "192.168.255.251" + "192.168.255.252" ], "timeout": 500 }, - "sp2": { +[% END -%] + "localhost": { "resolveable": true, "addrs": [ - "192.168.255.252" + "127.0.0.1" ], "timeout": 500 } } -} +} \ No newline at end of file diff --git a/testrunner b/testrunner index e887ac4..e2caa25 100755 --- a/testrunner +++ b/testrunner @@ -26,6 +26,21 @@ if [ ! -x /usr/sbin/goss ] ; then chmod +x /usr/sbin/goss fi +host_yml_file="/etc/ngcp-config/config.$(hostname).yml" +if [ -n "${SKIP_DNS_CHECK_TEST}" ] || [ -n "${SKIP_STRICT_HOSTNAME_TEST}" ] ; then + echo "Configuring host specific YML config: ${host_yml_file}" + cat > "${host_yml_file}" << EOF +--- +sipwise: + system_tester: + skip_dns_check_test: ${SKIP_DNS_CHECK_TEST:-false} + skip_strict_hostname_test: ${SKIP_STRICT_HOSTNAME_TEST:-false} +EOF +else + # remove the file if exist from the previous run + rm -f "${host_yml_file}" +fi + echo "Rebuilding test configs in /etc/ngcp-test/" ngcpcfg build /etc/ngcp-test/* @@ -42,3 +57,4 @@ else echo "not ok 1 - found errors, run test manually" >> "${TAP_RESULTS}" fi +rm -f "${host_yml_file}"