diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-13 23:19:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-13 23:19:05 +0200 |
commit | 71dc3ed1d95dfe246004018c2ca85156fc73c146 (patch) | |
tree | 3fb65cc7665562e7f7852ecb125e0e4e2340ae27 /test/TEST-01-BASIC | |
parent | a33fdebb30cac102db7037a5bcdc85d6c49d4aad (diff) | |
download | systemd-71dc3ed1d95dfe246004018c2ca85156fc73c146.tar.gz systemd-71dc3ed1d95dfe246004018c2ca85156fc73c146.tar.bz2 systemd-71dc3ed1d95dfe246004018c2ca85156fc73c146.zip |
test: split of cryptsetup into its own test
Diffstat (limited to 'test/TEST-01-BASIC')
-rwxr-xr-x | test/TEST-01-BASIC/test.sh | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 8979872ef2..eb6a80a07c 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -23,12 +23,8 @@ run_qemu() { mount ${LOOPDEV}p1 $TESTDIR/root [[ -e $TESTDIR/root/testok ]] && ret=0 cp -a $TESTDIR/root/failed $TESTDIR - cryptsetup luksOpen ${LOOPDEV}p2 varcrypt <$TESTDIR/keyfile - mount /dev/mapper/varcrypt $TESTDIR/root/var cp -a $TESTDIR/root/var/log/journal $TESTDIR - umount $TESTDIR/root/var umount $TESTDIR/root - cryptsetup luksClose /dev/mapper/varcrypt cat $TESTDIR/failed ls -l $TESTDIR/journal/*/*.journal test -s $TESTDIR/failed && ret=$(($ret+1)) @@ -40,8 +36,8 @@ run_nspawn() { systemd-nspawn -b -D $TESTDIR/nspawn-root --capability=CAP_AUDIT_CONTROL,CAP_AUDIT_WRITE /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 + cp -a $TESTDIR/nspawn-root/var/log/journal $TESTDIR cat $TESTDIR/failed ls -l $TESTDIR/journal/*/*.journal test -s $TESTDIR/failed && ret=$(($ret+1)) @@ -77,14 +73,9 @@ EOF mkfs.ext3 -L systemd ${LOOPDEV}p1 echo -n test >$TESTDIR/keyfile - cryptsetup -q luksFormat ${LOOPDEV}p2 $TESTDIR/keyfile - cryptsetup luksOpen ${LOOPDEV}p2 varcrypt <$TESTDIR/keyfile - mkfs.ext3 -L var /dev/mapper/varcrypt mkdir -p $TESTDIR/root mount ${LOOPDEV}p1 $TESTDIR/root mkdir -p $TESTDIR/root/run - mkdir -p $TESTDIR/root/var - mount /dev/mapper/varcrypt $TESTDIR/root/var # Create what will eventually be our root filesystem onto an overlay ( @@ -105,9 +96,6 @@ EOF inst_libs $i done - # activate kmsg import - echo 'ImportKernel=yes' >> $initdir/etc/systemd/journald.conf - # make a journal directory mkdir -p $initdir/var/log/journal @@ -129,18 +117,10 @@ EOF # set the hostname echo systemd-testsuite > $initdir/etc/hostname - eval $(udevadm info --export --query=env --name=/dev/mapper/varcrypt) eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) - cat >$initdir/etc/crypttab <<EOF -$DM_NAME UUID=$ID_FS_UUID /etc/varkey -EOF - echo -n test > $initdir/etc/varkey - cat $initdir/etc/crypttab | ddebug - cat >$initdir/etc/fstab <<EOF LABEL=systemd / ext3 rw 0 1 -/dev/mapper/varcrypt /var ext3 defaults 0 1 EOF # setup the testsuite target @@ -160,7 +140,7 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/bin/bash -c 'set -x; systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok; while : ;do systemd-cat echo "testsuite service waiting for /var/log/journal" ; echo "testsuite service waiting for journal to move to /var/log/journal" > /dev/console ; for i in /var/log/journal/*;do [ -d "\$i" ] && echo "\$i" && break 2; done; sleep 1; done; sleep 1; exit 0;' +ExecStart=/bin/bash -c 'set -x; systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok; while : ;do echo "testsuite service waiting for journal to move to /var/log/journal" > /dev/console ; for i in /var/log/journal/*;do [ -d "\$i" ] && echo "\$i" && break 2; done; sleep 1; done; sleep 1; exit 0;' ExecStopPost=/usr/bin/systemctl poweroff Type=oneshot EOF @@ -180,14 +160,6 @@ EOF login sushell sulogin gzip sleep echo mount umount cryptsetup dracut_install dmsetup modprobe - instmods dm_crypt =crypto - - type -P dmeventd >/dev/null && dracut_install dmeventd - - inst_libdir_file "libdevmapper-event.so*" - - inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules - # install libnss_files for login inst_libdir_file "libnss_files*" @@ -266,16 +238,11 @@ EOF # we don't mount in the nspawn root rm -fr $TESTDIR/nspawn-root/etc/fstab - ddebug "umount $TESTDIR/root/var" - umount $TESTDIR/root/var - cryptsetup luksClose /dev/mapper/varcrypt ddebug "umount $TESTDIR/root" umount $TESTDIR/root } test_cleanup() { - umount $TESTDIR/root/var 2>/dev/null - [[ -b /dev/mapper/varcrypt ]] && cryptsetup luksClose /dev/mapper/varcrypt umount $TESTDIR/root 2>/dev/null [[ $LOOPDEV ]] && losetup -d $LOOPDEV return 0 |