From f7011e17f1a86b4c355d644f379c668685b5e4e9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 5 Aug 2020 18:52:12 +0200 Subject: [PATCH] test: add test for new repart features --- src/partition/test-repart.sh | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/partition/test-repart.sh b/src/partition/test-repart.sh index 730f9cc9c3..8b1ec6c4c1 100755 --- a/src/partition/test-repart.sh +++ b/src/partition/test-repart.sh @@ -154,6 +154,57 @@ EOF cmp --bytes=41943040 --ignore-initial=0:$((512*4194264)) $D/block-copy $D/zzz +if [ `id -u` == 0 ] && type -P cryptsetup diff losetup > /dev/null ; then + echo "### Testing Format=/Encrypt=/CopyFiles=" + + # These tests require privileges unfortunately + + cat >$D/definitions/extra3.conf <$D/populated5 + + cmp $D/populated5 - < /dev/null + umount $D/mount + cryptsetup close $VOLUME + losetup -d $LOOP +else + echo "### Skipping Format=/Encrypt=/CopyFiles= test, lacking privileges or missing cryptsetup/diff/losetup" +fi + echo "### Testing json output ###" $repart $D/zzz --size=3G --dry-run=no --seed=$SEED --definitions=$D/definitions --json=help $repart $D/zzz --size=3G --dry-run=no --seed=$SEED --definitions=$D/definitions --json=pretty