From 2f62a8c688091ab1ccaef0700af440d11febd6ea Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 16 Dec 2019 17:32:44 +0100 Subject: [PATCH] test: add repart test --- test/TEST-45-REPART/Makefile | 1 + test/TEST-45-REPART/test.sh | 37 +++++++++ test/TEST-45-REPART/testsuite.sh | 124 +++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 120000 test/TEST-45-REPART/Makefile create mode 100755 test/TEST-45-REPART/test.sh create mode 100755 test/TEST-45-REPART/testsuite.sh 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 -- 2.47.3