ctdb-tests: Add tests for event scripts with multiple '.'s
authorAmitay Isaacs <amitay@gmail.com>
Thu, 12 Oct 2017 03:44:03 +0000 (14:44 +1100)
committerMartin Schwenke <martins@samba.org>
Wed, 18 Oct 2017 08:19:48 +0000 (10:19 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Oct 18 10:19:48 CEST 2017 on sn-devel-144

ctdb/tests/cunit/run_event_001.sh

index f0ffe4ff0c6b26e779c799448a43a866ba8c5bdb..35c256b6fcd16d5088391eba5f7fa5e50a3f6b5c 100755 (executable)
@@ -37,6 +37,27 @@ required_result 1 <<EOF
 EOF
 unit_test test -x "${scriptdir}/prog"
 
+cat > "$scriptdir/10.test.rpmnew" <<EOF
+#!/bin/sh
+
+echo hello
+EOF
+chmod +x "$scriptdir/10.test.rpmnew"
+
+# Invalid script with multiple '.'s
+ok <<EOF
+No event scripts found
+EOF
+unit_test run_event_test "$scriptdir" list
+
+ok <<EOF
+Script disable 10.test.rpmnew completed with result=22
+EOF
+unit_test run_event_test "$scriptdir" disable 10.test.rpmnew
+
+ok_null
+unit_test test -x "${scriptdir}/10.test.rpmnew"
+
 cat > "$scriptdir/11.foo" <<EOF
 #!/bin/sh