diff options
Diffstat (limited to 'test/pasta_options/dns_host_follow')
| -rw-r--r-- | test/pasta_options/dns_host_follow | 28 |
1 files changed, 28 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 |
