blob b4f6f6070a1223c137806470c436c9fb176ef967 1875 bytes (raw)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| | # 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/dhcp - Check DHCP and DHCPv6 functionality in pasta mode
#
# Copyright (c) 2021 Red Hat GmbH
# Author: Stefano Brivio <sbrivio@redhat.com>
nstools ip jq /sbin/dhclient
htools ip jq
test Interface name
nsout IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
check [ -n "__IFNAME__" ]
test DHCP: address
ns /sbin/dhclient -4 --no-pid __IFNAME__
nsout ADDR ip -j -4 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[0].local] | .[0]'
hout HOST_ADDR ip -j -4 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[0].local] | .[0]'
check [ __ADDR__ = __HOST_ADDR__ ]
test DHCP: route
nsout GW ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
hout HOST_GW ip -j -4 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]'
check [ __GW__ = __HOST_GW__ ]
test DHCP: MTU
nsout MTU ip -j link show | jq -rM '.[] | select(.ifname == "__IFNAME__").mtu'
check [ __MTU__ = 65520 ]
test DHCPv6: address
ns /sbin/dhclient -6 --no-pid __IFNAME__
hout HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").dev] | .[0]'
nsout ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.prefixlen == 128).local] | .[0]'
hout HOST_ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__HOST_IFNAME6__").addr_info[] | select(.scope == "global").local] | .[0]'
check [ __ADDR6__ = __HOST_ADDR6__ ]
test DHCPv6: route
nsout GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
hout HOST_GW6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]'
check [ __GW6__ = __HOST_GW6__ ]
|
debug log:
solving b4f6f60 ...
found b4f6f60 in https://archives.passt.top/passt-dev/20231208174932.3390897-1-sbrivio@redhat.com/
found 309001b in https://passt.top/passt
preparing index
index prepared:
100644 309001b79a03a2133bbfe9ac4bd2ba3e885c5176 test/pasta/dhcp
applying [1/1] https://archives.passt.top/passt-dev/20231208174932.3390897-1-sbrivio@redhat.com/
diff --git a/test/pasta/dhcp b/test/pasta/dhcp
index 309001b..b4f6f60 100644
Checking patch test/pasta/dhcp...
Applied patch test/pasta/dhcp cleanly.
index at:
100644 b4f6f6070a1223c137806470c436c9fb176ef967 test/pasta/dhcp
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).