On Thu, Oct 31, 2013 at 2:58 PM, Klaus Aehlig <[email protected]> wrote:
> In this example, there are 7 nodes, each with capacity for > 4 instances. Two nodes are online and host 4 instances each, > thus forming a cluster with no free resources. Four additional > nodes a standby, and two additional node is offline for other > reasons. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > Makefile.am | 1 + > test/data/htools/hsqueeze-overutilized.data | 24 ++++++++++++++++++++++++ > test/hs/shelltests/htools-hsqueeze.test | 24 ++++++++++++++++++++++++ > 3 files changed, 49 insertions(+) > create mode 100644 test/data/htools/hsqueeze-overutilized.data > > diff --git a/Makefile.am b/Makefile.am > index 44a9684..b432870 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -1270,6 +1270,7 @@ TEST_FILES = \ > test/data/htools/hroller-nodegroups.data \ > test/data/htools/hroller-nonredundant.data \ > test/data/htools/hroller-online.data \ > + test/data/htools/hsqueeze-overutilized.data \ > test/data/htools/hsqueeze-underutilized.data \ > test/data/htools/unique-reboot-order.data \ > test/hs/shelltests/htools-balancing.test \ > diff --git a/test/data/htools/hsqueeze-overutilized.data > b/test/data/htools/hsqueeze-overutilized.data > new file mode 100644 > index 0000000..f17eadf > --- /dev/null > +++ b/test/data/htools/hsqueeze-overutilized.data > @@ -0,0 +1,24 @@ > +group-01|fake-uuid-01|preferred|| > + > +node-01-000|512|0|4|1052|1052|9|M|fake-uuid-01|1||N|0|1 > +node-01-001|512|0|4|1052|1052|9|N|fake-uuid-01|1||N|0|1 > > +node-01-002|512|0|512|1052|1052|9|Y|fake-uuid-01|1|htools:standby:manual|N|0|1 > +node-01-003|512|0|512|1052|1052|9|Y|fake-uuid-01|1||N|0|1 > > +node-01-004|512|0|512|1052|1052|9|Y|fake-uuid-01|1|htools:standby:manual|N|0|1 > > +node-01-005|512|0|512|1052|1052|9|Y|fake-uuid-01|1|htools:standby:manual|N|0|1 > > +node-01-006|512|0|512|1052|1052|9|Y|fake-uuid-01|1|htools:standby:manual|N|0|1 > +node-01-007|512|0|512|1052|1052|9|Y|fake-uuid-01|1|pink:bunny|N|0|1 > +1 for the pink bunny! :D > + > +inst-00|127|0|1|running|Y|node-01-000||ext||1|- > +inst-01|127|0|1|running|Y|node-01-000||ext||1|- > +inst-02|127|0|1|running|Y|node-01-000||ext||1|- > +inst-03|127|0|1|running|Y|node-01-000||ext||1|- > +inst-10|127|0|1|running|Y|node-01-001||ext||1|- > +inst-11|127|0|1|running|Y|node-01-001||ext||1|- > +inst-12|127|0|1|running|Y|node-01-001||ext||1|- > +inst-13|127|0|1|running|Y|node-01-001||ext||1|- > + > +|127,1,0,0,1,1|127,1,0,1,1,1;256,1,0,0,2,2|ext|1.0|32.0 > + > > +|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 > diff --git a/test/hs/shelltests/htools-hsqueeze.test > b/test/hs/shelltests/htools-hsqueeze.test > index af18509..0ab2557 100644 > --- a/test/hs/shelltests/htools-hsqueeze.test > +++ b/test/hs/shelltests/htools-hsqueeze.test > @@ -19,3 +19,27 @@ node-01-00[2345] > node-01-00[2345] > node-01-00[2345]$/ > >>>= 0 > + > +./test/hs/hsqueeze -v -t $TESTDATA_DIR/hsqueeze-overutilized.data > +>>>/Online candidates: > node-01-00[2456],node-01-00[2456],node-01-00[2456],node-01-00[2456]/ > +>>>= 0 > + > +./test/hs/hsqueeze --no-headers -t > $TESTDATA_DIR/hsqueeze-overutilized.data > +>>>/^node-01-00[2456] > +node-01-00[2456]$/ > +>>>= 0 > + > +./test/hs/hsqueeze -t $TESTDATA_DIR/hsqueeze-overutilized.data > --minimal-resources=0 > +>>>/No action/ > +>>>= 0 > + > +./test/hs/hsqueeze --no-headers -t > $TESTDATA_DIR/hsqueeze-overutilized.data --minimal-resources=4.0 > --target-resources=5.0 > +>>>/^node-01-00[2456] > +node-01-00[2456] > +node-01-00[2456] > +node-01-00[2456]$/ > +>>>= 0 > + > +./test/hs/hsqueeze -v -t $TESTDATA_DIR/hsqueeze-overutilized.data > --minimal-resources=4.0 --target-resources=5.0 > +>>>/will not yield enough capacity/ > +>>>= 0 > -- > 1.8.4.1 > > LGTM, thanks -- -- Helga Velroyen | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
