toolbox/toolbox-Unbreak-downstream-Fedora-CI.patch
Debarshi Ray e4c38fd245 Update 0.0.99.6
Update the compiler and linker flags for RHEL 9 by keeping '-trimpath'.
Switch to using the GO_BUILDTAGS and GO_LDFLAGS environment variables,
because their unprefixed counterparts have been deprecated [1].

The 'rpminspect --tests=elf' test run by the downstream CI was silenced
because toolbox(1) is only built with the '-z relro' linker flag, but
not '-z now' [2].  Otherwise, it fails with:
  /usr/bin/toolbox lost full GNU_RELRO security protection

Stop carrying the downstream patch for the compiler and linker flags for
PPC64.  The architecture was already discontinued from Fedora 29 [3],
even before the patch was added [4].  It was added purely for the sake
of completeness, and in the last four years since it was introduced, it
hasn't been tested or used.  At this point it's becoming too much of a
maintenance burden, and removing it silences the %ifarch-applied-patch
warning from rpmlint.

Fill in some of the missing Requires for the toolbox-tests sub-package.

[1] go-rpm-macros commit bc7e5cc55c4709e8
    https://pagure.io/go-rpm-macros/c/bc7e5cc55c4709e8

[2] Upstream commit 83f28c52e47c2d44
    https://github.com/containers/toolbox/commit/83f28c52e47c2d44
    https://github.com/containers/toolbox/pull/1548

[3] https://fedoraproject.org/wiki/Changes/DiscontinuePPC64

[4] Fedora toolbox commit ba60453d21
    https://src.fedoraproject.org/rpms/toolbox/c/ba60453d216a9226
    https://src.fedoraproject.org/rpms/toolbox/pull-request/2

Resolves: RHEL-61578
2024-10-07 03:02:19 +02:00

105 lines
2.7 KiB
Diff

From 1e90c721858b3119702b93445f535f9c23af88e6 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
Date: Wed, 2 Oct 2024 22:43:37 +0200
Subject: [PATCH] test/system: Unbreak the downstream Fedora CI
The working directory from which bats(1) is invoked might not be part of
the Toolbx container. eg., the downstream Fedora CI invokes the tests
as:
$ cd /path/to/toolbox/test/system
$ bats .
... and it led to:
not ok 8 help: Try unknown command (forwarded to host)
# tags: commands-options
# (from function `assert_line' in file
./libs/bats-assert/src/assert.bash, line 488,
# in test file ./002-help.bats, line 135)
# `assert_line --index 0
"Error: unknown command \"foo\" for \"toolbox\""' failed
#
# -- line differs --
# index : 0
# expected : Error: unknown command "foo" for "toolbox"
# actual : Error: crun: chdir to `/usr/share/toolbox/test/system`:
No such file or directory: OCI runtime attempted to invoke a
command that was not found
# --
#
https://github.com/containers/toolbox/pull/1560
---
test/system/002-help.bats | 2 ++
test/system/501-create.bats | 2 ++
test/system/504-run.bats | 2 ++
test/system/505-enter.bats | 2 ++
4 files changed, 8 insertions(+)
diff --git a/test/system/002-help.bats b/test/system/002-help.bats
index 57e918a04d22..a8bfbc2c79d2 100644
--- a/test/system/002-help.bats
+++ b/test/system/002-help.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.10.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/501-create.bats b/test/system/501-create.bats
index 3f50f98e6bf3..cfb676b7001b 100644
--- a/test/system/501-create.bats
+++ b/test/system/501-create.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/504-run.bats b/test/system/504-run.bats
index cc5f6fa8bb09..6ee3e86af1ff 100644
--- a/test/system/504-run.bats
+++ b/test/system/504-run.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
diff --git a/test/system/505-enter.bats b/test/system/505-enter.bats
index 405d184f145e..57e58651623d 100644
--- a/test/system/505-enter.bats
+++ b/test/system/505-enter.bats
@@ -25,9 +25,11 @@ setup() {
bats_require_minimum_version 1.8.0
_setup_environment
cleanup_all
+ pushd "$HOME" || return 1
}
teardown() {
+ popd || return 1
cleanup_all
}
--
2.46.1