diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /ctdb/tests/UNIT/eventd/eventd_009.sh | |
parent | Initial commit. (diff) | |
download | samba-upstream.tar.xz samba-upstream.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ctdb/tests/UNIT/eventd/eventd_009.sh')
-rwxr-xr-x | ctdb/tests/UNIT/eventd/eventd_009.sh | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/ctdb/tests/UNIT/eventd/eventd_009.sh b/ctdb/tests/UNIT/eventd/eventd_009.sh new file mode 100755 index 0000000..39e5cd6 --- /dev/null +++ b/ctdb/tests/UNIT/eventd/eventd_009.sh @@ -0,0 +1,155 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "eventscript directory with links" + +setup_eventd + +ok <<EOF + 01.dummy + 02.disabled + + 03.notalink +EOF +simple_test script list data + +# Should be a no-op +ok_null +simple_test script disable data 03.notalink + +ok_null +simple_test run 10 data failure + +ok_null +simple_test script enable data 01.dummy + +required_result 8 <<EOF +Event failure in data failed +EOF +simple_test run 10 data failure + +ok <<EOF +* 01.dummy + 02.disabled + + 03.notalink +EOF +simple_test script list data + +required_result 1 <<EOF +01.dummy ERROR DURATION DATETIME + OUTPUT: +EOF +simple_test status data failure + +ok_null +simple_test run 10 data monitor + +ok <<EOF +01.dummy OK DURATION DATETIME +03.notalink DISABLED +EOF +simple_test status data monitor + +ok_null +simple_test script enable data 03.notalink + +ok <<EOF +* 01.dummy + 02.disabled + +* 03.notalink +EOF +simple_test script list data + +# Local/3rd-party link, not enabled +touch "${CTDB_BASE}/foo" +chmod 644 "${CTDB_BASE}/foo" +abs_base=$(cd "$CTDB_BASE" && echo "$PWD") +ln -s "${abs_base}/foo" "${CTDB_BASE}/events/data/04.locallink.script" + +ok <<EOF +* 01.dummy + 02.disabled + +* 03.notalink + 04.locallink +EOF +simple_test script list data + +ok_null +simple_test script enable data 04.locallink + +required_result 1 "" +unit_test test -x "${CTDB_BASE}/foo" + +ok_null +simple_test script disable data 04.locallink + +ok_null +unit_test test -f "${CTDB_BASE}/foo" + +ok <<EOF +* 01.dummy + 02.disabled + +* 03.notalink +EOF +simple_test script list data + +# Local/3rd-party link, enabled +chmod +x "${CTDB_BASE}/foo" +ln -s "${abs_base}/foo" "${CTDB_BASE}/events/data/04.locallink.script" + +ok <<EOF +* 01.dummy + 02.disabled + +* 03.notalink +* 04.locallink +EOF +simple_test script list data + +ok_null +simple_test script disable data 01.dummy + +ok_null +simple_test script disable data 04.locallink + +ok_null +unit_test test -f "${CTDB_BASE}/foo" + +ok <<EOF + 01.dummy + 02.disabled + +* 03.notalink +EOF +simple_test script list data + +ok_null +simple_test run 10 data failure + +# Local/3rd-party link, dangling +ln -s "${CTDB_BASE}/doesnotexist" "${CTDB_BASE}/events/data/04.locallink.script" + +ok <<EOF + 01.dummy + 02.disabled + +* 03.notalink + 04.locallink +EOF +simple_test script list data + +ok_null +simple_test script disable data 04.locallink + +ok <<EOF + 01.dummy + 02.disabled + +* 03.notalink +EOF +simple_test script list data |