From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 May 2026 09:23:37 +0000 (+0200) Subject: TEST-75-RESOLVED: use SYSTEMD_INVOKED_AS=resolvconf X-Git-Tag: v261-rc2~26^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F42286%2Fhead;p=thirdparty%2Fsystemd.git TEST-75-RESOLVED: use SYSTEMD_INVOKED_AS=resolvconf --- diff --git a/test/units/TEST-75-RESOLVED.sh b/test/units/TEST-75-RESOLVED.sh index 03e50db7b32..abc6b0d8ac6 100755 --- a/test/units/TEST-75-RESOLVED.sh +++ b/test/units/TEST-75-RESOLVED.sh @@ -248,19 +248,14 @@ manual_testcase_01_resolvectl() { resolvectl dns hoge.foo 10.0.1.3 10.0.1.4 assert_in '10.0.1.1 10.0.1.2' "$(resolvectl dns hoge)" assert_in '10.0.1.3 10.0.1.4' "$(resolvectl dns hoge.foo)" - if ! RESOLVCONF=$(command -v resolvconf 2>/dev/null); then - TMPDIR=$(mktemp -d -p /tmp resolvconf-tests.XXXXXX) - RESOLVCONF="$TMPDIR"/resolvconf - ln -s "$(command -v resolvectl 2>/dev/null)" "$RESOLVCONF" - fi # DNS servers - echo nameserver 10.0.2.1 10.0.2.2 | "$RESOLVCONF" -a hoge - echo nameserver 10.0.2.3 10.0.2.4 | "$RESOLVCONF" -a hoge.foo + echo nameserver 10.0.2.1 10.0.2.2 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge + echo nameserver 10.0.2.3 10.0.2.4 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge.foo assert_in '10.0.2.1 10.0.2.2' "$(resolvectl dns hoge)" assert_in '10.0.2.3 10.0.2.4' "$(resolvectl dns hoge.foo)" - echo nameserver 10.0.3.1 10.0.3.2 | "$RESOLVCONF" -a hoge.inet.ipsec.192.168.35 - echo nameserver 10.0.3.3 10.0.3.4 | "$RESOLVCONF" -a hoge.foo.dhcp + echo nameserver 10.0.3.1 10.0.3.2 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge.inet.ipsec.192.168.35 + echo nameserver 10.0.3.3 10.0.3.4 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge.foo.dhcp assert_in '10.0.3.1 10.0.3.2' "$(resolvectl dns hoge)" assert_in '10.0.3.3 10.0.3.4' "$(resolvectl dns hoge.foo)" @@ -268,36 +263,37 @@ manual_testcase_01_resolvectl() { # without domain/search clears existing domain resolvectl domain hoge test-domain.example.com assert_in 'test-domain.example.com' "$(resolvectl domain hoge)" - echo nameserver 10.0.2.1 10.0.2.2 | "$RESOLVCONF" -a hoge + echo nameserver 10.0.2.1 10.0.2.2 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge assert_not_in 'test-domain.example.com' "$(resolvectl domain hoge)" # cannot set domain without DNS servers - (! echo domain test-domain.example.com | "$RESOLVCONF" -a hoge) + (! echo domain test-domain.example.com | SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge) # can set domain with DNS server(s) - echo -e "nameserver 10.0.2.1 10.0.2.2\ndomain test-domain1.example.com test-domain2.example.com\nsearch test-search-domain.example.com" | "$RESOLVCONF" -a hoge + echo -e "nameserver 10.0.2.1 10.0.2.2\ndomain test-domain1.example.com test-domain2.example.com\nsearch test-search-domain.example.com" | \ + SYSTEMD_INVOKED_AS=resolvconf resolvectl -a hoge assert_in 'test-domain1.example.com' "$(resolvectl domain hoge)" assert_in 'test-domain2.example.com' "$(resolvectl domain hoge)" assert_in 'test-search-domain.example.com' "$(resolvectl domain hoge)" # Tests for 'resolvconf -x' - echo nameserver 10.0.2.1 | "$RESOLVCONF" -x -a hoge + echo nameserver 10.0.2.1 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -x -a hoge assert_in '~.' "$(resolvectl domain hoge)" resolvectl domain hoge "hoge.example.com" assert_in 'hoge.example.com' "$(resolvectl domain hoge)" assert_not_in '~.' "$(resolvectl domain hoge)" - echo -e "nameserver 10.0.2.1\ndomain test-domain.example.com" | "$RESOLVCONF" -x -a hoge + echo -e "nameserver 10.0.2.1\ndomain test-domain.example.com" | SYSTEMD_INVOKED_AS=resolvconf resolvectl -x -a hoge assert_in 'test-domain.example.com' "$(resolvectl domain hoge)" assert_in '~.' "$(resolvectl domain hoge)" # Tests for 'resolvconf -p' resolvectl default-route hoge yes assert_in 'yes' "$(resolvectl default-route hoge)" - echo nameserver 10.0.3.3 10.0.3.4 | "$RESOLVCONF" -p -a hoge + echo nameserver 10.0.3.3 10.0.3.4 | SYSTEMD_INVOKED_AS=resolvconf resolvectl -p -a hoge assert_in 'no' "$(resolvectl default-route hoge)" # Tests for 'resolvconf -d' resolvectl dns hoge 10.0.3.1 10.0.3.2 resolvectl domain hoge test-domain.example.com - "$RESOLVCONF" -d hoge + SYSTEMD_INVOKED_AS=resolvconf resolvectl -d hoge assert_not_in '10.0.3.1' "$(resolvectl dns hoge)" assert_not_in '10.0.3.2' "$(resolvectl dns hoge)" assert_not_in 'test-domain.example.com' "$(resolvectl domain hoge)"