From: Lennart Poettering Date: Mon, 16 Dec 2019 16:32:44 +0000 (+0100) Subject: test: add repart test X-Git-Tag: v245-rc1~85^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f62a8c688091ab1ccaef0700af440d11febd6ea;p=thirdparty%2Fsystemd.git test: add repart test --- diff --git a/test/TEST-45-REPART/Makefile b/test/TEST-45-REPART/Makefile new file mode 120000 index 00000000000..e9f93b1104c --- /dev/null +++ b/test/TEST-45-REPART/Makefile @@ -0,0 +1 @@ +../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-45-REPART/test.sh b/test/TEST-45-REPART/test.sh new file mode 100755 index 00000000000..cdec7c4bdc3 --- /dev/null +++ b/test/TEST-45-REPART/test.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -e +TEST_DESCRIPTION="test systemd-repart" + +. $TEST_BASE_DIR/test-functions + +test_setup() { + create_empty_image_rootdir + + ( + LOG_LEVEL=5 + eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) + + setup_basic_environment + + mask_supporting_services + dracut_install truncate sfdisk + + # setup the testsuite service + cat >$initdir/etc/systemd/system/testsuite.service < /testok + exit 0 +fi + +systemd-analyze log-level debug + +truncate -s 1G /tmp/zzz + +SEED=e2a40bf9-73f1-4278-9160-49c031e7aef8 + +systemd-repart /tmp/zzz --empty=force --dry-run=no --seed=$SEED + +sfdisk -d /tmp/zzz > /tmp/empty + +cmp /tmp/empty - < /tmp/definitions/root.conf < /tmp/definitions/home.conf < /tmp/definitions/swap.conf < /tmp/populated + +cmp /tmp/populated - < /tmp/definitions/swap.conf < /tmp/definitions/extra.conf < /tmp/populated2 + +cmp /tmp/populated2 - < /tmp/populated3 + +cmp /tmp/populated3 - < /testok + +exit 0