diff --git a/templates/800_network-hostname.yaml.tt2 b/templates/800_network-hostname.yaml.tt2 index 65bbec7..2ec0ee0 100644 --- a/templates/800_network-hostname.yaml.tt2 +++ b/templates/800_network-hostname.yaml.tt2 @@ -15,7 +15,7 @@ command: hostname: exit-status: 0 -[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] +{{if ne .Env.SKIP_STRICT_HOSTNAME_TEST "true"}} hostname: exit-status: 0 stdout: @@ -34,7 +34,7 @@ command: - "[% host_match %]" stderr: [] -[% END -%] +{{end}} [% IF general.ngcp_type == 'spce' -%] "[ $(hostname --short). = $(hostname --fqdn) ]": title: "short hostname should be the same as fqdn (ignoring trailing dot)" diff --git a/templates/goss.yaml.tt2 b/templates/goss.yaml.tt2 index f576f2e..6010121 100644 --- a/templates/goss.yaml.tt2 +++ b/templates/goss.yaml.tt2 @@ -22,14 +22,14 @@ gossfile: 610_kernel-sysctl-params.yaml: {} 615_kernel-modules.yaml: {} 800_network-hostname.yaml: {} -[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] +{{if ne .Env.SKIP_DNS_CHECK_TEST "true"}} 810_network-dns-debian.yaml: {} [% IF general.ngcp_type == 'spce' -%] 811_network-dns-ngcp-ce.yaml: {} [% ELSE -%] 812_network-dns-ngcp-pro.yaml: {} [% END -%] -[% END -%] +{{end}} 820_network-ports-debian.yaml: {} 821_network-ports-ngcp.yaml: {} [% IF general.ngcp_type != 'spce' -%] diff --git a/testrunner b/testrunner index 28fe4fa..ebbf2a5 100755 --- a/testrunner +++ b/testrunner @@ -19,24 +19,8 @@ fi rm -f /usr/sbin/goss ln -s "/usr/sbin/${goss}" /usr/sbin/goss -host_yml_file="/etc/ngcp-config/config.$(hostname).yml" -if [ -n "${SKIP_DNS_CHECK_TEST}" ] || [ -n "${SKIP_STRICT_HOSTNAME_TEST}" ] ; then - diag "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 - diag "Rebuilding test configs in /etc/ngcp-system-tests/" ngcpcfg build /etc/ngcp-system-tests/* 2>&1 -rm -f "${host_yml_file}" rm -rf "${REPORT_DIRECTORY}" mkdir -p "${REPORT_DIRECTORY}" @@ -54,6 +38,10 @@ case "${DEBIAN_RELEASE}" in esac export DEBIAN_RELEASE +# We need to export these, so that goss sees existent variables. +export SKIP_DNS_CHECK_TEST=${SKIP_DNS_CHECK_TEST:-false} +export SKIP_STRICT_HOSTNAME_TEST=${SKIP_STRICT_HOSTNAME_TEST:-false} + goss -g "/etc/ngcp-system-tests/goss.yaml" validate --format tap \ | tee "${TAP_RESULTS}"