blob: 78160661aa95d701dfbd2db6d4c01c6c6d7fcf0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/bash
# The sshpass password below is the disposable test guest's throwaway root
# password (scripts/testing/archsetup-test.conf), reachable only on loopback.
# It is not a credential for anything real.
# Alias-path focus run: reset the fixture with the given daemon and drive only
# the alias mode hard (the lazy-registration race under Lock/Unlock via alias).
set -uo pipefail
label="$1"; daemon="$2"; asan="${3:-}"; clients="${4:-8000}"
here="$(cd "$(dirname "$0")" && pwd)"
ssho=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 -o LogLevel=ERROR -o PreferredAuthentications=password -o PubkeyAuthentication=no)
g() { sshpass -p archsetup ssh "${ssho[@]}" -p 2237 root@127.0.0.1 "$@"; }
gcp() { sshpass -p archsetup scp "${ssho[@]}" -P 2237 "$@"; }
as_user='runuser -u keyring-test -- env XDG_RUNTIME_DIR=/run/user/1000 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus'
echo "=== $label alias-only daemon=$daemon asan=${asan:-none} $(date -Is)"
gcp "$here/probe.py" root@127.0.0.1:/opt/keyring-vm/probe.py >/dev/null
g "rm -f /tmp/asan.log*; KEYRING_DAEMON_BINARY='$daemon' ASAN_OPTIONS='$asan' /root/setup-guest.sh" >/dev/null || { echo "FIXTURE FAILED"; exit 1; }
since=$(g 'date "+%Y-%m-%d %H:%M:%S"')
g "$as_user python3 /opt/keyring-vm/probe.py alias --clients $clients --workers 32 --batch 100" 2>&1 | tail -2; rc=${PIPESTATUS[0]}
echo "alias rc=$rc"
secret=$(g "$as_user secret-tool lookup purpose keyring-vm" 2>/dev/null); echo "secret after alias: ${secret:-empty}"
echo "--- journal"; g "journalctl --since '$since' --no-pager -o short-iso 2>/dev/null | grep -E 'gnome-keyring' | grep -iE 'assert|abort|critical|sanitizer|dumped' | head -20"
[ -n "$asan" ] && { echo "--- asan"; g 'cat /tmp/asan.log* 2>/dev/null | head -60 || echo "no asan log"'; }
echo "=== $label alias-only result: $([ "$rc" = 0 ] && [ "$secret" = synthetic-vm-secret ] && echo PASS || echo FAIL)"
|