test.sh revision bd2b15138e1e1da8bc21072cf585179985c902e1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering#!/bin/bash
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering# ex: ts=8 sw=4 sts=4 et filetype=sh
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart PoetteringTEST_DESCRIPTION="Basic systemd setup"
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart PoetteringKVERSION=${KVERSION-$(uname -r)}
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering# Uncomment this to debug failures
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering#DEBUGFAIL="systemd.unit=multi-user.target"
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poetteringrun_qemu() {
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering qemu-kvm \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering -hda $TESTDIR/rootdisk.img \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering -m 256M -nographic \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering -net none -kernel /boot/vmlinuz-$KVERSION \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering -append "root=/dev/sda1 systemd.log_level=debug raid=noautodetect loglevel=2 init=/usr/lib/systemd/systemd rw console=ttyS0,115200n81 selinux=0 $DEBUGFAIL"
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering ret=1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkdir -p $TESTDIR/root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mount ${LOOPDEV}p1 $TESTDIR/root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering [[ -e $TESTDIR/root/testok ]] && ret=0
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cp -a $TESTDIR/root/var/log/journal $TESTDIR
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cp -a $TESTDIR/root/failed $TESTDIR
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering umount $TESTDIR/root
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering cat $TESTDIR/failed
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering ls -l $TESTDIR/journal/*/*.journal
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering test -s $TESTDIR/failed && ret=$(($ret+1))
6482f6269c87d2249e52e889a63adbdd50f2d691Ronny Chevalier return $ret
0b452006de98294d1690f045f6ea2f7f6630ec3bRonny Chevalier}
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
288a74cce597f81d3ba01d8a5ca7d2ba5b654b7eRonny Chevalierrun_nspawn() {
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering systemd-nspawn -b -D $TESTDIR/nspawn-root /usr/lib/systemd/systemd
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering ret=1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering [[ -e $TESTDIR/nspawn-root/testok ]] && ret=0
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering cp -a $TESTDIR/nspawn-root/var/log/journal $TESTDIR
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cp -a $TESTDIR/nspawn-root/failed $TESTDIR
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cat $TESTDIR/failed
31885cd5e38ec9807a6a7ab32660cf8c2fcf48f7Zbigniew Jędrzejewski-Szmek ls -l $TESTDIR/journal/*/*.journal
b68fa010f72599e6da5822feda5ae3a47a4e63d8Simon Peeters test -s $TESTDIR/failed && ret=$(($ret+1))
b68fa010f72599e6da5822feda5ae3a47a4e63d8Simon Peeters return $ret
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering}
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poetteringtest_run() {
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering run_qemu || return 1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering if [[ -d /sys/fs/cgroup/systemd ]]; then
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering run_nspawn || return 1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering fi
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering return 0
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering}
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poetteringtest_setup() {
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering rm -f $TESTDIR/rootdisk.img
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # Create the blank file to use as a root filesystem
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering dd if=/dev/null of=$TESTDIR/rootdisk.img bs=1M seek=100
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
5841bd803f1b651c0d70c6ae114630723a76d1daZbigniew Jędrzejewski-Szmek [ -b $LOOPDEV ] || return 1
5841bd803f1b651c0d70c6ae114630723a76d1daZbigniew Jędrzejewski-Szmek echo "LOOPDEV=$LOOPDEV" >> $STATEFILE
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering sfdisk -C 3200 -H 2 -S 32 -L $LOOPDEV <<EOF
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering,
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart PoetteringEOF
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkfs.ext3 -L systemd ${LOOPDEV}p1
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkdir -p $TESTDIR/root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mount ${LOOPDEV}p1 $TESTDIR/root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkdir -p $TESTDIR/root/run
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering kernel=$KVERSION
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # Create what will eventually be our root filesystem onto an overlay
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering (
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering LOG_LEVEL=5
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering initdir=$TESTDIR/root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # create the basic filesystem layout
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering setup_basic_dirs
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install compiled files
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering (cd ../..; make DESTDIR=$initdir install)
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install possible missing libraries
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering for i in $initdir/{sbin,bin}/* $initdir/lib/systemd/*; do
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst_libs $i
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering done
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering # activate kmsg import
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering echo 'ImportKernel=yes' >> $initdir/etc/systemd/journald.conf
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # make a journal directory
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkdir -p $initdir/var/log/journal
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering # install some basic config files
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/sysconfig/init
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst /etc/passwd
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/shadow
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/group
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/shells
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/nsswitch.conf
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst /etc/pam.conf
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/securetty
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst /etc/os-release
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering inst /etc/localtime
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # we want an empty environment
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering > $initdir/etc/environment
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering # set the hostname
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering echo systemd-testsuite > $initdir/etc/hostname
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt # setup the testsuite target
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cat >$initdir/etc/systemd/system/testsuite.target <<EOF
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering[Unit]
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringDescription=Testsuite target
fea72cc0336f4d90875cdddc1aa9739dcbb174f5Lennart PoetteringRequires=multi-user.target
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringAfter=multi-user.target
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart PoetteringConflicts=rescue.target
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringAllowIsolate=yes
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringEOF
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering # setup the testsuite service
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering cat >$initdir/etc/systemd/system/testsuite.service <<EOF
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering[Unit]
fea72cc0336f4d90875cdddc1aa9739dcbb174f5Lennart PoetteringDescription=Testsuite service
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringAfter=multi-user.target
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering[Service]
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringExecStart=/bin/sh -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok'
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringExecStartPost=/usr/sbin/poweroff
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringType=oneshot
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart PoetteringEOF
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering mkdir -p $initdir/etc/systemd/system/testsuite.target.wants
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering ln -fs ../testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # make the testsuite the default target
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering ln -fs testsuite.target $initdir/etc/systemd/system/default.target
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering mkdir -p $initdir/etc/rc.d
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cat >$initdir/etc/rc.d/rc.local <<EOF
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering#!/bin/bash
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poetteringexit 0
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart PoetteringEOF
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering chmod 0755 $initdir/etc/rc.d/rc.local
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install basic tools needed
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt dracut_install sh bash setsid loadkeys setfont \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering login sushell sulogin gzip sleep echo
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install libnss_files for login
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst_libdir_file "libnss_files*"
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install dbus and pam
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering find \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /etc/dbus-1 \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /etc/pam.d \
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering /etc/security \
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering /lib64/security \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /lib/security -xtype f \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering | while read file; do
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst $file
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering done
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install dbus socket and service file
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst /usr/lib/systemd/system/dbus.socket
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst /usr/lib/systemd/system/dbus.service
60053efbbaabf084e1ecd61474fdc7235fe3da64Thomas Hindoe Paaboel Andersen
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # install basic keyboard maps and fonts
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering for i in \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /usr/lib/kbd/consolefonts/latarcyrheb-sun16* \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /usr/lib/kbd/keymaps/include/* \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /usr/lib/kbd/keymaps/i386/include/* \
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering /usr/lib/kbd/keymaps/i386/qwerty/us.*; do
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering [[ -f $i ]] || continue
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering inst $i
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering done
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering # some basic terminfo files
df758e98754016119a9c8d49213a636a80ffab22Kay Sievers for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
3e09eb5c83e56bc0184bd9d9c44f76047464f77cAndreas Henriksson [ -f ${_terminfodir}/l/linux ] && break
df758e98754016119a9c8d49213a636a80ffab22Kay Sievers done
df758e98754016119a9c8d49213a636a80ffab22Kay Sievers dracut_install -o ${_terminfodir}/l/linux
ccd06097c79218f7d5ea4c21721bbcbc7c467dcaZbigniew Jędrzejewski-Szmek
df758e98754016119a9c8d49213a636a80ffab22Kay Sievers # softlink mtab
df758e98754016119a9c8d49213a636a80ffab22Kay Sievers ln -fs /proc/self/mounts $initdir/etc/mtab
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
60053efbbaabf084e1ecd61474fdc7235fe3da64Thomas Hindoe Paaboel Andersen # install any Exec's from the service files
fea72cc0336f4d90875cdddc1aa9739dcbb174f5Lennart Poettering egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
60053efbbaabf084e1ecd61474fdc7235fe3da64Thomas Hindoe Paaboel Andersen | while read i; do
60053efbbaabf084e1ecd61474fdc7235fe3da64Thomas Hindoe Paaboel Andersen i=${i##Exec*=}; i=${i##-}
60053efbbaabf084e1ecd61474fdc7235fe3da64Thomas Hindoe Paaboel Andersen inst $i
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering done
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering # install plymouth, if found... else remove plymouth service files
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$TEST_BASE_DIR/test-functions" \
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering /usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering dracut_install plymouth plymouthd
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering else
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering rm -f $initdir/usr/lib/systemd/system/plymouth* $initdir/usr/lib/systemd/system/*/plymouth*
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering fi
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering # some helper tools for debugging
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering dracut_install sh df free ls shutdown poweroff \
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering stty cat ps ln ip route \
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering mount dmesg dhclient mkdir cp ping dhclient \
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering umount strace less grep id tty touch
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering # install ld.so.conf* and run ldconfig
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering cp -a /etc/ld.so.conf* $initdir/etc
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering ldconfig -r "$initdir"
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering )
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering rm -fr $TESTDIR/nspawn-root
6301a98cdf26dc073f5317506c806bfa69f74cc8Lennart Poettering cp -avr $TESTDIR/root $TESTDIR/nspawn-root
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
e1d758033dc7e101ab32323a0f1649d8daf56a22Ronny Chevalier umount $TESTDIR/root
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering}
aaf7eb81be912e7bed939f31e3bc4c631b2552b3Lennart Poettering
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidttest_cleanup() {
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering umount $TESTDIR/root 2>/dev/null
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering [[ $LOOPDEV ]] && losetup -d $LOOPDEV
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering return 0
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering}
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering. $TEST_BASE_DIR/test-functions
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidtdo_test "$@"
bd3fa1d2434aa28564251ac4da34d01537de8c4bLennart Poettering