From 8f243d2ab13a0d185e9bc7bbd2d1984731e353fd Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Thu, 15 Jun 2023 13:17:19 +0800 Subject: [PATCH] tests: generate correct RPM name Tests failed to run against Fedora 37 or newer cloud images because of the following error, It's a image with multiple partitions, using last partition as main partition 'xxx/tests/build/x86_64/kexec-tools-2.0.26-5.fc37.src.rpm' not found /dev/nbd0 disconnected make: *** [Makefile:73: xxx/tests/output/test-base-image] Error 1 This is because starting with Fedora 37, rpm changes its API, # Fedora >= 37 $ rpm -q --specfile kexec-tools.spec kexec-tools-2.0.26-5.fc37.src # Fedora 36 $ rpm -q --specfile kexec-tools.spec kexec-tools-2.0.26-5.fc36 The tests depends on rpm to generate correct RPM name. Fix this issue by removing the trailing .src from the output of "rpm -q --specfile". Reviewed-by: Philipp Rudo Signed-off-by: Coiby Xu --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 05fda1d..45688ca 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -30,7 +30,7 @@ RPMDEFINE = --define '_sourcedir $(REPO)'\ KEXEC_TOOLS_SRC = $(filter-out $(REPO)/tests,$(wildcard $(REPO)/*)) KEXEC_TOOLS_TEST_SRC = $(wildcard $(REPO)/tests/scripts/**/*) -KEXEC_TOOLS_NVR = $(shell rpm $(RPMDEFINE) -q --specfile $(REPO)/$(SPEC) 2>/dev/null | grep -m 1 .) +KEXEC_TOOLS_NVR = $(shell rpm $(RPMDEFINE) -q --specfile $(REPO)/$(SPEC) 2>/dev/null | grep -m 1 . | sed -e 's#.src#.$(ARCH)#') KEXEC_TOOLS_RPM = $(BUILD_ROOT)/$(ARCH)/$(KEXEC_TOOLS_NVR).rpm all: $(TEST_ROOT)/output/test-base-image