Add test for shrink heuristics over different resources
authorKlaus Aehlig <aehlig@google.com>
Fri, 14 Jun 2013 12:19:01 +0000 (14:19 +0200)
committerKlaus Aehlig <aehlig@google.com>
Mon, 17 Jun 2013 14:37:09 +0000 (16:37 +0200)
In this example, memory prevents adding more than one instance on
the first node. Yet, on the other nodes, 2 instances can be placed
each, if disks are shrunk appropriately. This, however, requires
to courageous decision to shrink disks next, even though more nodes
fail to allocate more due to memory than to disk.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

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

index 011f9a2..e6eabfd 100644 (file)
@@ -1038,6 +1038,7 @@ TEST_FILES = \
        test/data/htools/hbal-split-insts.data \
        test/data/htools/hspace-tiered-dualspec.data \
        test/data/htools/hspace-tiered-ipolicy.data \
+       test/data/htools/hspace-tiered-resourcetypes.data \
        test/data/htools/hspace-tiered.data \
        test/data/htools/invalid-node.data \
        test/data/htools/missing-resources.data \
diff --git a/test/data/htools/hspace-tiered-resourcetypes.data b/test/data/htools/hspace-tiered-resourcetypes.data
new file mode 100644 (file)
index 0000000..54c8aa3
--- /dev/null
@@ -0,0 +1,11 @@
+group-01|fake-uuid-01|preferred||
+
+node-01-001|2000|200|1700|5000|5000|8|N|fake-uuid-01
+node-01-002|2000|4|1996|5000|4900|8|N|fake-uuid-01
+node-01-003|2000|4|1996|5000|5000|8|N|fake-uuid-01
+node-01-004|2000|4|1996|5000|5000|8|N|fake-uuid-01
+
+
+
+|900,4,2200,1,1,1|900,4,2000,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,2000,1,1,1;1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
index 3ff4873..b2d8dd0 100644 (file)
  node-01-003    1
  node-01-004    1/
 >>>=0
+
+./test/hs/hspace -pname,pcnt -t $TESTDATA_DIR/hspace-tiered-resourcetypes.data
+>>>2/Tiered allocation status:
+ Name        pcnt
+ node-01-001    1
+ node-01-002    2
+ node-01-003    2
+ node-01-004    2/
+>>>=0
+