summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-05-24 15:51:10 +0200
committerHarald Hoyer <harald@redhat.com>2012-05-24 15:52:31 +0200
commitd9890f4ed47c0d565915360d8bae3b7a1428f285 (patch)
tree4fd646fa2f6d5afa7a19c939986628801fa36a55 /test
parent9262a519468491c80df2998eda238e2ac86a810d (diff)
downloadsystemd-d9890f4ed47c0d565915360d8bae3b7a1428f285.tar.gz
test/TEST-01-BASIC: add systemd-nspawn run with the root image
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-01-BASIC/test.sh26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index c84fb668b4..ca8a5ee872 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -8,7 +8,7 @@ KVERSION=${KVERSION-$(uname -r)}
# Uncomment this to debug failures
#DEBUGFAIL="systemd.unit=multi-user.target"
-test_run() {
+run_qemu() {
qemu-kvm \
-hda $TESTDIR/rootdisk.img \
-m 256M -nographic \
@@ -27,6 +27,26 @@ test_run() {
return $ret
}
+
+run_nspawn() {
+ systemd-nspawn -b -D $TESTDIR/nspawn-root /usr/lib/systemd/systemd
+ ret=1
+ [[ -e $TESTDIR/nspawn-root/testok ]] && ret=0
+ cp -a $TESTDIR/nspawn-root/var/log/journal $TESTDIR
+ cp -a $TESTDIR/nspawn-root/failed $TESTDIR
+ cat $TESTDIR/failed
+ ls -l $TESTDIR/journal/*/*.journal
+ test -s $TESTDIR/failed && ret=$(($ret+1))
+ return $ret
+}
+
+
+test_run() {
+ run_qemu || return 1
+ run_nspawn || return 1
+ return 0
+}
+
test_setup() {
rm -f $TESTDIR/rootdisk.img
# Create the blank file to use as a root filesystem
@@ -184,8 +204,10 @@ EOF
ldconfig -r "$initdir"
)
- umount $TESTDIR/root
+ rm -fr $TESTDIR/nspawn-root
+ cp -avr $TESTDIR/root $TESTDIR/nspawn-root
+ umount $TESTDIR/root
}
test_cleanup() {