htools-hspace.test 1.37 KB
Newer Older
1
2
3
4
5
6
7
8
# test that hspace machine readable output looks correct
./test/hs/hspace --simu p,4,8T,64g,16 --machine-readable --disk-template drbd -l 8
>>> /^HTS_OK=1/
>>>= 0

# 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
9
10
11
12
13
14
15
16
17

# 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
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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