vinix-ports / tests / userland / paths.sh
37 lines · 37 sloc · 1.18 KB · 03ea1f3a4af219fc6750fbe29c0fd11755013546
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 [[ ${_comps[pmap]} == _pmap && ${_comps[chcon]} == _selinux ]] || exit 1
18 print -r -- "Zsh $ZSH_VERSION loaded modules and completions"
19'
20phase=terminfo
21for term in linux alacritty xterm-256color; do
22 infocmp "$term" >"/tmp/$term"
23 grep -q "$term" "/tmp/$term"
24done
25phase=fonts
26font=/usr/share/fonts/X11/misc/10x20.pcf.gz
27index=/usr/share/fonts/X11/misc/fonts.dir
28grep -q '^10x20.pcf.gz ' "$index"
29family=$(fc-scan --format '%{family}' "$font")
30test -n "$family"
31printf 'Packaged bitmap font family: %s\n' "$family"
32phase=binutils
33target=$(/bin/busybox uname -m)-linux-musl
34"/usr/$target/bin/as" --version
35"/usr/$target/bin/ld" --verbose >/tmp/linker-script
36grep -q 'SECTIONS' /tmp/linker-script
37echo 'VPAC FIXTURE GUEST PASS'
38