1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/ctdb/tests/UNIT/cunit/config_test_003.sh
Martin Schwenke 43ed3a6eb3 ctdb-tests: Move cunit tests to UNIT/ subdirectory
The UNIT subdirectory directory will contain all unit tests.  Use an
uppercase name to avoid conflicts with source code subdirectories.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-09-26 04:45:36 +00:00

53 lines
942 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
conffile="${CTDB_BASE}/ctdb.conf"
scriptfile="${CTDB_BASE}/debug-hung-script.sh"
remove_files ()
{
rm -f "$conffile"
}
test_cleanup remove_files
cat > "$conffile" <<EOF
EOF
ok <<EOF
EOF
unit_test ctdb-config get "event" "debug script"
cat > "$conffile" <<EOF
[event]
debug script = debug-hung-script.sh
EOF
touch "$scriptfile"
required_result 22 <<EOF
debug script $scriptfile is not executable
conf: validation for option "debug script" failed
Failed to load config file $conffile
EOF
unit_test ctdb-config validate
chmod +x "$scriptfile"
ok_null
unit_test ctdb-config validate
rm -f "$scriptfile"
required_result 22 <<EOF
debug script $scriptfile does not exist
conf: validation for option "debug script" failed
Failed to load config file $conffile
EOF
unit_test ctdb-config validate