From: Frantisek Sumsal Date: Fri, 8 Dec 2023 17:38:41 +0000 (+0100) Subject: test: backup /etc/udev/udev.conf only if it exists X-Git-Tag: v256-rc1~1543^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e23fc070e287397d2f047028f953986356badf2f;p=thirdparty%2Fsystemd.git test: backup /etc/udev/udev.conf only if it exists On Fedora systemd recently moved all of its configuration files to /usr/lib/ [0], so make sure we account for this case as well. [ 42.450325] testsuite-17.sh[800]: + mkdir -p /run/udev/rules.d [ 42.466504] testsuite-17.sh[800]: + cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp [ 42.503348] testsuite-17.sh[802]: cp: cannot stat '/etc/udev/udev.conf': No such file or directory [0] https://src.fedoraproject.org/rpms/systemd/c/29eb35530b29232eed65718d0cd96d67cd7ffd6b?branch=rawhide --- diff --git a/test/units/testsuite-17.03.sh b/test/units/testsuite-17.03.sh index fafe9d186cf..9af706fae16 100755 --- a/test/units/testsuite-17.03.sh +++ b/test/units/testsuite-17.03.sh @@ -2,17 +2,18 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -ex -test_rule="/run/udev/rules.d/49-test.rules" +TEST_RULE="/run/udev/rules.d/49-test.rules" KILL_PID= setup() { - mkdir -p "${test_rule%/*}" - cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp - cat >"${test_rule}" <"${TEST_RULE}" <>/etc/udev/udev.conf </etc/udev/udev.conf <