From 528c365658e830e91bc4182b3f7d65ad6707f653 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 25 Jun 2019 10:40:16 +0200 Subject: [PATCH] =?UTF-8?q?test:=20add=20test=20for=20DynamicUser=3D0=20?= =?UTF-8?q?=E2=86=92=20=3D1=20migration=20(and=20back)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/TEST-34-DYNAMICUSERMIGRATE/Makefile | 1 + test/TEST-34-DYNAMICUSERMIGRATE/test.sh | 48 ++++++++++++++++++++ test/TEST-34-DYNAMICUSERMIGRATE/testsuite.sh | 46 +++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 120000 test/TEST-34-DYNAMICUSERMIGRATE/Makefile create mode 100755 test/TEST-34-DYNAMICUSERMIGRATE/test.sh create mode 100755 test/TEST-34-DYNAMICUSERMIGRATE/testsuite.sh diff --git a/test/TEST-34-DYNAMICUSERMIGRATE/Makefile b/test/TEST-34-DYNAMICUSERMIGRATE/Makefile new file mode 120000 index 0000000000..e9f93b1104 --- /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 0000000000..8ef28b05f7 --- /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