1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
|