Skip to content

Commit

Permalink
Merge pull request #294 from tmenjo/test-fix-set-throttle
Browse files Browse the repository at this point in the history
tests: Add a functional test 107 for "dog node recovery set-throttle"
  • Loading branch information
mitake committed Jul 29, 2016
2 parents 5224544 + 3cac26b commit 7b0e17d
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
@@ -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
@@ -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
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 7b0e17d

Please sign in to comment.