TT#139151 Remove hostname checking

The code was switched to use ngcp_hostname so no need to check the
actual hostname but check ngcp-hostname output.

Change-Id: Ie7a74dfcff9d94c4839c49dac6a4d5dd64e32fcb
mr10.1
Mykola Malkov 4 years ago
parent 68a6a45218
commit 2e815d012c

@ -96,7 +96,6 @@ case "${NGCP_TESTS_MODE}" in
trap 'rm -f "${VARS}"' EXIT
cat >"${VARS}" <<-EOF
SKIP_DNS_CHECK_TEST: ${SKIP_DNS_CHECK_TEST:-false}
SKIP_STRICT_HOSTNAME_TEST: ${SKIP_STRICT_HOSTNAME_TEST:-false}
NODE_ACTIVE: ${NODE_ACTIVE}
EOF

@ -1,13 +1,10 @@
[%-
IF general.ngcp_type == 'spce';
host_match = "spce";
fqdn_match = "spce.";
ngcp_hostname_match = "spce";
ELSIF general.ngcp_type == 'sppro';
host_match = "/sp[12]/";
fqdn_match = "/sp[12]/";
ngcp_hostname_match = "/sp[12]/";
ELSE;
host_match = "/[a-z]+[0-9]{2}[ab]/";
fqdn_match = "/sp[12]/";
ngcp_hostname_match = "/[a-z]+[0-9]{2}[ab]/";
END;
-%]
@ -15,48 +12,8 @@ command:
hostname:
exit-status: 0
{{if not .Vars.SKIP_STRICT_HOSTNAME_TEST}}
hostname:
exit-status: 0
stdout:
- "[% host_match %]"
stderr: []
"hostname --fqdn":
ngcp-hostname:
exit-status: 0
stdout:
- "[% fqdn_match %]"
stderr: []
"hostname --short":
exit-status: 0
stdout:
- "[% host_match %]"
stderr: []
{{end}}
[% IF general.ngcp_type == 'spce' -%]
"[ $(hostname --short). = $(hostname --fqdn) ]":
title: "short hostname should be the same as fqdn (ignoring trailing dot)"
exit-status: 0
stdout: []
stderr: []
[% ELSIF general.ngcp_type == 'sppro' -%]
"[ $(hostname --short) = $(hostname --fqdn) ]":
title: "short hostname should be the same as fqdn"
exit-status: 0
stdout: []
stderr: []
[% ELSIF general.ngcp_type == 'carrier' -%]
"[ $(hostname --short) = $(cat /etc/hostname) ]":
title: "short hostname should be the same as /etc/hostname"
exit-status: 0
stdout: []
stderr: []
[% END -%]
"[ $(resolveip -s $(hostname --fqdn)) = $(resolveip -s $(hostname --short)) ]":
title: "ip-s of short hostname and fqdn should be the same"
exit-status: 0
stdout: []
- "[% ngcp_hostname_match %]"
stderr: []

Loading…
Cancel
Save