summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-cli-json-hooks15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/integration/test-apt-cli-json-hooks b/test/integration/test-apt-cli-json-hooks
index 3ec470284..a3bcf3fdb 100755
--- a/test/integration/test-apt-cli-json-hooks
+++ b/test/integration/test-apt-cli-json-hooks
@@ -28,14 +28,12 @@ export TEST_HOOK_VERSION=0.2
cat >> json-hook.sh << EOF
#!/bin/bash
-set -e
+trap '' SIGPIPE
while true; do
- read request <&\$APT_HOOK_SOCKET
- read empty <&\$APT_HOOK_SOCKET
+ read request <&\$APT_HOOK_SOCKET || exit 1
if echo "\$request" | grep -q ".hello"; then
echo "HOOK: HELLO"
- printf '{"jsonrpc": "2.0", "result": {"version": "'\$TEST_HOOK_VERSION'"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET
fi
if echo "\$request" | grep -q ".bye"; then
@@ -44,7 +42,16 @@ while true; do
fi
echo HOOK: request \$request
+
+ read empty <&\$APT_HOOK_SOCKET || exit 1
+
echo HOOK: empty \$empty
+
+ if echo "\$request" | grep -q ".hello"; then
+ printf '{"jsonrpc": "2.0", "result": {"version": "'\$TEST_HOOK_VERSION'"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET 2>/dev/null || exit 1
+ fi
+
+
done
EOF