Skip to content

Commit

Permalink
tests: Add a functional test 107 for "dog node recovery set-throttle"
Browse files Browse the repository at this point in the history
This test verifies b72421f.

Signed-off-by: Takashi Menjo <menjo.takashi@lab.ntt.co.jp>
  • Loading branch information
tmenjo committed Jul 29, 2016
1 parent 5224544 commit 3cac26b
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
57 changes: 57 additions & 0 deletions tests/functional/107
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions tests/functional/107.out
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tests/functional/group
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@
104 auto quick store vdi
105 auto quick vdi
106 auto quick vdi
107 auto quick dog

0 comments on commit 3cac26b

Please sign in to comment.