Change in vdsm[ovirt-3.5]: net: tests: clean legacy bonds from kernelConfig

ibarkan at redhat.com ibarkan at redhat.com
Mon Jul 13 13:04:16 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: net: tests: clean legacy bonds from kernelConfig
......................................................................

net: tests: clean legacy bonds from kernelConfig

VdsProxy netinfo is built from getVdsCapabilities which reports fake
legacy bonds in el6. Remove them from here to avoid lying to
KernelConfig

Change-Id: I094eb615bbe05e4661b34e8374d105401b8db8b6
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
Label: ovirt-3.5-only
Bug-Url: https://bugzilla.redhat.com/1203422
---
M tests/functional/networkTests.py
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/43513/1

diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index c29ff01..39fa251 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -17,6 +17,7 @@
 # Refer to the README and COPYING files for full details of the license
 #
 from contextlib import contextmanager
+import copy
 from functools import wraps
 import os.path
 import json
@@ -352,7 +353,7 @@
         return status, msg
 
     def _assert_kernel_config_matches_running_config(self):
-        netinfo = self.vdsm_net.netinfo
+        netinfo = self._clean_legacy_bonds(self.vdsm_net.netinfo)
         kernel_config = KernelConfig(netinfo)
         running_config = self.vdsm_net.config
         # do not use KernelConfig.__eq__ to get better exception if something
@@ -361,6 +362,16 @@
         self.assertEqual(normalized_config.networks, kernel_config.networks)
         self.assertEqual(normalized_config.bonds, kernel_config.bonds)
 
+    def _clean_legacy_bonds(self, netinfo):
+        """VdsProxy netinfo is built from getVdsCapabilities which reports
+        fake legacy bonds in el6. Remove them from here to avoid lying to
+        KernelConfig
+        """
+        netinfo = copy.deepcopy(netinfo)
+        for bond in caps._REQUIRED_BONDINGS:
+            netinfo.bondings.pop(bond, None)
+        return netinfo
+
     @cleanupNet
     @permutations([[True], [False]])
     @RequireDummyMod


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I094eb615bbe05e4661b34e8374d105401b8db8b6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list