From e29e4d5742638fc907868bc553efb2e32275dcc9 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 20 Mar 2020 20:22:42 +0100 Subject: test: convert TEST-45 to a normal meson test On my laptop, it now takes 0.23 s. We don't need the overhead of creating an image and spawning a machine to mangle a file in /tmp. --- src/partition/test-repart.sh | 111 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100755 src/partition/test-repart.sh (limited to 'src/partition/test-repart.sh') diff --git a/src/partition/test-repart.sh b/src/partition/test-repart.sh new file mode 100755 index 0000000000..7da6b1b027 --- /dev/null +++ b/src/partition/test-repart.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash +set -ex + +repart=$1 +test -x $repart + +D=$(mktemp --directory) +trap "rm -rf '$D'" EXIT INT QUIT PIPE +mkdir -p $D/definitions + +truncate -s 1G $D/zzz + +SEED=e2a40bf9-73f1-4278-9160-49c031e7aef8 + +$repart $D/zzz --empty=force --dry-run=no --seed=$SEED + +sfdisk -d $D/zzz | grep -v -e 'sector-size' -e '^$' > $D/empty + +cmp $D/empty - <$D/definitions/root.conf <$D/definitions/home.conf < $D/definitions/swap.conf <$D/populated + +cmp $D/populated - <$D/definitions/swap.conf <$D/definitions/extra.conf <$D/populated2 + +cmp $D/populated2 - <$D/populated3 + +cmp $D/populated3 - <