From: Lennart Poettering Date: Tue, 25 Jun 2019 08:40:16 +0000 (+0200) Subject: test: add test for DynamicUser=0 → =1 migration (and back) X-Git-Tag: v243-rc1~233^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=528c365658e830e91bc4182b3f7d65ad6707f653;p=thirdparty%2Fsystemd.git test: add test for DynamicUser=0 → =1 migration (and back) --- diff --git a/test/TEST-34-DYNAMICUSERMIGRATE/Makefile b/test/TEST-34-DYNAMICUSERMIGRATE/Makefile new file mode 120000 index 00000000000..e9f93b1104c --- /dev/null +++ b/test/TEST-34-DYNAMICUSERMIGRATE/Makefile @@ -0,0 +1 @@ +../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-34-DYNAMICUSERMIGRATE/test.sh b/test/TEST-34-DYNAMICUSERMIGRATE/test.sh new file mode 100755 index 00000000000..8ef28b05f7f --- /dev/null +++ b/test/TEST-34-DYNAMICUSERMIGRATE/test.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -e +TEST_DESCRIPTION="test migrating state directory from DynamicUser=1 to DynamicUser=0 and back" + +. $TEST_BASE_DIR/test-functions + +test_setup() { + create_empty_image + mkdir -p $TESTDIR/root + mount ${LOOPDEV}p1 $TESTDIR/root + + ( + LOG_LEVEL=5 + eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) + + setup_basic_environment + + # mask some services that we do not want to run in these tests + ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service + ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service + ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service + ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket + ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service + ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service + + # setup the testsuite service + cat >$initdir/etc/systemd/system/testsuite.service < /testok + +exit 0