Assaf Muller has posted comments on this change.
Change subject: vdsm-tool: Change upgrade mechanism
......................................................................
Patch Set 9: Code-Review-1
(4 comments)
Sorry for the partial reviews, I hate when people do that. Just testing comments, rest
looks good.
http://gerrit.ovirt.org/#/c/27193/9/tests/toolTests.py
File tests/toolTests.py:
Line 370: def assertNotSealed(self, name):
Line 371: self.assertFalse(self._checkSealExists(name))
Line 372:
Line 373: def testRunOnce(self):
Line 374: lst = [0]
According to the principle of least surprise, I think you should have the number of
upgrade invocations kept in the UpgraduratorTM.invocations, and not passed in as a list.
Line 375: ret = upgrade.apply_upgrade(self.UpgraduratorTM(lst), 'test')
Line 376: self.assertEquals(ret, 0)
Line 377: self.assertEquals(lst[0], 1)
Line 378: self.assertSealed('test')
Line 380: def testErrorInUpgrade(self):
Line 381: bad = self.BadUpgraduratorTM()
Line 382: ret = upgrade.apply_upgrade(bad, 'foobar')
Line 383: self.assertEquals(ret, 1)
Line 384: self.assertNotSealed('bad')
'bad' will never be sealed because the upgrade name is 'foobar'.
Line 385:
Line 386: def testRunMany(self):
Line 387: lst = [0]
Line 388: for _ in xrange(5):
Line 388: xrange
xrange is not defined in Python 3. Are you guys using a library like six to ease the
transition?
Line 404: upgrade.apply_upgrade(self.UpgraduratorTM(lst), 'test')
Line 405: self.assertEquals(lst[0], 2)
Line 406: self.assertSealed('test')
Line 407:
Line 408: def testNoUpgrade(self):
I think you can safely remove this test...
Line 409: self.assertNotSealed('test')
Line 410:
Line 411: def testUpgradeArgs(self):
Line 412: u = self.UpgraduratorTM([0])
--
To view, visit
http://gerrit.ovirt.org/27193
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6e1d28570dedfeff9fe60624b1db72d8cadf136a
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes