Change in vdsm[ovirt-3.5]: net: tests: do not use KernelConfig.__eq__ in tests

ibarkan at redhat.com ibarkan at redhat.com
Sun Jun 28 20:50:29 UTC 2015


Hello Petr Horáček, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/42963

to review the following change.

Change subject: net: tests: do not use KernelConfig.__eq__ in tests
......................................................................

net: tests: do not use KernelConfig.__eq__ in tests

Until now, functional tests used the __eq__ to assert that a
KernelConfig instance is equal to a RunningConfig instance. This
hides the normalization process inside __eq__ and makes the life of
the tester very hard if something really breaks. We trade some magic
here for a better error message.

Change-Id: I9b142d1b62e293bf094f650c3c691d65f684231d
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/42813
Continuous-Integration: Jenkins CI
Reviewed-by: Petr Horáček <phoracek at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/functional/networkTests.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/42963/1

diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index f9e9339..4c8fb1d 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -351,7 +351,11 @@
         netinfo = self.vdsm_net.netinfo
         kernel_config = KernelConfig(netinfo)
         running_config = self.vdsm_net.config
-        self.assertEqual(kernel_config, running_config)
+        # do not use KernelConfig.__eq__ to get better exception if something
+        # breaks here
+        normalized_config = kernel_config.normalize(running_config)
+        self.assertEqual(normalized_config.networks, kernel_config.networks)
+        self.assertEqual(normalized_config.bonds, kernel_config.bonds)
 
     @cleanupNet
     @permutations([[True], [False]])


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b142d1b62e293bf094f650c3c691d65f684231d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list