From 752df8bb5fcc0c8ebb4570dc3f9d9b3c91e0858f Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 7 May 2010 19:40:59 +0200
Subject: [PATCH] RAPI client: Add missing unittest for RepairNodeStorageUnits

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: David Knowles <dknowles@google.com>
---
 test/ganeti.rapi.client_unittest.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/ganeti.rapi.client_unittest.py b/test/ganeti.rapi.client_unittest.py
index 4742c5eb6..9da775c82 100755
--- a/test/ganeti.rapi.client_unittest.py
+++ b/test/ganeti.rapi.client_unittest.py
@@ -423,6 +423,19 @@ class GanetiRapiClientTests(unittest.TestCase):
                       self.client.ModifyNodeStorageUnits,
                       "node-n", "floppy-disk", "hdc")
 
+  def testRepairNodeStorageUnits(self):
+    self.rapi.AddResponse("99")
+    self.assertEqual(99, self.client.RepairNodeStorageUnits("node-z", "lvm-pv",
+                                                            "hda"))
+    self.assertHandler(rlib2.R_2_nodes_name_storage_repair)
+    self.assertItems(["node-z"])
+    self.assertQuery("storage_type", ["lvm-pv"])
+    self.assertQuery("name", ["hda"])
+
+    self.assertRaises(client.InvalidStorageType,
+                      self.client.RepairNodeStorageUnits,
+                      "node-n", "floppy-disk", "hdc")
+
   def testGetNodeTags(self):
     self.rapi.AddResponse("[\"fry\", \"bender\"]")
     self.assertEqual(["fry", "bender"], self.client.GetNodeTags("node-k"))
-- 
GitLab