mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 15:13:53 +01:00
Added ParallelExec function test
This commit is contained in:
parent
e6be72f5a8
commit
fbdd12dc72
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## obackup test suite 2016083003
|
## obackup basic tests suite 2016083004
|
||||||
# Stupid and very basic tests v0.0000003-alpha-dev-pre-everything
|
|
||||||
|
|
||||||
OBACKUP_DIR="$(pwd)"
|
OBACKUP_DIR="$(pwd)"
|
||||||
OBACKUP_DIR=${OBACKUP_DIR%%/dev*}
|
OBACKUP_DIR=${OBACKUP_DIR%%/dev*}
|
||||||
@ -299,4 +298,22 @@ function test_WaitForTaskCompletion () {
|
|||||||
assertEquals "WaitForTaskCompletion test 5" "2" $?
|
assertEquals "WaitForTaskCompletion test 5" "2" $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_ParallelExec () {
|
||||||
|
# Test if parallelExec works correctly
|
||||||
|
|
||||||
|
cmd="sleep 10;sleep 10;sleep 10;sleep 10"
|
||||||
|
ParallelExec 4 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 1" "0" $?
|
||||||
|
|
||||||
|
cmd="sleep 10;du /none;sleep 5"
|
||||||
|
ParallelExec 2 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 2" "1" $?
|
||||||
|
|
||||||
|
cmd="sleep 19;du /none;sleep 10;du /none;sleep 4"
|
||||||
|
ParallelExec 3 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 3" "2" $?
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "$CURRENT_LOG"
|
||||||
|
|
||||||
. "$TESTS_DIR/shunit2/shunit2"
|
. "$TESTS_DIR/shunit2/shunit2"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## obackup test suite 2016083003
|
## obackup basic tests suite 2016083004
|
||||||
# Stupid and very basic tests v0.0000003-alpha-dev-pre-everything
|
|
||||||
|
|
||||||
OBACKUP_DIR="$(pwd)"
|
OBACKUP_DIR="$(pwd)"
|
||||||
OBACKUP_DIR=${OBACKUP_DIR%%/dev*}
|
OBACKUP_DIR=${OBACKUP_DIR%%/dev*}
|
||||||
@ -205,4 +204,22 @@ function test_WaitForTaskCompletion () {
|
|||||||
assertEquals "WaitForTaskCompletion test 5" "2" $?
|
assertEquals "WaitForTaskCompletion test 5" "2" $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_ParallelExec () {
|
||||||
|
# Test if parallelExec works correctly
|
||||||
|
|
||||||
|
cmd="sleep 10;sleep 10;sleep 10;sleep 10"
|
||||||
|
ParallelExec 4 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 1" "0" $?
|
||||||
|
|
||||||
|
cmd="sleep 10;du /none;sleep 5"
|
||||||
|
ParallelExec 2 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 2" "1" $?
|
||||||
|
|
||||||
|
cmd="sleep 19;du /none;sleep 10;du /none;sleep 4"
|
||||||
|
ParallelExec 3 "$cmd"
|
||||||
|
assertEquals "ParallelExec test 3" "2" $?
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "$CURRENT_LOG"
|
||||||
|
|
||||||
. "$TESTS_DIR/shunit2/shunit2"
|
. "$TESTS_DIR/shunit2/shunit2"
|
||||||
|
Loading…
Reference in New Issue
Block a user