LGTM, thanks.
On Wed, Oct 2, 2013 at 11:02 AM, Raffa Santi <[email protected]> wrote: > Check that the validation procedures don't accept invalid values > and also don't choke on valid values. > > Signed-off-by: Raffa Santi <[email protected]> > --- > test/py/cmdlib/cluster_unittest.py | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/test/py/cmdlib/cluster_unittest.py > b/test/py/cmdlib/cluster_unittest.py > index e8438a3..64a703d 100644 > --- a/test/py/cmdlib/cluster_unittest.py > +++ b/test/py/cmdlib/cluster_unittest.py > @@ -446,6 +446,24 @@ class TestLUClusterSetParams(CmdlibTestCase): > self.ExecOpCode(op) > self.assertEqual(diskparams, self.cluster.diskparams) > > + def testValidDiskparamsAccess(self): > + for value in constants.DISK_VALID_ACCESS_MODES: > + self.ResetMocks() > + op = opcodes.OpClusterSetParams(diskparams={ > + constants.DT_RBD: {constants.LDP_ACCESS: value} > + }) > + self.ExecOpCode(op) > + got = > self.cluster.diskparams[constants.DT_RBD][constants.LDP_ACCESS] > + self.assertEqual(value, got) > + > + def testInvalidDiskparamsAccess(self): > + for value in ["default", "pinky_bunny"]: > + self.ResetMocks() > + op = opcodes.OpClusterSetParams(diskparams={ > + constants.DT_RBD: {constants.LDP_ACCESS: value} > + }) > + self.ExecOpCodeExpectOpPrereqError(op, "Invalid value of > 'rbd:access'") > + > def testUnsetDrbdHelperWithDrbdDisks(self): > self.cfg.AddNewInstance(disks=[ > self.cfg.CreateDisk(dev_type=constants.DT_DRBD8, > create_nodes=True)]) > -- > 1.7.10.4 > > -- Thomas Thrainer | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
