summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-07-11 10:00:00 +0200
committerDmitry V. Levin <ldv@strace.io>2023-07-14 15:13:53 +0200
commit1ddc2f7fbceea4fb051eeb50d356285c7ef9519b (patch)
tree5e444b6d69418be7bdad62567ec8ae9494d5497f /test
parentresolved: fix the canonical name returned by hosts lookup by address (diff)
downloadsystemd-1ddc2f7fbceea4fb051eeb50d356285c7ef9519b.tar.xz
systemd-1ddc2f7fbceea4fb051eeb50d356285c7ef9519b.zip
resolved: fix the canonical name returned by hosts lookup by name
In etc_hosts_lookup_by_name(), return the canonical name of the resolved address instead of the name used to obtain that address. Resolves: #20158
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-75.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/units/testsuite-75.sh b/test/units/testsuite-75.sh
index 504d1038e5..5445c152c9 100755
--- a/test/units/testsuite-75.sh
+++ b/test/units/testsuite-75.sh
@@ -300,6 +300,15 @@ run getent -s resolve hosts 127.128.0.5
grep -qEx '127\.128\.0\.5\s+localhost5(\s+localhost5?\.localdomain[45]?){4}' "$RUN_OUT"
[ "$(wc -l <"$RUN_OUT")" -eq 1 ]
+# Issue: https://github.com/systemd/systemd/issues/20158
+run dig +noall +answer +additional localhost5.
+grep -qEx 'localhost5\.\s+0\s+IN\s+A\s+127\.128\.0\.5' "$RUN_OUT"
+[ "$(wc -l <"$RUN_OUT")" -eq 1 ]
+run dig +noall +answer +additional localhost5.localdomain4.
+grep -qEx 'localhost5\.localdomain4\.\s+0\s+IN\s+CNAME\s+localhost5\.' "$RUN_OUT"
+grep -qEx 'localhost5\.\s+0\s+IN\s+A\s+127\.128\.0\.5' "$RUN_OUT"
+[ "$(wc -l <"$RUN_OUT")" -eq 2 ]
+
: "--- Basic resolved tests ---"
# Issue: https://github.com/systemd/systemd/issues/22229
# PR: https://github.com/systemd/systemd/pull/22231