You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
system-tests/templates/800_network-hostname.yaml.tt2

63 lines
1.4 KiB

[%-
IF general.ngcp_type == 'spce';
host_match = "spce";
fqdn_match = "spce.";
ELSIF general.ngcp_type == 'sppro';
host_match = "/sp[12]/";
fqdn_match = "/sp[12]/";
ELSE;
host_match = "/[a-z]+[0-9]{2}[ab]/";
fqdn_match = "/sp[12]/";
END;
-%]
command:
hostname:
exit-status: 0
{{if not .Vars.SKIP_STRICT_HOSTNAME_TEST}}
hostname:
exit-status: 0
stdout:
- "[% host_match %]"
stderr: []
"hostname --fqdn":
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: []
stderr: []