From c2e7ddba459110f88aacfb30762e454494d5db7e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 17 Sep 2020 16:01:15 -0700 Subject: [PATCH] Fix DNS config in realmd_join_sssd and realmd_join_cockpit Seems what they had before worked until systemd-resolved became the default; now we need to make sure we do nmcli mod and then bring the connection down and up, as we do in tapnet.pm. Writing to resolv.conf is kinda "wrong" for resolved but I don't think it really breaks anything so I think I'll just leave those bits in until F32 goes EOL just in case they're still somehow needed on F31 or F32. Signed-off-by: Adam Williamson --- tests/realmd_join_cockpit.pm | 6 ++++++ tests/realmd_join_sssd.pm | 3 +++ 2 files changed, 9 insertions(+) diff --git a/tests/realmd_join_cockpit.pm b/tests/realmd_join_cockpit.pm index 0f1a50da..c46c32e4 100644 --- a/tests/realmd_join_cockpit.pm +++ b/tests/realmd_join_cockpit.pm @@ -11,6 +11,12 @@ sub run { # use FreeIPA server as DNS server bypass_1691487; assert_script_run "printf 'search domain.local\nnameserver 172.16.2.100' > /etc/resolv.conf"; + # this gets us the name of the first connection in the list, + # which should be what we want + my $connection = script_output "nmcli --fields NAME con show | head -2 | tail -1"; + assert_script_run "nmcli con mod '$connection' ipv4.dns '172.16.2.100'"; + assert_script_run "nmcli con down '$connection'"; + assert_script_run "nmcli con up '$connection'"; # wait for the server to be ready (do it now just to make sure name # resolution is working before we proceed) mutex_lock "freeipa_ready"; diff --git a/tests/realmd_join_sssd.pm b/tests/realmd_join_sssd.pm index cd41476b..4fe9743a 100644 --- a/tests/realmd_join_sssd.pm +++ b/tests/realmd_join_sssd.pm @@ -27,6 +27,9 @@ sub run { # which should be what we want my $connection = script_output "nmcli --fields NAME con show | head -2 | tail -1"; assert_script_run "nmcli con mod '$connection' ipv4.dns '$server_ip'"; + assert_script_run "nmcli con down '$connection'"; + assert_script_run "nmcli con up '$connection'"; + # wait for the server or replica to be ready (do it now just to be # sure name resolution is working before we proceed) mutex_lock $server_mutex;