On Wed, Mar 14, 2012 at 02:26:32PM +0100, René Nussbaumer wrote: > On Mon, Mar 12, 2012 at 10:29, Iustin Pop <[email protected]> wrote: > > Using some hand-crafted files (manually modified from a real cluster > > running master branch), we test that hail behaves as we expect: > > doesn't load obvious wrong data, can do relocations/allocations, etc. > > --- > > Makefile.am | 5 + > > htools/cli-tests-defs.sh | 2 + > > htools/offline-test.sh | 46 +++- > > test/data/htools/hail-alloc-drbd.json | 498 +++++++++++++++++++++++++++ > > test/data/htools/hail-change-group.json | 541 > > ++++++++++++++++++++++++++++++ > > test/data/htools/hail-invalid-reloc.json | 15 + > > test/data/htools/hail-node-evac.json | 480 ++++++++++++++++++++++++++ > > test/data/htools/hail-reloc-drbd.json | 482 ++++++++++++++++++++++++++ > > 8 files changed, 2068 insertions(+), 1 deletions(-) > > create mode 100644 test/data/htools/hail-alloc-drbd.json > > create mode 100644 test/data/htools/hail-change-group.json > > create mode 100644 test/data/htools/hail-invalid-reloc.json > > create mode 100644 test/data/htools/hail-node-evac.json > > create mode 100644 test/data/htools/hail-reloc-drbd.json > > > > diff --git a/Makefile.am b/Makefile.am > > index f134044..acb6f2a 100644 > > --- a/Makefile.am > > +++ b/Makefile.am > > @@ -85,6 +85,7 @@ DIRS = \ > > qa \ > > test \ > > test/data \ > > + test/data/htools \ > > test/data/ovfdata \ > > test/data/ovfdata/other \ > > tools > > @@ -699,6 +700,10 @@ TEST_FILES = \ > > test/data/kvm_0.12.5_help.txt \ > > test/data/kvm_0.9.1_help.txt \ > > test/data/sys_drbd_usermode_helper.txt \ > > + test/data/htools/hail-alloc-drbd.json \ > > + test/data/htools/hail-change-group.json \ > > + test/data/htools/hail-node-evac.json \ > > + test/data/htools/hail-reloc-drbd.json \ > > test/data/ovfdata/compr_disk.vmdk.gz \ > > test/data/ovfdata/config.ini \ > > test/data/ovfdata/corrupted_resources.ovf \ > > diff --git a/htools/cli-tests-defs.sh b/htools/cli-tests-defs.sh > > index 89821f8..00a064e 100644 > > --- a/htools/cli-tests-defs.sh > > +++ b/htools/cli-tests-defs.sh > > @@ -21,6 +21,8 @@ > > > > HBINARY=${HBINARY:-./htools/htools-hpc} > > > > +TESTDATA_DIR=${TOP_SRCDIR:-.}/test/data/htools > > + > > hbal() { > > HTOOLS=hbal $HBINARY "$@" > > } > > diff --git a/htools/offline-test.sh b/htools/offline-test.sh > > index 1004beb..fda3274 100755 > > --- a/htools/offline-test.sh > > +++ b/htools/offline-test.sh > > @@ -101,7 +101,7 @@ echo Checking rebalancing > > # policy, then we change all nodes from this group to the allocable > > # one, and we check for rebalancing > > FROOT="$T/simu-rebal-orig" > > -hspace --simu p,4,8T,64g,16 --simu u,4,8T,64g,16 \ > > +hspace --simu u,4,8T,64g,16 --simu p,4,8T,64g,16 \ > > What's exactly the reason to swap the two arguments?
Hah, good catch! hspace reorders the groups, and we want the first group (after reordering) to be the allocable one. So we have to make it (on the cmdline) second. Yes, non-obvious. I guess we should just fix hspace to handle the groups in the order they are passed… (hint :) iustin
