From dfb3ebfd60b138eb9d02e1be71db8b376fb8bc6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 29 May 2023 20:52:33 +0200 Subject: [PATCH] TEST-58: create config files as root There is really no reason to go out of our way to create the config files as the unprivileged user. And in the logs, the runas calls are quite verbose, distracting from the interesting stuff. Also add .defs/.imgs/.root to the temporary paths to make them easier to distinguish in the logs. --- test/units/testsuite-58.sh | 187 +++++++++++++++++++++---------------- 1 file changed, 104 insertions(+), 83 deletions(-) diff --git a/test/units/testsuite-58.sh b/test/units/testsuite-58.sh index b1b40851dba..0aaf597e9ad 100755 --- a/test/units/testsuite-58.sh +++ b/test/units/testsuite-58.sh @@ -95,10 +95,11 @@ testcase_basic() { local defs imgs output local loop volume - defs="$(runas testuser mktemp --directory "/tmp/test-repart.XXXXXXXXXX")" - imgs="$(runas testuser mktemp --directory "/var/tmp/test-repart.XXXXXXXXXX")" + defs="$(mktemp --directory "/tmp/test-repart.defs.XXXXXXXXXX")" + imgs="$(runas testuser mktemp --directory "/var/tmp/test-repart.imgs.XXXXXXXXXX")" # shellcheck disable=SC2064 trap "rm -rf '$defs' '$imgs'" RETURN + chmod a+rx "$defs" # 1. create an empty image @@ -118,21 +119,21 @@ last-lba: 2097118" # 2. Testing with root, root2, home, and swap - runas testuser tee "$defs/root.conf" <"$defs/verity.openssl.cnf" <"$defs/verity.openssl.cnf" <