vinix-ports / tests / userland / paths.sh
36 lines · 36 sloc · 1.11 KB · cb356c9f5905cb931af55c684ebc8abd25d8319b
Raw
1#!/bin/sh
2set -eu
3export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp TERM=xterm-256color
4phase=shell
5finish() {
6 status=$?
7 if [ "$status" -ne 0 ]; then echo "VPAC package path check failed at $phase"; fi
8 /sbin/poweroff -f
9}
10trap finish EXIT
11mkdir -p /tmp
12cd /tmp
13/bin/zsh -fc '
14 zmodload zsh/attr && zmodload zsh/zle && zmodload zsh/complete || exit 1
15 autoload -Uz compinit && compinit -i -D || exit 1
16 (( $+functions[_main_complete] )) || exit 1
17 print -r -- "Zsh $ZSH_VERSION loaded modules and completions"
18'
19phase=terminfo
20for term in linux alacritty xterm-256color; do
21 infocmp "$term" >"/tmp/$term"
22 grep -q "$term" "/tmp/$term"
23done
24phase=fonts
25font=/usr/share/fonts/X11/misc/10x20.pcf.gz
26index=/usr/share/fonts/X11/misc/fonts.dir
27grep -q '^10x20.pcf.gz ' "$index"
28family=$(fc-scan --format '%{family}' "$font")
29test -n "$family"
30printf 'Packaged bitmap font family: %s\n' "$family"
31phase=binutils
32target=$(/bin/busybox uname -m)-linux-musl
33"/usr/$target/bin/as" --version
34"/usr/$target/bin/ld" --verbose >/tmp/linker-script
35grep -q 'SECTIONS' /tmp/linker-script
36echo 'VPAC FIXTURE GUEST PASS'
37