Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- test/tasst/selftest/veth.py | 7 +++++++ test/tasst/snh.py | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/test/tasst/selftest/veth.py b/test/tasst/selftest/veth.py index 3c0b3f5b..5c8f0c0b 100644 --- a/test/tasst/selftest/veth.py +++ b/test/tasst/selftest/veth.py @@ -31,3 +31,10 @@ 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'])) + + +(a)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) diff --git a/test/tasst/snh.py b/test/tasst/snh.py index fd8f6f13..0554fbd0 100644 --- a/test/tasst/snh.py +++ b/test/tasst/snh.py @@ -130,6 +130,11 @@ class SimNetHost(contextlib.AbstractContextManager): for ai in self.addrinfos(ifname, **criteria) if 'tentative' not in ai] + def mtu(self, ifname): + cmd = ['ip', '-j', 'link', 'show', f'{ifname}'] + (info,) = json.loads(self.output(*cmd)) + return info['mtu'] + # Internal tests def test_true(self): with self as snh: @@ -192,10 +197,14 @@ class SimNetHost(contextlib.AbstractContextManager): with self as snh: assert set(snh.addrs('lo')) == expected + def test_lo_mtu(self): + with self as snh: + exeter.assert_eq(snh.mtu('lo'), 65536) + SELFTESTS = [test_true, test_false, test_echo, test_timeout, test_bg_true, test_bg_false, test_bg_echo, test_bg_timeout, test_bg_context_timeout, - test_has_lo, test_lo_addrs] + test_has_lo, test_lo_addrs, test_lo_mtu] @classmethod def selftest(cls, setup): -- 2.45.2