Currently, this test assumes localStorageTemplates, so let's make sure
we enforce that on the given instance
---
 htools/Ganeti/HTools/QC.hs |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/htools/Ganeti/HTools/QC.hs b/htools/Ganeti/HTools/QC.hs
index 22a5516..8548e9e 100644
--- a/htools/Ganeti/HTools/QC.hs
+++ b/htools/Ganeti/HTools/QC.hs
@@ -979,13 +979,14 @@ prop_Node_addPriFM node inst =
         inst'' = inst' { Instance.mem = Instance.mem inst }
 
 prop_Node_addPriFD node inst =
+  forAll (elements Instance.localStorageTemplates) $ \dt ->
   Instance.dsk inst >= Node.fDsk node && not (Node.failN1 node) ==>
-    case Node.addPri node inst'' of
-      Types.OpFail Types.FailDisk -> True
-      _ -> False
-    where _types = (node::Node.Node, inst::Instance.Instance)
-          inst' = setInstanceSmallerThanNode node inst
-          inst'' = inst' { Instance.dsk = Instance.dsk inst }
+  let inst' = setInstanceSmallerThanNode node inst
+      inst'' = inst' { Instance.dsk = Instance.dsk inst
+                     , Instance.diskTemplate = dt }
+  in case Node.addPri node inst'' of
+       Types.OpFail Types.FailDisk -> True
+       _ -> False
 
 prop_Node_addPriFC =
   forAll (choose (1, maxCpu)) $ \extra ->
-- 
1.7.9.1

Reply via email to