Commit 8abeb641 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Add shelltests for hspace allocation



Both tiered and standard allocations are tested, with a single and a double
min/max instance specification.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 53822ec4
...@@ -1003,6 +1003,8 @@ TEST_FILES = \ ...@@ -1003,6 +1003,8 @@ TEST_FILES = \
test/data/htools/hail-reloc-drbd.json \ test/data/htools/hail-reloc-drbd.json \
test/data/htools/hbal-excl-tags.data \ test/data/htools/hbal-excl-tags.data \
test/data/htools/hbal-split-insts.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/invalid-node.data \
test/data/htools/missing-resources.data \ test/data/htools/missing-resources.data \
test/data/htools/multiple-master.data \ test/data/htools/multiple-master.data \
......
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
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
...@@ -6,3 +6,12 @@ ...@@ -6,3 +6,12 @@
# test again via a file and shell parsing # 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" ./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 >>>= 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment