TT#72351 Stop using a host-specific config.yml for customizations

This is problematic because it can stomp over pre-existing host-specific
local files, which we'd end up removing. It also requires to run ngcpcfg
before being able to execute the tests.

We wwitch to use golang's text/template support for environment variables
so that we can stop using this hack.

Change-Id: I6c4d5b2efde2704d68a327d4df9af51bcb8fd964
changes/51/36451/7
Guillem Jover 6 years ago
parent 85d1db0214
commit f806fb40e4

@ -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)"

@ -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' -%]

@ -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}"

Loading…
Cancel
Save