public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob d358b294e5273bbe8251cb8484c4dd7a4dc24166 1510 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
 
# 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/passt/udp - Check UDP functionality in passt mode
#
# Copyright (c) 2021 Red Hat GmbH
# Author: Stefano Brivio <sbrivio@redhat.com>

gtools	socat ip jq cmp
htools	socat jq

set	TEMP __STATEDIR__/test.bin

test	UDP/IPv4: host to guest
guestb	socat -u UDP4-LISTEN:10001,null-eof OPEN:test.bin,create,trunc
sleep	1
host	socat -u OPEN:__BASEPATH__/medium.bin UDP4:127.0.0.1:10001,shut-null
guestw
guest	cmp /root/medium.bin test.bin

test	UDP/IPv4: guest to host
hostb	socat -u UDP4-LISTEN:10003,bind=127.0.0.1,null-eof OPEN:__TEMP__,create,trunc
guest	socat -u OPEN:/root/medium.bin UDP4:__NAT_TO_HOST4__:10003,shut-null
hostw
check	cmp __BASEPATH__/medium.bin __TEMP__

test	UDP/IPv6: host to guest
guestb	socat -u UDP6-LISTEN:10001,null-eof OPEN:test.bin,create,trunc
sleep	1
host	socat -u OPEN:__BASEPATH__/medium.bin UDP6:[::1]:10001,shut-null
guestw
guest	cmp /root/medium.bin test.bin

test	UDP/IPv6: guest to host
hostb	socat -u UDP6-LISTEN:10003,bind=[::1],null-eof OPEN:__TEMP__,create,trunc
gout	GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
gout	IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
guest	socat -u OPEN:/root/medium.bin UDP6:[__NAT_TO_HOST6__%__IFNAME__]:10003,shut-null
hostw
check	cmp __BASEPATH__/medium.bin __TEMP__

debug log:

solving d358b29 ...
found d358b29 in https://archives.passt.top/passt-dev/20230501110702.3915529-4-david@gibson.dropbear.id.au/
found 80d0fa3 in https://passt.top/passt
preparing index
index prepared:
100644 80d0fa3696d60b119925fecbfa6f975ad111b813	test/passt/udp

applying [1/1] https://archives.passt.top/passt-dev/20230501110702.3915529-4-david@gibson.dropbear.id.au/
diff --git a/test/passt/udp b/test/passt/udp
index 80d0fa3..d358b29 100644

Checking patch test/passt/udp...
Applied patch test/passt/udp cleanly.

index at:
100644 d358b294e5273bbe8251cb8484c4dd7a4dc24166	test/passt/udp

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