public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 9cef6271d944ac3df5c96ef1f72c03b1634c2877 799 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
 
#! /usr/bin/env avocado-runner-avocado-classless

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

"""
Test A Simple Socket Transport

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

import contextlib

from avocado_classless.test import assert_eq_unordered, test

from tasst.nstool import unshare_site


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


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

debug log:

solving 9cef6271 ...
found 9cef6271 in https://archives.passt.top/passt-dev/20230627025429.2209702-18-david@gibson.dropbear.id.au/

applying [1/1] https://archives.passt.top/passt-dev/20230627025429.2209702-18-david@gibson.dropbear.id.au/
diff --git a/test/tasst/meta/veth.py b/test/tasst/meta/veth.py
new file mode 100644
index 00000000..9cef6271

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

index at:
100644 9cef6271d944ac3df5c96ef1f72c03b1634c2877	test/tasst/meta/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).