There are four tests: * the simple one (one instance failover) * more complex (two instances failover) * multiple desired locations (all can be satisfied) * multiple desired locations (some of them can't be satisfied)
Signed-off-by: Oleg Ponomarev <[email protected]> --- test/data/htools/hbal-desiredlocation-1.data | 9 +++++++++ test/data/htools/hbal-desiredlocation-2.data | 10 ++++++++++ test/data/htools/hbal-desiredlocation-3.data | 12 ++++++++++++ test/data/htools/hbal-desiredlocation-4.data | 11 +++++++++++ test/hs/shelltests/htools-hbal.test | 28 ++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 test/data/htools/hbal-desiredlocation-1.data create mode 100644 test/data/htools/hbal-desiredlocation-2.data create mode 100644 test/data/htools/hbal-desiredlocation-3.data create mode 100644 test/data/htools/hbal-desiredlocation-4.data diff --git a/test/data/htools/hbal-desiredlocation-1.data b/test/data/htools/hbal-desiredlocation-1.data new file mode 100644 index 0000000..9a20670 --- /dev/null +++ b/test/data/htools/hbal-desiredlocation-1.data @@ -0,0 +1,9 @@ +group-01|fake-uuid-01|preferred|| + +node-01|16384|0|15360|409600|306600|16|N|fake-uuid-01|1|power:a +node-02|16384|0|16384|409600|306600|16|N|fake-uuid-01|1|power:b + +inst1|1024|51200|1|running|Y|node-01|node-02|drbd|power:b|1 + +htools:desiredlocation:power +htools:nlocation:power diff --git a/test/data/htools/hbal-desiredlocation-2.data b/test/data/htools/hbal-desiredlocation-2.data new file mode 100644 index 0000000..f1e063f --- /dev/null +++ b/test/data/htools/hbal-desiredlocation-2.data @@ -0,0 +1,10 @@ +group-01|fake-uuid-01|preferred|| + +node-01|16384|0|15360|409600|255400|16|N|fake-uuid-01|1|power:a +node-02|16384|0|15360|409600|255400|16|N|fake-uuid-01|1|power:b + +inst1|1024|51200|1|running|Y|node-01|node-02|drbd|power:b|1 +inst2|1024|51200|1|running|Y|node-02|node-01|drbd|power:a|1 + +htools:desiredlocation:power +htools:nlocation:power diff --git a/test/data/htools/hbal-desiredlocation-3.data b/test/data/htools/hbal-desiredlocation-3.data new file mode 100644 index 0000000..e85558c --- /dev/null +++ b/test/data/htools/hbal-desiredlocation-3.data @@ -0,0 +1,12 @@ +group-01|fake-uuid-01|preferred|| + +node-01|16384|0|15360|409600|306600|16|N|fake-uuid-01|1|power:a,computer:s +node-02|16384|0|16384|409600|306600|16|N|fake-uuid-01|1|power:b,power:s +node-03|16384|0|16384|409600|409600|16|N|fake-uuid-01|1|power:b,computer:s + +inst1|1024|51200|1|running|Y|node-01|node-02|drbd|power:b,computer:s|1 + +htools:nlocation:power +htools:nlocation:computer +htools:desiredlocation:power +htools:desiredlocation:computer diff --git a/test/data/htools/hbal-desiredlocation-4.data b/test/data/htools/hbal-desiredlocation-4.data new file mode 100644 index 0000000..97b247d --- /dev/null +++ b/test/data/htools/hbal-desiredlocation-4.data @@ -0,0 +1,11 @@ +group-01|fake-uuid-01|preferred|| + +node-01|16384|0|15360|409600|306600|16|N|fake-uuid-01|1|power:a,computer:l +node-02|16384|0|16384|409600|306600|16|N|fake-uuid-01|1|power:b,computer:s + +inst1|1024|5120|1|running|Y|node-01|node-02|drbd|power:b,computer:s,computer:l|1 + +htools:nlocation:power +htools:nlocation:computer +htools:desiredlocation:power +htools:desiredlocation:computer diff --git a/test/hs/shelltests/htools-hbal.test b/test/hs/shelltests/htools-hbal.test index e3baf37..6691769 100644 --- a/test/hs/shelltests/htools-hbal.test +++ b/test/hs/shelltests/htools-hbal.test @@ -25,6 +25,34 @@ node-04 0/ >>>= 0 +./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-desiredlocation-1.data +>>>2/Final cluster status: + Name pcnt + node-01 0 + node-02 1/ +>>>= 0 + +./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-desiredlocation-2.data +>>>2/Final cluster status: + Name pcnt + node-01 1 + node-02 1/ +>>>= 0 + +./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-desiredlocation-3.data +>>>2/Final cluster status: + Name pcnt + node-01 0 + node-02 0 + node-03 1/ +>>>= 0 + +./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-desiredlocation-4.data +>>>2/Final cluster status: + Name pcnt + node-01 0 + node-02 1/ +>>>= 0 ./test/hs/hbal -t $TESTDATA_DIR/hbal-location-1.data >>>/Solution length=[1-9]/ -- 1.9.1
