39 lines
1.8 KiB
Bash
Executable File
39 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# One cold start of the classroom, end to end: a fresh container, a fresh
|
|
# user profile, the desktop installed the way the package would install it,
|
|
# and the session brought up from nothing. Repeat it to see whether the
|
|
# room comes back the same way every time.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
LAB="$ROOT/tools/lab/lab"
|
|
ROUNDS="${1:-1}"
|
|
|
|
for round in $(seq 1 "$ROUNDS"); do
|
|
started=$(date +%s)
|
|
"$LAB" up >/dev/null
|
|
docker exec classroom-v2-lab /srv/classroom/tools/lab/install-desktop >/dev/null
|
|
docker exec classroom-v2-lab sh -c '
|
|
install -Dm644 /srv/classroom/config/chrome/policies/managed/ekklesia-classroom.json \
|
|
/etc/opt/chrome/policies/managed/ekklesia-classroom.json
|
|
install -Dm755 /srv/classroom/scripts/classroom-audio /usr/local/bin/classroom-audio
|
|
install -Dm755 /srv/classroom/scripts/classroom-theme /usr/local/bin/classroom-theme
|
|
install -Dm644 /srv/classroom/lib/classroom_audio.py \
|
|
/usr/local/lib/ekklesia-classroom/classroom_audio.py
|
|
install -Dm644 /srv/classroom/lib/classroom_config.py \
|
|
/usr/local/lib/ekklesia-classroom/classroom_config.py
|
|
install -Dm644 /srv/classroom/systemd/user/ekklesia-classroom-audio.service \
|
|
/etc/systemd/user/ekklesia-classroom-audio.service'
|
|
"$LAB" session >/dev/null
|
|
sleep 6
|
|
|
|
panel=$(docker exec classroom-v2-lab pgrep -c -x plasmashell || echo 0)
|
|
kwin=$(docker exec classroom-v2-lab pgrep -c -x kwin_wayland || echo 0)
|
|
applets=$(docker exec classroom-v2-lab sh -c \
|
|
'grep -c "^plugin=" /home/classroom/.config/plasma-org.kde.plasma.desktop-appletsrc 2>/dev/null' \
|
|
|| echo 0)
|
|
|
|
printf 'round %s: %ss plasmashell=%s kwin=%s applets=%s\n' \
|
|
"$round" "$(( $(date +%s) - started ))" "$panel" "$kwin" "$applets"
|
|
done
|