From 93ddfce2ec798421fd2a165abd092a925fc19b0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Thu, 19 Jul 2012 10:40:46 +0200
Subject: [PATCH] Add some rudimentary node group ipolicy checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 qa/qa_group.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/qa/qa_group.py b/qa/qa_group.py
index e09c2f8a2..2adc62074 100644
--- a/qa/qa_group.py
+++ b/qa/qa_group.py
@@ -90,11 +90,19 @@ def TestGroupModify():
 
   AssertCommand(["gnt-group", "add", group1])
 
+  std_defaults = constants.IPOLICY_DEFAULTS[constants.ISPECS_STD]
+  min_v = std_defaults[constants.ISPEC_MEM_SIZE] * 10
+  max_v = min_v * 10
+
   try:
     AssertCommand(["gnt-group", "modify", "--alloc-policy", "unallocable",
                    "--node-parameters", "oob_program=/bin/false", group1])
     AssertCommand(["gnt-group", "modify",
                    "--alloc-policy", "notvalid", group1], fail=True)
+    AssertCommand(["gnt-group", "modify", "--specs-mem-size",
+                   "min=%s,max=%s,std=0" % (min_v, max_v), group1], fail=True)
+    AssertCommand(["gnt-group", "modify", "--specs-mem-size",
+                   "min=%s,max=%s" % (min_v, max_v), group1])
   finally:
     AssertCommand(["gnt-group", "remove", group1])
 
-- 
GitLab