On Wed, Apr 24, 2013 at 2:00 PM, Bernardo Dal Seno <bdals...@google.com>wrote:

> Both tiered and standard allocations are tested, with a single and a double
> min/max instance specification.
>
> Signed-off-by: Bernardo Dal Seno <bdals...@google.com>
> ---
>  Makefile.am                                  |  2 ++
>  test/data/htools/hspace-tiered-dualspec.data | 11 +++++++++++
>  test/data/htools/hspace-tiered.data          | 11 +++++++++++
>  test/hs/shelltests/htools-hspace.test        |  9 +++++++++
>  4 files changed, 33 insertions(+)
>  create mode 100644 test/data/htools/hspace-tiered-dualspec.data
>  create mode 100644 test/data/htools/hspace-tiered.data
>
> diff --git a/Makefile.am b/Makefile.am
> index 17161ed..2f4a356 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1002,6 +1002,8 @@ TEST_FILES = \
>         test/data/htools/hail-reloc-drbd.json \
>         test/data/htools/hbal-excl-tags.data \
>         test/data/htools/hbal-split-insts.data \
> +       test/data/htools/hspace-tiered-dualspec.data \
> +       test/data/htools/hspace-tiered.data \
>         test/data/htools/invalid-node.data \
>         test/data/htools/missing-resources.data \
>         test/data/htools/multiple-master.data \
> diff --git a/test/data/htools/hspace-tiered-dualspec.data
> b/test/data/htools/hspace-tiered-dualspec.data
> new file mode 100644
> index 0000000..46e44ce
> --- /dev/null
> +++ b/test/data/htools/hspace-tiered-dualspec.data
> @@ -0,0 +1,11 @@
> +group-01|fake-uuid-01|preferred|
> +
> +node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-003|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-004|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1
> +
> +
> +
>
> +|63488,2,522240,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12;63488,2,522240,1,1,1;65536,2,524288,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
>
> +group-01|63488,2,522240,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12;63488,2,522240,1,1,1;65536,2,524288,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
> diff --git a/test/data/htools/hspace-tiered.data
> b/test/data/htools/hspace-tiered.data
> new file mode 100644
> index 0000000..61ee4c1
> --- /dev/null
> +++ b/test/data/htools/hspace-tiered.data
> @@ -0,0 +1,11 @@
> +group-01|fake-uuid-01|preferred|
> +
> +node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-003|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1
> +node-01-004|262144|1024|261120|2097152|2097152|8|N|fake-uuid-01|1
> +
> +
> +
>
> +|129024,4,1047552,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
>
> +group-01|129024,4,1047552,1,1,1|129024,4,1047552,1,1,1;131072,4,1048576,16,8,12|plain,diskless,file,sharedfile,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 553c98d..43f7ea0 100644
> --- a/test/hs/shelltests/htools-hspace.test
> +++ b/test/hs/shelltests/htools-hspace.test
> @@ -6,3 +6,12 @@
>  # 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
> +
> +# 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
> --
> 1.8.2.1
>
>
LGTM, thanks

Reply via email to