LGTM, thanks!

On Wed, Sep 23, 2015 at 02:14:42PM +0200, 'Klaus Aehlig' via ganeti-devel wrote:
In this example, there are two node groups. The second is
not redundant, as it contains only one non-drained node and
an instance (so, should that node fail as well, the instance
cannot stay in the group). However, there are no current
violations; every instance is running on a healthy node.

Signed-off-by: Klaus Aehlig <[email protected]>
---
Makefile.am                            |  1 +
test/data/htools/hspace-bad-group.data | 15 +++++++++++++++
test/hs/shelltests/htools-hspace.test  | 16 ++++++++++++++++
3 files changed, 32 insertions(+)
create mode 100644 test/data/htools/hspace-bad-group.data

diff --git a/Makefile.am b/Makefile.am
index a07b4b5..a6b9fbd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1731,6 +1731,7 @@ TEST_FILES = \
        test/data/htools/hbal-soft-errors.data \
        test/data/htools/hbal-soft-errors2.data \
        test/data/htools/hbal-split-insts.data \
+       test/data/htools/hspace-bad-group.data \
        test/data/htools/hspace-existing.data \
        test/data/htools/hspace-groups-one.data \
        test/data/htools/hspace-groups-two.data \
diff --git a/test/data/htools/hspace-bad-group.data 
b/test/data/htools/hspace-bad-group.data
new file mode 100644
index 0000000..b1c7b06
--- /dev/null
+++ b/test/data/htools/hspace-bad-group.data
@@ -0,0 +1,15 @@
+group-01|fake-uuid-01|preferred||
+group-bad|fake-uuid-bad|preferred||
+
+node-01|81920|0|71920|200|200|16|M|fake-uuid-01
+node-02|81920|0|71920|200|200|16|N|fake-uuid-01
+node-remain|81920|0|7920|200|200|16|N|fake-uuid-bad
+node-drained|81920|0|8920|200|200|16|N|fake-uuid-bad
+
+inst-11|10000|0|1|running|Y|node-01||ext||1
+inst-12|10000|0|1|running|Y|node-02||ext||1
+inst-2|10000|0|1|running|Y|node-remain||ext||1
+
+|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
+group-01|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
+group-bad|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,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 98fa233..80ad64f 100644
--- a/test/hs/shelltests/htools-hspace.test
+++ b/test/hs/shelltests/htools-hspace.test
@@ -90,3 +90,19 @@
>>>/ [1-9][0-9]* instances allocated/
>>>=0

+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data
+>>>/ 0 instances allocated/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data -v -v -v
+>>>2/Bad groups: \["group-bad"\]/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data --accept-existing
+>>>/ 0 instances allocated/
+>>>=0
+
+./test/hs/hspace -t $TESTDATA_DIR/hspace-bad-group.data --independent-groups
+>>>/ [1-9][0-9]* instances allocated/
+>>>=0
+
--
2.6.0.rc0.131.gf624c3d

Reply via email to