aboutgitcodebugslistschat
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pasta_options/dns_host_follow28
-rwxr-xr-xtest/run1
2 files changed, 29 insertions, 0 deletions
diff --git a/test/pasta_options/dns_host_follow b/test/pasta_options/dns_host_follow
new file mode 100644
index 0000000..2d7ac6d
--- /dev/null
+++ b/test/pasta_options/dns_host_follow
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# PASST - Plug A Simple Socket Transport
+# for qemu/UNIX domain socket mode
+#
+# PASTA - Pack A Subtle Tap Abstraction
+# for network namespace/tap device mode
+#
+# test/pasta_options/dns_host_follow - Check that we follow host's resolv.conf
+
+htools unshare mount grep
+
+test Host nameserver follows changes to resolv.conf
+set DIR __STATEDIR__/resolv
+set LOG_FILE __STATEDIR__/resolv.log
+
+passt unshare -rUm
+passt mkdir -p __DIR__/upper __DIR__/work
+passt mount -t overlay -o lowerdir=/etc,upperdir=__DIR__/upper,workdir=__DIR__/work none /etc
+passt echo "nameserver 192.0.2.1" > /etc/r && mv /etc/r /etc/resolv.conf
+passt ./pasta -d -l __LOG_FILE__ --dns-forward 192.0.2.53 -- sleep 3 2>/dev/null &
+sleep 1
+passt echo "nameserver 192.0.2.2" > /etc/r && mv /etc/r /etc/resolv.conf
+sleep 1
+check grep -q "new host nameserver 192.0.2.2" __LOG_FILE__
+passt wait
+passt umount /etc
+passt exit
diff --git a/test/run b/test/run
index 14ddbbf..751ff50 100755
--- a/test/run
+++ b/test/run
@@ -87,6 +87,7 @@ run() {
test pasta_options/log_to_file
test pasta_options/netns_only
test pasta_options/no_pidns
+ test pasta_options/dns_host_follow
teardown pasta_options
setup build