File: test_without_chroot

package info (click to toggle)
reform-setup-wizard 1.0-14.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 556 kB
  • sloc: sh: 363; python: 295; makefile: 21
file content (135 lines) | stat: -rwxr-xr-x 3,586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/sh

set -exu

systemd-machine-id-setup

dbus-daemon --fork --session --print-address=3 --print-pid=4 \
	3> /tmp/dbus-session-bus-address 4> /tmp/dbus-session-bus-pid

DBUS_SESSION_BUS_ADDRESS="$(cat /tmp/dbus-session-bus-address)"

mkdir -p /root/.config/wayvnc
cat <<END > /root/.config/wayvnc/config
address=0.0.0.0
enable_auth=false
username=root
password=rootme
private_key_file=/root/key.pem
certificate_file=/root/cert.pem
END

mkdir -p /root/.config/dconf
echo "exec wayvnc 0.0.0.0 5910" > /etc/sway/config.d/wayvnc.conf
echo "exec \"socat TCP-LISTEN:7023,fork UNIX-CONNECT:/tmp/sway-ipc.sock\"" > /etc/sway/config.d/socat.conf
echo "output HEADLESS-1 resolution 1920x1080" > /etc/sway/config.d/headless.conf

mkdir -p /etc/skel/.config/
touch /etc/skel/.config/wayfire.ini
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout /root/key.pem -out /root/cert.pem -subj /CN=localhost -addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1

setpriv --pdeathsig TERM env \
	--chdir=/root \
	DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
	SWAYSOCK=/tmp/sway-ipc.sock \
	WLR_LIBINPUT_NO_DEVICES=1 \
	WLR_BACKENDS=headless \
	WLR_RENDERER=pixman \
	WLR_RENDERER_ALLOW_SOFTWARE=1 \
	XDG_RUNTIME_DIR=/tmp \
	CHROOT_MODE=1 \
	sway --config /usr/share/reform-setup-wizard/reform-setup-sway-config &
SWAYPID=$!

mkdir -p ./debian/tests/screenshots
trap 'cp -a ./debian/tests/screenshots "$AUTOPKGTEST_ARTIFACTS"' EXIT INT TERM

cat << END | env --chdir=./debian/tests python3 ./minivncdotool.py
connect 127.0.0.1 5910 60
sleep 60
capture screenshots/00test.png
wait_visible patterns/get_started.png 60
mousemove patterns/get_started.png
capture screenshots/00welcome.png
click
wait_visible patterns/keyboard_layout.png 8
mousemove 0 0
mousemove patterns/next.png
capture screenshots/01keyboard.png
click
wait_visible patterns/time.png 8
mousemove 0 0
mousemove patterns/next.png
capture screenshots/02time.png
click
wait_visible patterns/desktop.png 8
mousemove 0 0
mousemove patterns/next.png
capture screenshots/03desktop.png
click
wait_visible patterns/root.png 8
key p
sleep 1
key Tab
sleep 1
key p
mousemove 0 0
mousemove patterns/next.png
capture screenshots/04root.png
click
wait_visible patterns/computer_name.png 8
key m
sleep 1
key m
mousemove 0 0
mousemove patterns/next.png
capture screenshots/05hostname.png
click
wait_visible patterns/account.png 8
key u
sleep 1
key Tab
sleep 1
key p
sleep 1
key Tab
sleep 1
key p
mousemove 0 0
mousemove patterns/next.png
capture screenshots/06account.png
click
END

#kill $SWAYPID
wait $SWAYPID

test -s /etc/machine-id
test "$(readlink /etc/localtime)" = "/usr/share/zoneinfo/Europe/Berlin"
test "$(cat /etc/timezone)" = "Europe/Berlin"
test "$(tail -1 /etc/passwd)" = "u:x:$(id -u u):$(id -g u):,,,:/home/u:/bin/bash"
test "$(tail -1 /etc/group)" = "u:x:$(id -g u):"
grep --quiet --fixed-strings --line-regexp 'command = "/usr/bin/tuigreet --window-padding 4 --remember --asterisks --cmd /usr/bin/wayfire"' /etc/greetd/config.toml
cmp /home/u/.config/sway/config.d/input /etc/skel/.config/sway/config.d/input
cat <<'KEYBOARD' | cmp /etc/default/keyboard
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="eu"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
KEYBOARD
cat <<'KEYBOARD' | cmp /etc/skel/.config/sway/config.d/input
# change to de if you have a QWERTZ keyboard, for example
input * {
        xkb_layout eu
        xkb_variant ""
        xkb_options lv3:ralt_switch
}
KEYBOARD

cp -a ./debian/tests/screenshots/*.png "$AUTOPKGTEST_ARTIFACTS"