vinix-ports / tests / x11 / public-mode-upgrade.sh
40 lines · 34 sloc · 1.35 KB · e9909e7354f9bbb17505a244f919ec5d8f0f9a1a
Raw
1#!/bin/sh
2set -eu
3export PATH=/bin:/usr/bin:/sbin:/usr/sbin LC_ALL=C
4trap '/sbin/poweroff -f' EXIT
5
6test "$(uname -o)" = Vinix
7test "$(id -u)" = 0
8test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg
9test "$(stat -c '%a' /usr/include/libiberty)" = 700
10
11pkg upgrade >/tmp/public-mode-upgrade.log 2>&1 || {
12 cat /tmp/public-mode-upgrade.log
13 exit 1
14}
15cat /tmp/public-mode-upgrade.log
16if grep -E '^error:|failed to run .*hook|scriptlet failed' /tmp/public-mode-upgrade.log; then
17 exit 1
18fi
19
20while IFS=' ' read -r name version; do
21 test -s "/var/lib/vpac/local/$name-$version/desc"
22 vpac q -F validation "local/$name" |
23 grep -Eq '^validation[[:space:]]+signature$'
24done </usr/share/vinix-mode-upgrade/versions
25
26while IFS= read -r path; do
27 test -d "$path"
28 test "$(stat -c '%a' "$path")" = 755
29done </usr/share/vinix-mode-upgrade/paths
30
31/bin/su -s /bin/sh -c 'test -r /usr/lib/bfd-plugins/liblto_plugin.so &&
32 test -r /usr/include/libiberty/libiberty.h &&
33 test -r /usr/lib/cmake/FreeGLUT/FreeGLUTConfig.cmake &&
34 test -r /usr/lib/xorg/modules/input/inputtest_drv.so &&
35 test -r /usr/lib/xorg/modules/extensions/libglx.so &&
36 test -r /usr/lib/xorg/modules/drivers/fbdev_drv.so &&
37 test -r /etc/X11/xinit/xinitrc' nobody
38
39echo 'Vinix upgraded the signed compiler and X11 packages and restored public access'
40echo 'VPAC FIXTURE GUEST PASS'
41