public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 5c8f0c0b98ef14529832341285eef550924f438d 927 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
 
#! /usr/bin/env python3

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright Red Hat
# Author: David Gibson <david@gibson.dropbear.id.au>

"""
Test A Simple Socket Transport

selftest/veth.py - Test various veth configurations
"""

import contextlib

import exeter

from tasst import nstool


@contextlib.contextmanager
def unconfigured_veth():
    with nstool.unshare_snh('ns1', '-Un') as ns1:
        with nstool.unshare_snh('ns2', '-n', parent=ns1, capable=True) as ns2:
            ns1.veth('veth1', 'veth2', ns2)
            yield (ns1, ns2)


@exeter.test
def test_ifs():
    with unconfigured_veth() as (ns1, ns2):
        exeter.assert_eq(set(ns1.ifs()), set(['lo', 'veth1']))
        exeter.assert_eq(set(ns2.ifs()), set(['lo', 'veth2']))


@exeter.test
def test_mtu():
    with unconfigured_veth() as (ns1, ns2):
        exeter.assert_eq(ns1.mtu('veth1'), 1500)
        exeter.assert_eq(ns2.mtu('veth2'), 1500)

debug log:

solving 5c8f0c0b ...
found 5c8f0c0b in https://archives.passt.top/passt-dev/20240805123701.1720730-15-david@gibson.dropbear.id.au/
found 3c0b3f5b in https://archives.passt.top/passt-dev/20240805123701.1720730-14-david@gibson.dropbear.id.au/

applying [1/2] https://archives.passt.top/passt-dev/20240805123701.1720730-14-david@gibson.dropbear.id.au/
diff --git a/test/tasst/selftest/veth.py b/test/tasst/selftest/veth.py
new file mode 100644
index 00000000..3c0b3f5b


applying [2/2] https://archives.passt.top/passt-dev/20240805123701.1720730-15-david@gibson.dropbear.id.au/
diff --git a/test/tasst/selftest/veth.py b/test/tasst/selftest/veth.py
index 3c0b3f5b..5c8f0c0b 100644

Checking patch test/tasst/selftest/veth.py...
Applied patch test/tasst/selftest/veth.py cleanly.
Checking patch test/tasst/selftest/veth.py...
Applied patch test/tasst/selftest/veth.py cleanly.

index at:
100644 5c8f0c0b98ef14529832341285eef550924f438d	test/tasst/selftest/veth.py

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