Change in vdsm[master]: tests: Adding functional tests for networking
gvallare at redhat.com
gvallare at redhat.com
Thu Jun 13 14:53:30 UTC 2013
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: Adding functional tests for networking
......................................................................
Patch Set 19: (5 inline comments)
Dan, thanks for the useful feedback I need to understand why that test is failing on your el6.
....................................................
File tests/functional/Makefile.am
Line 21: vdsmfunctestsdir = ${vdsmtestsdir}/functional
Line 22:
Line 23: dist_vdsmfunctests_PYTHON = \
Line 24: momTests.py \
Line 25: networkTests.py \
I missed it :(
Line 26: sosPluginTests.py \
Line 27: xmlrpcTests.py \
Line 28: $(NULL)
....................................................
File tests/functional/networkTests.py
Line 36: vdsm.save_config()
Line 37:
Line 38:
Line 39: @expandPermutations
Line 40: class NetworkTestShould(TestCaseBase):
Ok, it reads this way a network test should:
* add / delete network
* fail with invalid bonding name
It's a matter of style but I can change the name, I don't mind much.
Yes it's uncommon.
Line 41:
Line 42: def setUp(self):
Line 43: self.vdsm_net = VdsProxy()
Line 44:
Line 67: status, msg = self.vdsm_net.addNetwork(NETWORK_NAME,
Line 68: bond=bond_name,
Line 69: nics=['whatever'],
Line 70: opts={'bridged': bridged})
Line 71: self.assertEqual(status, neterrors.ERR_BAD_BONDING, msg)
Ok good idea, I do not know why it fails, it works on my el6™
Line 72:
Line 73: def testFailWithInvalidBridgeName(self):
Line 74: invalid_bridge_names = ('a' * 16, 'a b', 'a\tb', 'a.b', 'a:b')
Line 75: for bridge_name in invalid_bridge_names:
....................................................
File tests/functional/utils.py
Line 47: Creates a dummy interface, in a fixed number of attempts (100).
Line 48: The dummy interface created has a pseudo-random name (e.g. dummy_85
Line 49: in the format dummy_Number). Assumes root privileges.
Line 50: """
Line 51:
I don't get what it's hard to digest. The pseudo-randomness is used to get a possible unique name when for example N dummy if are created. Btw I find random.sample an improvement over the use of randrange :-) . Dummies are created and displaced per unit test. Thanks.
Line 52: rc = -1
Line 53: attempts = 0
Line 54: dummy_name = None
Line 55:
....................................................
File tests/testValidation.py
Line 107: ValidateRunningAsRoot decoration.
Line 108: """
Line 109: @wraps(f)
Line 110: def wrapper(*args, **kwargs):
Line 111: cmd_modprobe = [modprobe.cmd, "dummy"]
OK, np
Line 112: if not os.path.exists('/sys/module/dummy'):
Line 113: rc, out, err = utils.execCmd(cmd_modprobe, sudo=True)
Line 114: return f(*args, **kwargs)
Line 115: return wrapper
--
To view, visit http://gerrit.ovirt.org/14840
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3be71db9dc0b92c443b87e22fe06f920055c4d3
Gerrit-PatchSet: 19
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list