summaryrefslogtreecommitdiffstats
path: root/tests/test_daemon
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:38:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:38:06 +0000
commit695ad2c6d0b157d2969c9b946d9e3765113a61e7 (patch)
treeeaab7e7e2523ad710afe779d532156258e40d5cc /tests/test_daemon
parentInitial commit. (diff)
downloadpowerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.tar.xz
powerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.zip
Adding upstream version 2.8.1.upstream/2.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_daemon')
-rwxr-xr-xtests/test_daemon/test.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/test_daemon/test.sh b/tests/test_daemon/test.sh
new file mode 100755
index 0000000..a5c12c1
--- /dev/null
+++ b/tests/test_daemon/test.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+. tests/shlib/common.sh
+
+enter_suite daemon final
+
+export ADDRESS="powerline-ipc-test-$$"
+echo "Powerline address: $ADDRESS"
+if "$PYTHON" "$ROOT/scripts/powerline-daemon" -s"$ADDRESS" ; then
+ sleep 1
+ if ! ( \
+ "$PYTHON" "$ROOT/client/powerline.py" \
+ --socket "$ADDRESS" -p/dev/null shell left \
+ | grep "file not found"
+ ) ; then
+ fail "devnull" F "-p/dev/null argument ignored or not treated properly"
+ fi
+ if ( \
+ "$PYTHON" "$ROOT/client/powerline.py" --socket "$ADDRESS" \
+ -p"$ROOT/powerline/config_files" shell left \
+ | grep "file not found"
+ ) ; then
+ fail "nodevnull" F "-p/dev/null argument remembered while it should not"
+ fi
+ if ! ( \
+ cd "$ROOT/tests/test_daemon" \
+ && "$PYTHON" "$ROOT/client/powerline.py" --socket "$ADDRESS" \
+ -p"$ROOT/powerline/config_files" shell left \
+ | grep "test_daemon"
+ ) ; then
+ fail "segment" F "Output lacks string “tests”"
+ fi
+else
+ fail "exitcode" E "Daemon exited with status $?"
+fi
+if "$PYTHON" "$ROOT/scripts/powerline-daemon" -s"$ADDRESS" -k ; then
+ :
+else
+ fail "-k" F "powerline-daemon -k failed with exit code $?"
+fi
+
+exit_suite