diff options
Diffstat (limited to 'test/integration')
-rwxr-xr-x | test/integration/test-apt-cli-json-hooks | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/integration/test-apt-cli-json-hooks b/test/integration/test-apt-cli-json-hooks index a3bcf3fdb..17bd17814 100755 --- a/test/integration/test-apt-cli-json-hooks +++ b/test/integration/test-apt-cli-json-hooks @@ -200,7 +200,7 @@ HOOK: BYE' apt dist-upgrade -s ################## version 0.1 ######################### TEST_HOOK_VERSION=0.1 -testequal 'Reading package lists... +testsuccessequal 'Reading package lists... Building dependency tree... Calculating upgrade... HOOK: HELLO @@ -231,11 +231,7 @@ HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"par HOOK: empty HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty -HOOK: BYE -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol' apt dist-upgrade -s +HOOK: BYE' apt dist-upgrade -s ################## Wrong version ######################### @@ -267,7 +263,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET break fi done @@ -277,8 +273,8 @@ EOF testfailureequal 'Reading package lists... Building dependency tree... -E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0} -E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0}' apt install foo -s +E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0} +E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0}' apt install foo -s ################## Missing separator line ######################### cat > json-hook.sh << EOF @@ -290,7 +286,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "result": {"version": "0.2"}, "id": 0}\n' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "result": {"version": "0.1"}, "id": 0}\n' >&\$APT_HOOK_SOCKET break fi done @@ -313,7 +309,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "result": {"version": "0.2"}, "id": 0}\nXX' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "result": {"version": "0.1"}, "id": 0}\nXX' >&\$APT_HOOK_SOCKET break fi done |