Change in vdsm[master]: functional net test: set both bridge_opts and ethtool_opts

danken at redhat.com danken at redhat.com
Thu Mar 26 18:07:19 UTC 2015


Dan Kenigsberg has uploaded a new change for review.

Change subject: functional net test: set both bridge_opts and ethtool_opts
......................................................................

functional net test: set both bridge_opts and ethtool_opts

This test has been written in an attempt to reproduce the referred bug,
to no avail.

Bug-Url: https://bugzilla.redhat.com/1186203
Change-Id: I57dd7fa0a05e83ab37393651f23cdf9b7e08ed89
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/functional/networkTests.py
1 file changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/39251/1

diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 8671244..81218fe 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -2394,3 +2394,45 @@
             self.assertNetworkDoesntExist(NETWORK_NAME)
             self.assertBondDoesntExist(BONDING_NAME, [nic])
             self.vdsm_net.save_config()
+
+    @cleanupNet
+    @ValidateRunningAsRoot
+    def test_ethtool_bridge_opts(self):
+        status, msg, info = self.vdsm_net.getVdsCapabilities()
+        self.assertEqual(status, SUCCESS, msg)
+        if '30_ethtool_options' not in info['hooks']['after_network_setup']:
+            raise SkipTest('ethtool hook not installed')
+
+        def get_gso(nic):
+            GSO = 'generic-segmentation-offload:'
+            rc, out, err = execCmd(['ethtool', '-k', nic])
+            self.assertTrue(rc == 0, 'error reading gso: %s' % err)
+            for line in out:
+                if line.startswith(GSO):
+                    return line[len(GSO) + 1:]
+
+        def setup_bridge_and_eth_opts(nic, priority, gso):
+            bridge_opts = {'priority': priority}
+            custom = {
+                'bridge_opts': 'priority=' + priority,
+                'ethtool_opts': '-K * gso ' + gso
+            }
+
+            status, msg = self.vdsm_net.setupNetworks(
+                {NETWORK_NAME: {'nic': nic, 'bridged': True,
+                                'vlan': VLAN_ID,
+                                'custom': custom}},
+                {}, NOCHK)
+            self.assertEqual(status, SUCCESS, msg)
+            self.assertNetworkExists(NETWORK_NAME, bridgeOpts=bridge_opts)
+            self.assertEqual(get_gso(nic), gso)
+
+        with dummyIf(1) as (nic, ):
+            setup_bridge_and_eth_opts(nic, '42', 'on')
+            setup_bridge_and_eth_opts(nic, '33', 'off')
+
+            status, msg = self.vdsm_net.setupNetworks(
+                {NETWORK_NAME: {'remove': True}},
+                {}, NOCHK)
+            self.assertEqual(status, SUCCESS, msg)
+            self.assertNetworkDoesntExist(NETWORK_NAME)


-- 
To view, visit https://gerrit.ovirt.org/39251
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57dd7fa0a05e83ab37393651f23cdf9b7e08ed89
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list