diff --git a/Makefile.am b/Makefile.am index f34ada2f9098d2de5c3f482bea502c46fb12a86b..dcc85c821220c464eb0c038387ee499eb0e14219 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1003,6 +1003,8 @@ 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-dualspec.data \ + test/data/htools/hspace-tiered.data \ test/data/htools/invalid-node.data \ test/data/htools/missing-resources.data \ test/data/htools/multiple-master.data \ diff --git a/test/data/htools/hspace-tiered-dualspec.data b/test/data/htools/hspace-tiered-dualspec.data new file mode 100644 index 0000000000000000000000000000000000000000..46e44ce4d8705be1ffed31f7efda4ceaa7d174af --- /dev/null +++ b/test/data/htools/hspace-tiered-dualspec.data @@ -0,0 +1,11 @@ +group-01|fake-uuid-01|preferred| + +node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1 +node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1 +node-01-003|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1 +node-01-004|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1 + + + +|63488,2,522240,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12;63488,2,522240,1,1,1;65536,2,524288,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0 +group-01|63488,2,522240,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12;63488,2,522240,1,1,1;65536,2,524288,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0 diff --git a/test/data/htools/hspace-tiered.data b/test/data/htools/hspace-tiered.data new file mode 100644 index 0000000000000000000000000000000000000000..61ee4c1a4d007d1c379c6bd4463299d3c64cdf24 --- /dev/null +++ b/test/data/htools/hspace-tiered.data @@ -0,0 +1,11 @@ +group-01|fake-uuid-01|preferred| + +node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1 +node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1 +node-01-003|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1 +node-01-004|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1 + + + +|129024,4,1047552,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0 +group-01|129024,4,1047552,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0 diff --git a/test/hs/shelltests/htools-hspace.test b/test/hs/shelltests/htools-hspace.test index 553c98dffacae8516ff360a1284c2473ce1b6242..43f7ea0a106563f39a506377a44e8278550e3ba8 100644 --- a/test/hs/shelltests/htools-hspace.test +++ b/test/hs/shelltests/htools-hspace.test @@ -6,3 +6,12 @@ # 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 + +# standard & tiered allocation, using shell parsing to do multiple checks +./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered.data > $T/capacity && sh -c ". $T/capacity && test \"\${HTS_TSPEC}\" = '131072,1048576,4=4 129984,1048320,4=2' && test \"\${HTS_ALLOC_INSTANCES}\" = 6" +>>>=0 + +# again, but with a policy containing two min/max specs pairs +./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered-dualspec.data > $T/capacity && sh -c ". $T/capacity && test \"\${HTS_TSPEC}\" = '131072,1048576,4=4 129984,1048320,4=2 65472,524288,2=2' && test \"\${HTS_ALLOC_INSTANCES}\" = 14" +>>>2 +>>>=0