public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 74223da02669177c5b3cd84151596be7a7649ec1 2294 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
47
48
49
50
51
52
53
54
55
56
57
58
59
 
# 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/migrate/rampstream_in - Check sequence correctness with inbound ramp
#
# Copyright (c) 2025 Red Hat
# Author: David Gibson <david@gibson.dropbear.id.au>

g1tools	ip jq dhclient socat cat
htools	ip jq

set	MAP_HOST4 192.0.2.1
set	MAP_HOST6 2001:db8:9a55::1
set	MAP_NS4 192.0.2.2
set	MAP_NS6 2001:db8:9a55::2
set	RAMPS 6000000

test	Interface name
g1out	IFNAME1 ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
hout	HOST_IFNAME ip -j -4 route show|jq -rM '[.[] | select(.dst == "default").dev] | .[0]'
hout	HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").dev] | .[0]'
check	[ -n "__IFNAME1__" ]

test	DHCP: address
guest1	ip link set dev __IFNAME1__ up
guest1	/sbin/dhclient -4 __IFNAME1__
g1out	ADDR1 ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME1__").addr_info[0].local'
hout	HOST_ADDR ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME__").addr_info[0].local'
check	[ "__ADDR1__" = "__HOST_ADDR__" ]

test	DHCPv6: address
# Link is up now, wait for DAD to complete
guest1	while ip -j -6 addr show tentative | jq -e '.[].addr_info'; do sleep 0.1; done
guest1	/sbin/dhclient -6 __IFNAME1__
# Wait for DAD to complete on the DHCP address
guest1	while ip -j -6 addr show tentative | jq -e '.[].addr_info'; do sleep 0.1; done
g1out	ADDR1_6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME1__").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" and .deprecated != true).local] | .[0]'
check	[ "__ADDR1_6__" = "__HOST_ADDR6__" ]

test	TCP/IPv4: host > guest
g1out	GW1 ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
guest1b	socat -u TCP4-LISTEN:10001 EXEC:"rampstream-check.sh __RAMPS__"
sleep	1
hostb	socat -u EXEC:"test/rampstream send __RAMPS__" TCP4:__ADDR1__:10001

sleep	1

monb	echo "migrate tcp:0:20005" | socat -u STDIN UNIX:__STATESETUP__/qemu_1_mon.sock

hostw

guest2	cat rampstream.err
guest2	[ $(cat rampstream.status) -eq 0 ]

debug log:

solving 74223da0 ...
found 74223da0 in https://archives.passt.top/passt-dev/20250214130845.3475757-6-david@gibson.dropbear.id.au/ ||
	https://archives.passt.top/passt-dev/20250214090806.2261034-5-david@gibson.dropbear.id.au/ ||
	https://archives.passt.top/passt-dev/20250213121417.617970-3-david@gibson.dropbear.id.au/ ||
	https://archives.passt.top/passt-dev/20250213045813.3767488-3-david@gibson.dropbear.id.au/
found 46f41431 in https://passt.top/passt
preparing index
index prepared:
100644 46f41431f6c45db61f6f9f83d5f0d80c72e01e04	test/migrate/rampstream_in

applying [1/1] https://archives.passt.top/passt-dev/20250214130845.3475757-6-david@gibson.dropbear.id.au/
diff --git a/test/migrate/rampstream_in b/test/migrate/rampstream_in
index 46f41431..74223da0 100644

Checking patch test/migrate/rampstream_in...
Applied patch test/migrate/rampstream_in cleanly.

skipping https://archives.passt.top/passt-dev/20250214090806.2261034-5-david@gibson.dropbear.id.au/ for 74223da0
skipping https://archives.passt.top/passt-dev/20250213121417.617970-3-david@gibson.dropbear.id.au/ for 74223da0
skipping https://archives.passt.top/passt-dev/20250213045813.3767488-3-david@gibson.dropbear.id.au/ for 74223da0
index at:
100644 74223da02669177c5b3cd84151596be7a7649ec1	test/migrate/rampstream_in

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).