#!/bin/sh # Inside the container: a headless sway desktop with a full runtime folder (like the crashed one). export XDG_RUNTIME_DIR=/run/xdg HOME=/tmp/home mkdir -p $HOME export WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 WLR_RENDERER=pixman sway -c /e2e/app/deploy/test/wayland/sway.conf > /tmp/sway.log 2>&1 & SWAY=$! for i in $(seq 1 50); do ls $XDG_RUNTIME_DIR | grep -q '^wayland-[0-9]*$' && break; sleep 0.2; done export WAYLAND_DISPLAY=$(ls $XDG_RUNTIME_DIR | grep '^wayland-[0-9]*$' | head -1) sleep 2 dd if=/dev/zero of=$XDG_RUNTIME_DIR/filler bs=64k 2>/dev/null echo "== runtime folder: $(df -h $XDG_RUNTIME_DIR | tail -1) display=$WAYLAND_DISPLAY" alive() { kill -0 $SWAY 2>/dev/null && echo " sway still running" || { echo " SWAY DIED"; tail -5 /tmp/sway.log; }; } shot() { timeout 30 "$1" --tool computer_use_screenshot '{}' > /tmp/shot-$2.txt 2>&1 echo "== $2 build, screenshot with the folder full: exit $? :: $(head -c 160 /tmp/shot-$2.txt | tr '\n' ' ')" alive } shot /usr/local/bin/anybot new echo "== full E2E (brain + relay + 2 devices), with a remote screenshot" cd /e2e/app && E2E_SCREENSHOT=1 E2E_TYPE=1 E2E_APP=foot python3 -I deploy/test/remote_e2e.py /e2e/app 2>&1 | tail -40 alive [ -d /out ] && cp /tmp/anybot-e2e-*/shot.jpg /out/ 2>/dev/null if [ -x /old/anybot ]; then shot /old/anybot old; fi