mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
initscripts fkt: Check that readhash returns 1 on a missing file
It already does that, so the function is not changed Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
80c1cb5a0a
commit
0d61c6807c
@@ -10,6 +10,7 @@ ROOT="$(readlink -f "${SCRIPT_PATH}/../../../../..")"
|
||||
|
||||
# read the date in
|
||||
readhash "CONFIG" "${SCRIPT_PATH}/data/1"
|
||||
test_command [ $? == 0 ]
|
||||
|
||||
# test if we read the correct data
|
||||
test_value_in_array "CONFIG" "RED_DHCP_HOSTNAME" "ipfire"
|
||||
@@ -27,6 +28,8 @@ test_that_output_is "${SCRIPT_PATH}/data/1_output_stderr" "2" readhash "CONFIG"
|
||||
|
||||
# Check with invalid Lines (values and keys)
|
||||
readhash "CONFIG2" "${SCRIPT_PATH}/data/2" &> /dev/null
|
||||
test_command [ $? == 0 ]
|
||||
|
||||
|
||||
# test if we read the correct data
|
||||
test_value_in_array "CONFIG2" "RED_DHCP_HOSTNAME" "ipfire"
|
||||
@@ -39,4 +42,6 @@ test_value_in_array "CONFIG2" "BLUE_MACADDR" "bc:30:7d:58:6b:e3"
|
||||
test_that_output_is "${SCRIPT_PATH}/data/2_output_stdout" "1" readhash "CONFIG2" "${SCRIPT_PATH}/data/2"
|
||||
test_that_output_is "${SCRIPT_PATH}/data/2_output_stderr" "2" readhash "CONFIG2" "${SCRIPT_PATH}/data/2"
|
||||
|
||||
|
||||
# Check non existent file
|
||||
readhash "CONFIG3" "${SCRIPT_PATH}/data/-1" &> /dev/null
|
||||
test_command [ $? == 1 ]
|
||||
|
||||
Reference in New Issue
Block a user