diff options
-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 +} + |