9b0ebc44f4
run_tests.sh runs tests starting with test_* The existing test_functions.sh is really testing true/false. Move that to test_truefalse.sh Then move functions.sh to test_functions.sh. This will ensure it is run during unit testing from run-tests.sh Change-Id: I959ac38c946da1fb47458b8c4f09157f74f0e644
35 lines
830 B
Bash
Executable File
35 lines
830 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Tests for DevStack meta-config functions
|
|
|
|
TOP=$(cd $(dirname "$0")/.. && pwd)
|
|
|
|
# Import common functions
|
|
source $TOP/functions
|
|
source $TOP/tests/unittest.sh
|
|
|
|
function test_truefalse {
|
|
local one=1
|
|
local captrue=True
|
|
local lowtrue=true
|
|
local abrevtrue=t
|
|
local zero=0
|
|
local capfalse=False
|
|
local lowfalse=false
|
|
local abrevfalse=f
|
|
for against in True False; do
|
|
for name in one captrue lowtrue abrevtrue; do
|
|
assert_equal "True" $(trueorfalse $against $name) "\$(trueorfalse $against $name)"
|
|
done
|
|
done
|
|
for against in True False; do
|
|
for name in zero capfalse lowfalse abrevfalse; do
|
|
assert_equal "False" $(trueorfalse $against $name) "\$(trueorfalse $against $name)"
|
|
done
|
|
done
|
|
}
|
|
|
|
test_truefalse
|
|
|
|
report_results
|