Add a test for hspace to respect instance policy
authorKlaus Aehlig <aehlig@google.com>
Thu, 13 Jun 2013 14:05:46 +0000 (16:05 +0200)
committerKlaus Aehlig <aehlig@google.com>
Fri, 14 Jun 2013 08:15:58 +0000 (10:15 +0200)
In this example, the instance policy for disks prevents allocation
of more than one instance per node. The test verifies that tiered
allocation still respects this and doesn't attempt to place policy
violating instances on the cluster.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

Makefile.am
test/data/htools/hspace-tiered-ipolicy.data [new file with mode: 0644]
test/hs/shelltests/htools-hspace.test

index 7c43ad5..ccf23a2 100644 (file)
@@ -972,6 +972,7 @@ TEST_FILES = \
        test/data/htools/hail-reloc-drbd.json \
        test/data/htools/hbal-excl-tags.data \
        test/data/htools/hbal-split-insts.data \
+       test/data/htools/hspace-tiered-ipolicy.data \
        test/data/htools/invalid-node.data \
        test/data/htools/missing-resources.data \
        test/data/htools/n1-failure.data \
diff --git a/test/data/htools/hspace-tiered-ipolicy.data b/test/data/htools/hspace-tiered-ipolicy.data
new file mode 100644 (file)
index 0000000..9cb4829
--- /dev/null
@@ -0,0 +1,11 @@
+group-01|fake-uuid-01|preferred|
+
+node-01-001|2000|200|1800|4300|4300|8|N|fake-uuid-01
+node-01-002|2000|4|1996|3900|3900|8|N|fake-uuid-01
+node-01-003|2000|4|1996|3900|3900|8|N|fake-uuid-01
+node-01-004|2000|4|1996|3900|3900|8|N|fake-uuid-01
+
+
+
+|936,4,1064,1,1,1|900,4,2200,1,1,1|1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
+group-01|900,4,2200,1,1,1|900,4,2200,1,1,1|1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
index 553c98d..73252e3 100644 (file)
@@ -6,3 +6,19 @@
 # test again via a file and shell parsing
 ./test/hs/hspace --simu p,4,8T,64g,16 --machine-readable --disk-template drbd -l 8 > $T/capacity && sh -c ". $T/capacity && test x\$HTS_OK = x1"
 >>>= 0
+
+# Verify that instance policy for disks is adhered to
+./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered-ipolicy.data
+>>>/HTS_TRL_INST_CNT=4/
+>>>=0
+
+# ...and instance positioning in human-readable form
+./test/hs/hspace -pname,pcnt -t $TESTDATA_DIR/hspace-tiered-ipolicy.data
+>>>2/Tiered allocation status:
+ Name        pcnt
+ node-01-001    1
+ node-01-002    1
+ node-01-003    1
+ node-01-004    1/
+>>>=0
+