Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- avocado/tasst/meta/veth.py | 4 ++++ avocado/tasst/site.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/avocado/tasst/meta/veth.py b/avocado/tasst/meta/veth.py index 48ef88b..afca192 100644 --- a/avocado/tasst/meta/veth.py +++ b/avocado/tasst/meta/veth.py @@ -41,3 +41,7 @@ class VethTasst(Tasst): def test_ifs(self): self.assertCountEqual(self.ns1.ifs(), ['lo', 'veth1']) self.assertCountEqual(self.ns2.ifs(), ['lo', 'veth2']) + + def test_mtu(self): + self.assertEquals(self.ns1.mtu('veth1'), 1500) + self.assertEquals(self.ns2.mtu('veth2'), 1500) diff --git a/avocado/tasst/site.py b/avocado/tasst/site.py index 5a63b76..00b86aa 100644 --- a/avocado/tasst/site.py +++ b/avocado/tasst/site.py @@ -64,6 +64,11 @@ class Site: self.require_cmds('ip') self.fg('ip link set {} up'.format(ifname), sudo=True) + def mtu(self, ifname): + self.require_cmds('ip') + (info,) = json.loads(self.output('ip -j link show {}'.format(ifname))) + return info['mtu'] + def addrinfos(self, ifname, **filter): self.require_cmds('ip') info = json.loads(self.output('ip -j addr show {}'.format(ifname))) @@ -134,6 +139,10 @@ class BaseSiteTasst(Tasst): for a in ['127.0.0.1/8', '::1/128']] self.assertCountEqual(site.addrs('lo'), expected) + def test_lo_mtu(self): + site = self.get_subsetup(BaseSiteTasst) + self.assertEqual(site.mtu('lo'), 65536) + # Represents the host on which the tests are running, as opposed to # some simulated host created by the tests -- 2.40.1