Add a test for group independence in capacity checks
authorKlaus Aehlig <aehlig@google.com>
Wed, 23 Sep 2015 11:23:34 +0000 (13:23 +0200)
committerKlaus Aehlig <aehlig@google.com>
Fri, 25 Sep 2015 08:04:55 +0000 (10:04 +0200)
In this example, there are two node groups. The second is
not redundant, as it contains only one non-drained node and
an instance (so, should that node fail as well, the instance
cannot stay in the group). However, there are no current
violations; every instance is running on a healthy node.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Makefile.am
test/data/htools/hspace-bad-group.data [copied from test/data/htools/hspace-existing.data with 59% similarity]
test/hs/shelltests/htools-hspace.test

index a07b4b5..a6b9fbd 100644 (file)
@@ -1731,6 +1731,7 @@ TEST_FILES = \
        test/data/htools/hbal-soft-errors.data \
        test/data/htools/hbal-soft-errors2.data \
        test/data/htools/hbal-split-insts.data \
+       test/data/htools/hspace-bad-group.data \
        test/data/htools/hspace-existing.data \
        test/data/htools/hspace-groups-one.data \
        test/data/htools/hspace-groups-two.data \
similarity index 59%
copy from test/data/htools/hspace-existing.data
copy to test/data/htools/hspace-bad-group.data
index d212e28..b1c7b06 100644 (file)
@@ -1,13 +1,15 @@
 group-01|fake-uuid-01|preferred||
+group-bad|fake-uuid-bad|preferred||
 
 node-01|81920|0|71920|200|200|16|M|fake-uuid-01
 node-02|81920|0|71920|200|200|16|N|fake-uuid-01
-node-bad|81920|0|1920|200|200|16|Y|fake-uuid-01
+node-remain|81920|0|7920|200|200|16|N|fake-uuid-bad
+node-drained|81920|0|8920|200|200|16|N|fake-uuid-bad
 
 inst-11|10000|0|1|running|Y|node-01||ext||1
 inst-12|10000|0|1|running|Y|node-02||ext||1
-inst-bad|80000|0|1|running|Y|node-bad||ext||1
+inst-2|10000|0|1|running|Y|node-remain||ext||1
 
 |128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
 group-01|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
-
+group-bad|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
index 98fa233..80ad64f 100644 (file)
 >>>/ [1-9][0-9]* instances allocated/
 >>>=0
 
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data
+>>>/ 0 instances allocated/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data -v -v -v
+>>>2/Bad groups: \["group-bad"\]/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data --accept-existing
+>>>/ 0 instances allocated/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data --independent-groups
+>>>/ [1-9][0-9]* instances allocated/
+>>>=0
+