[lxc-devel] [lxd/master] test: Adds host-side MTU veth checks
tomponline on Github
lxc-bot at linuxcontainers.org
Tue Oct 8 07:51:51 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 407 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191008/b97774ba/attachment.bin>
-------------- next part --------------
From a05563b8ad929137ccdc046573520e804352faaf Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 8 Oct 2019 08:51:00 +0100
Subject: [PATCH] test: Adds host-side MTU veth checks
To ensure no regression of #6272 and #6270
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
test/suites/container_devices_nic_bridged.sh | 24 +++++++++++++++++---
test/suites/container_devices_nic_p2p.sh | 24 +++++++++++++++++---
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/test/suites/container_devices_nic_bridged.sh b/test/suites/container_devices_nic_bridged.sh
index 63724a50b8..0363dca052 100644
--- a/test/suites/container_devices_nic_bridged.sh
+++ b/test/suites/container_devices_nic_bridged.sh
@@ -63,7 +63,13 @@ test_container_devices_nic_bridged() {
# Check profile custom MTU is applied in container on boot.
if ! lxc exec "${ctName}" -- grep "1400" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Check profile custom MTU is applied on host side of veth.
+ if ! grep "1400" /sys/class/net/"${vethHostName}"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
@@ -126,7 +132,13 @@ test_container_devices_nic_bridged() {
# Check custom MTU is applied on hot-plug.
if ! lxc exec "${ctName}" -- grep "1401" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Check custom MTU is applied host-side on hot-plug.
+ if ! grep "1401" /sys/class/net/"${vethHostName}"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
@@ -171,7 +183,13 @@ test_container_devices_nic_bridged() {
# Check profile custom MTU is applied on hot-removal.
if ! lxc exec "${ctName}" -- grep "1400" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Checl profile custom MTU is applied host-side on hot-removal.
+ if ! grep "1400" /sys/class/net/"${vethHostName}"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
diff --git a/test/suites/container_devices_nic_p2p.sh b/test/suites/container_devices_nic_p2p.sh
index 81bb370a39..04f322c7ee 100644
--- a/test/suites/container_devices_nic_p2p.sh
+++ b/test/suites/container_devices_nic_p2p.sh
@@ -44,7 +44,13 @@ test_container_devices_nic_p2p() {
# Check profile custom MTU is applied in container on boot.
if ! lxc exec "${ctName}" -- grep "1400" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Check profile custom MTU is applied on host-side on boot.
+ if ! grep "1400" /sys/class/net/"${vethHostName}"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
@@ -100,7 +106,13 @@ test_container_devices_nic_p2p() {
# Check custom MTU is applied on hot-plug.
if ! lxc exec "${ctName}" -- grep "1401" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Check custom MTU is applied on host-side on hot-plug.
+ if ! grep "1401" /sys/class/net/"${vethHostName}p2p"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
@@ -135,7 +147,13 @@ test_container_devices_nic_p2p() {
# Check profile custom MTU is applied on hot-removal.
if ! lxc exec "${ctName}" -- grep "1400" /sys/class/net/eth0/mtu ; then
- echo "mtu invalid"
+ echo "container veth mtu invalid"
+ false
+ fi
+
+ # Check profile custom MTU is applied on host-side on hot-removal.
+ if ! grep "1400" /sys/class/net/"${vethHostName}"/mtu ; then
+ echo "host veth mtu invalid"
false
fi
More information about the lxc-devel
mailing list