diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-24 15:47:58 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-24 15:47:58 +0200 |
commit | 90d5d98a73e40409b3ff8a9e197c94424b61dd8a (patch) | |
tree | 5c0a7fe079fcb546602c57f4a20120ad41497aea | |
parent | 04eb47bad79540f5e9d4ed31e50ab8f19029f7ae (diff) | |
download | alpine-conf-90d5d98a73e40409b3ff8a9e197c94424b61dd8a.zip |
setup-xen-dom0: add test
-rw-r--r-- | setup-xen-dom0.in | 9 | ||||
-rwxr-xr-x | tests/setup_xen_dom0_test | 15 |
2 files changed, 20 insertions, 4 deletions
diff --git a/setup-xen-dom0.in b/setup-xen-dom0.in index a4dc965..beab62b 100644 --- a/setup-xen-dom0.in +++ b/setup-xen-dom0.in @@ -3,18 +3,19 @@ # simple script to setup basic xen dom0 # kernel modules +mkdir -p "$ROOT"/etc for mod in xen_netback xen_blkback xenfs xen_pciback xen_wdt tun; do - if modprobe $mod; then - grep -q -w $mod /etc/modules || echo $mod >> /etc/modules + if $MOCK modprobe $mod; then + grep -q -w $mod "$ROOT"/etc/modules 2>/dev/null || echo $mod >> "$ROOT"/etc/modules fi done # install packages -apk add --quiet xen +$MOCK apk add --quiet xen # setup and start services for svc in xenstored xenconsoled xenqemu; do - rc-update -q add $svc default + rc-update --quiet add $svc default done rc-service xenstored start diff --git a/tests/setup_xen_dom0_test b/tests/setup_xen_dom0_test new file mode 100755 index 0000000..cb57f8b --- /dev/null +++ b/tests/setup_xen_dom0_test @@ -0,0 +1,15 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh +init_tests \ + setup_xen_dom0 + +setup_xen_dom0_body() { + init_env + atf_check -s exit:0 \ + -o match:"modprobe xen" \ + -o match:"Starting xen" \ + -e empty \ + setup-xen-dom0 +} + |