parsec-service: add ping autopkgtest
Emanuele Rocca
1 year, 3 months ago
2 | 2 |
* Initial release. (Closes: #1028626)
|
3 | 3 |
* Package parsec-service 1.1.0 from crates.io using debcargo 2.6.0
|
4 | 4 |
|
5 | |
-- Emanuele Rocca <ema@debian.org> Wed, 08 Feb 2023 00:31:58 +0100
|
|
5 |
-- Emanuele Rocca <ema@debian.org> Wed, 08 Feb 2023 17:43:30 +0100
|
|
0 |
[core_settings]
|
|
1 |
allow_root = true
|
|
2 |
|
|
3 |
[listener]
|
|
4 |
listener_type = "DomainSocket"
|
|
5 |
timeout = 100
|
|
6 |
socket_path = "/run/parsec.sock"
|
|
7 |
|
|
8 |
[authenticator]
|
|
9 |
auth_type = "UnixPeerCredentials"
|
|
10 |
|
|
11 |
[[key_manager]]
|
|
12 |
name = "sqlite-manager"
|
|
13 |
manager_type = "SQLite"
|
|
14 |
|
|
15 |
[[provider]]
|
|
16 |
name = "mbed-crypto-provider"
|
|
17 |
provider_type = "MbedCrypto"
|
|
18 |
key_info_manager = "sqlite-manager"
|
0 | 0 |
Tests: smoke.sh
|
1 | 1 |
Depends: @
|
2 | 2 |
Restrictions: superficial
|
|
3 |
|
|
4 |
Tests: ping.sh
|
|
5 |
Depends: netcat-openbsd, @
|
|
6 |
Restrictions: needs-root
|
|
0 |
#!/bin/bash
|
|
1 |
|
|
2 |
set -e
|
|
3 |
|
|
4 |
# Parsec uses a binary protocol described at:
|
|
5 |
# https://parallaxsecond.github.io/parsec-book/parsec_client/wire_protocol.html
|
|
6 |
# The following variables contain the base64 encoding of a ping and a pong:
|
|
7 |
ENCODED_PING="EKfAXh4AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAA"
|
|
8 |
ENCODED_PONG="EKfAXh4AAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAEAAAAAAAAACAE="
|
|
9 |
|
|
10 |
function cleanup {
|
|
11 |
kill $(cat /run/parsec.pid)
|
|
12 |
}
|
|
13 |
|
|
14 |
trap cleanup EXIT
|
|
15 |
|
|
16 |
parsec -c debian/tests/config.toml &
|
|
17 |
echo $! > /run/parsec.pid
|
|
18 |
|
|
19 |
sleep 3
|
|
20 |
|
|
21 |
echo $ENCODED_PING | base64 --decode | nc -U /run/parsec.sock | base64 | grep -q $ENCODED_PONG
|