From eac3dd265a4dc5fc5d76529e7de10f93b5f76406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 17 Apr 2023 14:23:09 +0200 Subject: [PATCH] Test: simplify SRC_DIR extraction in run-unit-tests.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `spectool`, instead of `rpmdev-spectool`, because it is available only on c9s and el9 and the intention was to keep tests implementation the same across all distributions and their versions. This makes the test case identical to c8s / el8. In addition, the output from the tool differs on c8s and c9s, therefore simplify the extraction of the SRC_DIR using only one sed command, which produces the desired output on c8s and c9s. Related: rhbz#2174847 Signed-off-by: Tomáš Hozza --- tests/unit-tests/run-unit-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit-tests/run-unit-tests.sh b/tests/unit-tests/run-unit-tests.sh index 34860b2..4112c23 100755 --- a/tests/unit-tests/run-unit-tests.sh +++ b/tests/unit-tests/run-unit-tests.sh @@ -71,8 +71,7 @@ fi ${PKG_MAINT_TOOL} ${PKG_MAINT_TOOL_EXTRA_ARGS} prep # Extract the Source0 basename without extension -SRC_DIR=$(rpmdev-spectool --source 0 osbuild.spec | awk '{print $2}' | sed 's/.tar.gz//') -SRC_DIR="${SRC_DIR##*/}" +SRC_DIR=$(spectool --source 0 osbuild.spec | sed 's/.\+\(osbuild-[0-9]\+\)\.tar\.gz/\1/') cd "${SRC_DIR}"