Add a test to accept existing offline violations
authorKlaus Aehlig <aehlig@google.com>
Tue, 1 Sep 2015 17:37:30 +0000 (19:37 +0200)
committerKlaus Aehlig <aehlig@google.com>
Thu, 3 Sep 2015 09:19:03 +0000 (11:19 +0200)
In this example, there is one offline node that cannot be
evacuated as the instance is too big to fit anywhere. Therefore,
the cluster is not shared N+1 redundant; however, ignoring
the offline node, new instances can be added.

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

Makefile.am
test/data/htools/hspace-existing.data [copied from test/data/htools/empty-cluster.data with 50% similarity]
test/hs/shelltests/htools-hspace.test

index 12cda9f..67bc9e6 100644 (file)
@@ -1730,6 +1730,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-existing.data \
        test/data/htools/hspace-groups-one.data \
        test/data/htools/hspace-groups-two.data \
        test/data/htools/hspace-tiered-dualspec-exclusive.data \
similarity index 50%
copy from test/data/htools/empty-cluster.data
copy to test/data/htools/hspace-existing.data
index c58b412..d212e28 100644 (file)
@@ -1,7 +1,13 @@
 group-01|fake-uuid-01|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
 
-
+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
 
 |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
+
index 1ff0680..98fa233 100644 (file)
 >>>/2 instances allocated/
 >>>=0
 
+./test/hs/hspace -t $TESTDATA_DIR/hspace-existing.data
+>>>/ 0 instances allocated/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-existing.data --accept-existing
+>>>/ [1-9][0-9]* instances allocated/
+>>>=0
+