From 3203e4dcd074367dcf00ec225db02c87242a53cf Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Thu, 14 Nov 2024 19:13:27 -0300 Subject: [PATCH] Use primary DNS hostname for testing IPA deployment. Signed-off-by: Rafael Guterres Jeffman --- tests/sanity/runtest.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh index a6c04d1..ead6a1e 100644 --- a/tests/sanity/runtest.sh +++ b/tests/sanity/runtest.sh @@ -1,7 +1,16 @@ #!/bin/sh -eux +dnshost="$(hostname)" +if command -v dig >/dev/null +then + hostip="$(dig +short $(hostname))" + if [ -n "${hostip}" ] + then + dnshost="$(dig +short -x "${hostip}" | sed "s/\(.*\)\./\1/")" + fi +fi systemctl unmask gssproxy -ipa-server-install --hostname=$(hostname) --no-host-dns -r EXAMPLE.TEST -n example.test --setup-dns --no-forwarders --allow-zone-overlap -p Secret123 -a Secret123 -U +ipa-server-install --hostname=${dnshost} -r EXAMPLE.TEST -n example.test --setup-dns --no-forwarders --allow-zone-overlap -p Secret123 -a Secret123 -U echo Secret123 | kinit admin ipa config-show ipa-server-install --uninstall -U