locking: Change locking order, move NAL after instances
[ganeti-local] / test / ganeti.client.gnt_instance_unittest.py
index 7cbd0de..4e65e99 100755 (executable)
@@ -149,6 +149,12 @@ class TestConvertNicDiskModifications(unittest.TestCase):
         ]), [
         (action, -1, {}),
         ])
+      self.assertRaises(errors.OpPrereqError, fn, [
+        (0, {
+          action: True,
+          constants.DDM_MODIFY: True,
+          }),
+        ])
 
     self.assertEqual(fn([
       (constants.DDM_ADD, {
@@ -190,6 +196,17 @@ class TestConvertNicDiskModifications(unittest.TestCase):
       (constants.DDM_REMOVE, -1, {}),
       ])
 
+    self.assertEqual(fn([
+      (-1, {
+        constants.DDM_MODIFY: True,
+        constants.IDISK_SIZE: 1024,
+        }),
+      ]), [
+      (constants.DDM_MODIFY, -1, {
+        constants.IDISK_SIZE: 1024,
+        }),
+      ])
+
 
 class TestParseDiskSizes(unittest.TestCase):
   def test(self):