From ca0c33ae5b8a68806dd1c766e2f58ce24867f334 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 10 Jun 2022 12:32:43 +1000 Subject: Tweak dhclient arguments for readability A number of tests and examples use dhclient in both IPv4 and IPv6 modes. We use "dhclient -6" for IPv6, but usually just "dhclient" for IPv4. Add an explicit "-4" argument to make it more clear and explicit. In addition, when dhclient is run from within pasta it usually won't be "real" root, and so will not have access to write the default global pid file. This results in a mostly harmless but irritating error: Can't create /var/run/dhclient.pid: Permission denied We can avoid that by using the --no-pid flag to dhclient. Signed-off-by: David Gibson --- test/dhcp/pasta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/dhcp/pasta') diff --git a/test/dhcp/pasta b/test/dhcp/pasta index 77e9e42..e76454a 100644 --- a/test/dhcp/pasta +++ b/test/dhcp/pasta @@ -35,7 +35,7 @@ nsout MTU ip -j link show | jq -rM '.[] | select(.ifname == "__IFNAME__").mtu' check [ __MTU__ = 65520 ] test DHCPv6: address -ns /sbin/dhclient -6 __IFNAME__ +ns /sbin/dhclient -6 --no-pid __IFNAME__ nsout ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.prefixlen == 128).local' hout HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global").local' check [ __ADDR6__ = __HOST_ADDR6__ ] -- cgit v1.2.3