From 3cac26b458c57968e9beeef4d83708734ec42866 Mon Sep 17 00:00:00 2001 From: Takashi Menjo Date: Thu, 28 Jul 2016 15:44:57 +0900 Subject: [PATCH] tests: Add a functional test 107 for "dog node recovery set-throttle" This test verifies b72421fe088e6190cf84c4d32eb5d1dfe8e2f03f. Signed-off-by: Takashi Menjo --- tests/functional/107 | 57 ++++++++++++++++++++++++++++++++++++++++ tests/functional/107.out | 39 +++++++++++++++++++++++++++ tests/functional/group | 1 + 3 files changed, 97 insertions(+) create mode 100755 tests/functional/107 create mode 100644 tests/functional/107.out diff --git a/tests/functional/107 b/tests/functional/107 new file mode 100755 index 000000000..c4d1cf9a4 --- /dev/null +++ b/tests/functional/107 @@ -0,0 +1,57 @@ +#!/bin/bash + +# Test dog node recovery set-throttle + +. ./common + +function oneTimeSetUp { + _start_sheep 0 + _wait_for_sheep 1 + _cluster_format -c 1 +} + +function setUp { + dog node recovery set-throttle -- 0 0 +} + +function testSetThrottleSuccess { + setUp + dog node recovery set-throttle -- "$@" + [ $? -eq 0 ] || exit 1 + dog node recovery get-throttle +} + +function testSetThrottleFailure { + setUp + ! dog node recovery set-throttle -- "$@" + [ $? -eq 0 ] || exit 1 + dog node recovery get-throttle +} + +oneTimeSetUp + +testSetThrottleFailure 0 1 +testSetThrottleFailure 0 -1 +testSetThrottleFailure 0 -2 + +testSetThrottleFailure 1 0 +testSetThrottleFailure 1 -1 +testSetThrottleFailure 1 -2 + +testSetThrottleFailure -1 0 +testSetThrottleFailure -1 1 +testSetThrottleFailure -1 -1 +testSetThrottleFailure -1 -2 + +testSetThrottleFailure -2 0 +testSetThrottleFailure -2 1 +testSetThrottleFailure -2 -1 +testSetThrottleFailure -2 -2 + +testSetThrottleFailure 4294967295 9223372036854775808 +testSetThrottleFailure 4294967296 9223372036854775807 +testSetThrottleFailure 4294967296 9223372036854775808 + +testSetThrottleSuccess 0 0 +testSetThrottleSuccess 1 1 +testSetThrottleSuccess 4294967295 9223372036854775807 diff --git a/tests/functional/107.out b/tests/functional/107.out new file mode 100644 index 000000000..ab2dcb2c2 --- /dev/null +++ b/tests/functional/107.out @@ -0,0 +1,39 @@ +QA output created by 107 +using backend plain store +Invalid interval max (0), interval (1) +max (0), interval (0) +Invalid interval (-1) +max (0), interval (0) +Invalid interval (-2) +max (0), interval (0) +Invalid interval max (1), interval (0) +max (0), interval (0) +Invalid interval (-1) +max (0), interval (0) +Invalid interval (-2) +max (0), interval (0) +Invalid max (-1) +max (0), interval (0) +Invalid max (-1) +max (0), interval (0) +Invalid max (-1) +max (0), interval (0) +Invalid max (-1) +max (0), interval (0) +Invalid max (-2) +max (0), interval (0) +Invalid max (-2) +max (0), interval (0) +Invalid max (-2) +max (0), interval (0) +Invalid max (-2) +max (0), interval (0) +Invalid interval (9223372036854775808) +max (0), interval (0) +Invalid max (4294967296) +max (0), interval (0) +Invalid max (4294967296) +max (0), interval (0) +max (0), interval (0) +max (1), interval (1) +max (4294967295), interval (9223372036854775807) diff --git a/tests/functional/group b/tests/functional/group index a4030a699..2dfa417e8 100644 --- a/tests/functional/group +++ b/tests/functional/group @@ -114,3 +114,4 @@ 104 auto quick store vdi 105 auto quick vdi 106 auto quick vdi +107 auto quick dog