diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 8751077..2625054 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,8 @@ /toolbox-0.0.99.4-vendored.tar.xz /toolbox-0.0.99.5-vendored.tar.xz /toolbox-0.0.99.6-vendored.tar.xz +/toolbox-0.1.0-vendored.tar.xz +/toolbox-0.1.1-vendored.tar.xz +/toolbox-0.1.2-vendored.tar.xz +/toolbox-0.2-vendored.tar.xz +/toolbox-0.3-vendored.tar.xz diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..e6427de --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,4 @@ +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index a7670e1..f30b3d7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.99.6-vendored.tar.xz) = 9ecec200069e8e2536e5ece43d411f9025dba6f60573e7939a0fc26deef29f0297d405a44fd409e978879b0579ab0a79ace97228a199584854c638213fa219d7 +SHA512 (toolbox-0.3-vendored.tar.xz) = e464aba1c40b37b0ed027a560a0685e5dc8f07684d33d0e2bac5f0ba8c2b2c2a4c585db8847b23bd0753e33d37e3e88c87ab71d3999c3afedf315717f468c0ba diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..25a6fe7 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,12 @@ +environment: + ROOTLESS_USER: "fedora" + TMPDIR: /var/tmp +require: + - toolbox-tests + +/rootless: + summary: rootless test + test: | + rpm --erase p11-kit-server + bash ./rootless-test.sh + duration: 4h diff --git a/tests/roles/nonroot_user/tasks/main.yml b/tests/roles/nonroot_user/tasks/main.yml deleted file mode 100644 index 51bf44a..0000000 --- a/tests/roles/nonroot_user/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: create nonroot user - user: - name: testuser - shell: /bin/bash -- name: enable linger - command: loginctl enable-linger testuser diff --git a/tests/roles/run_bats_tests/files/run_bats_tests.sh b/tests/roles/run_bats_tests/files/run_bats_tests.sh deleted file mode 100755 index e9f5f5f..0000000 --- a/tests/roles/run_bats_tests/files/run_bats_tests.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# Run bats tests for a given $TEST_PACKAGE, e.g. buildah, podman -# -# This is invoked by the 'run_bats_tests' role; we assume that -# the package foo has a foo-tests subpackage which provides the -# directory /usr/share/foo/test/system, containing one or more .bats -# test files. -# - -export PATH=/usr/local/bin:/usr/sbin:/usr/bin - -FULL_LOG=/tmp/test.debug.log -BATS_LOG=/tmp/test.bats.log -rm -f $FULL_LOG $BATS_LOG -touch $FULL_LOG $BATS_LOG - -exec &> $FULL_LOG - -# Log program versions -echo "Packages:" -rpm -q ${TEST_PACKAGE} ${TEST_PACKAGE}-tests - -echo "------------------------------" -printenv | sort - -testdir=/usr/share/${TEST_PACKAGE}/test/system - -if ! cd $testdir; then - echo "FAIL ${TEST_NAME} : cd $testdir" >> /tmp/test.log - exit 0 -fi - -if [ -e /tmp/helper.sh ]; then - echo "------------------------------" - echo ". /tmp/helper.sh" - . /tmp/helper.sh -fi - -if [ "$(type -t setup)" = "function" ]; then - echo "------------------------------" - echo "\$ setup" - setup - if [ $? -ne 0 ]; then - echo "FAIL ${TEST_NAME} : setup" >> /tmp/test.log - exit 0 - fi -fi - -echo "------------------------------" -echo "\$ bats ." -bats . &> $BATS_LOG -rc=$? - -echo "------------------------------" -echo "bats completed with status $rc" - -status=PASS -if [ $rc -ne 0 ]; then - status=FAIL -fi - -echo "${status} ${TEST_NAME}" >> /tmp/test.log - -if [ "$(type -t teardown)" = "function" ]; then - echo "------------------------------" - echo "\$ teardown" - teardown -fi - -# FIXME: for CI purposes, always exit 0. This allows subsequent tests. -exit 0 diff --git a/tests/roles/run_bats_tests/tasks/main.yml b/tests/roles/run_bats_tests/tasks/main.yml deleted file mode 100644 index adc72f2..0000000 --- a/tests/roles/run_bats_tests/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# Create empty results file, world-writable -- name: initialize test.log file - copy: dest=/tmp/test.log content='' force=yes mode=0666 - -- name: execute tests - include_tasks: run_one_test.yml - with_items: "{{ tests }}" - loop_control: - loop_var: test - -- name: pull test.log results - fetch: - src: "/tmp/test.log" - dest: "{{ artifacts }}/test.log" - flat: yes - -# Copied from standard-test-basic -- name: check results - shell: grep "^FAIL" /tmp/test.log - register: test_fails - # Never fail at this step. Just store result of tests. - failed_when: False - -- name: preserve results - set_fact: - role_result_failed: "{{ (test_fails.stdout|d|length > 0) or (test_fails.stderr|d|length > 0) }}" - role_result_msg: "{{ test_fails.stdout|d('tests failed.') }}" - -- name: display results - vars: - msg: | - Tests failed: {{ role_result_failed|d('Undefined') }} - Tests msg: {{ role_result_msg|d('None') }} - debug: - msg: "{{ msg.split('\n') }}" - failed_when: "role_result_failed|bool" diff --git a/tests/roles/run_bats_tests/tasks/run_one_test.yml b/tests/roles/run_bats_tests/tasks/run_one_test.yml deleted file mode 100644 index bf45754..0000000 --- a/tests/roles/run_bats_tests/tasks/run_one_test.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- name: "{{ test.name }} | install test packages" - dnf: name="{{ test.package }}-tests" state=installed - -- name: "{{ test.name }} | define helper variables" - set_fact: - test_name_oneword: "{{ test.name | replace(' ','-') }}" - -# UGH. This is necessary because our caller sets some environment variables -# and we need to set a few more based on other caller variables; then we -# need to combine the two dicts when running the test. This seems to be -# the only way to do it in ansible. -- name: "{{ test.name }} | define local environment" - set_fact: - local_environment: - TEST_NAME: "{{ test.name }}" - TEST_PACKAGE: "{{ test.package }}" - TMPDIR: "/var/tmp" - -- name: "{{ test.name }} | setup/teardown helper | see if exists" - local_action: stat path={{ role_path }}/files/helper.{{ test_name_oneword }}.sh - register: helper - -- name: "{{ test.name }} | setup/teardown helper | install" - copy: src=helper.{{ test_name_oneword }}.sh dest=/tmp/helper.sh - when: helper.stat.exists - -- name: "{{ test.name }} | run test" - script: ./run_bats_tests.sh - args: - chdir: /usr/share/{{ test.package }}/test/system - become: "{{ true if test.become is defined else false }}" - become_user: testuser - environment: "{{ local_environment }}" - -- name: "{{ test.name }} | pull logs" - fetch: - src: "/tmp/test.{{ item }}.log" - dest: "{{ artifacts }}/test.{{ test_name_oneword }}.{{ item }}.log" - flat: yes - with_items: - - bats - - debug - -- name: "{{ test.name }} | remove remote logs and helpers" - file: - dest=/tmp/{{ item }} - state=absent - with_items: - - test.bats.log - - test.debug.log - - helper.sh diff --git a/tests/rootless-test.sh b/tests/rootless-test.sh new file mode 100644 index 0000000..16da9fe --- /dev/null +++ b/tests/rootless-test.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -exo pipefail + +uname -r + +loginctl enable-linger "$ROOTLESS_USER" + +rpm -q containers-common-extra podman toolbox + +su --whitelist-environment=$(cat ./tmt-envvars | tr '\n' ',') - "$ROOTLESS_USER" -c "whoami && cd /usr/share/toolbox/test/system && bats ." diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index e7ff188..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- hosts: localhost - tags: classic - vars: - - artifacts: ./artifacts - roles: - - role: nonroot_user - - role: run_bats_tests - tests: - - name: toolbox - package: toolbox - become: true diff --git a/tests/tmt-envvars b/tests/tmt-envvars new file mode 100644 index 0000000..6f3176e --- /dev/null +++ b/tests/tmt-envvars @@ -0,0 +1 @@ +TMPDIR diff --git a/toolbox-Add-migration-paths-for-coreos-toolbox-users.patch b/toolbox-Add-migration-paths-for-coreos-toolbox-users.patch index 9f470cd..aec1779 100644 --- a/toolbox-Add-migration-paths-for-coreos-toolbox-users.patch +++ b/toolbox-Add-migration-paths-for-coreos-toolbox-users.patch @@ -1,4 +1,4 @@ -From c25ad44b7cb50d470b1533931b7808cc194f0d50 Mon Sep 17 00:00:00 2001 +From 4649e50c28321185cbaa81a37efbd317b84ae840 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 18 Aug 2021 17:55:21 +0200 Subject: [PATCH 1/2] cmd/run: Make sosreport work by setting the HOST @@ -10,10 +10,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1940037 1 file changed, 1 insertion(+) diff --git a/src/cmd/run.go b/src/cmd/run.go -index 719c0d6abb20..92a097283f38 100644 +index ceb277a3640a..72b673f506b3 100644 --- a/src/cmd/run.go +++ b/src/cmd/run.go -@@ -566,6 +566,7 @@ func constructExecArgs(container, preserveFDs string, +@@ -576,6 +576,7 @@ func constructExecArgs(container, preserveFDs string, execArgs = append(execArgs, envOptions...) execArgs = append(execArgs, []string{ @@ -22,10 +22,10 @@ index 719c0d6abb20..92a097283f38 100644 "--preserve-fds", preserveFDs, }...) -- -2.46.1 +2.51.0 -From e7877a4d1d38dc35aa6da6c012ec9a23397b7aa4 Mon Sep 17 00:00:00 2001 +From b2ba8445bee988143d546bc15fa3a8a8c019aa2e Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 10 Dec 2021 13:42:15 +0100 Subject: [PATCH 2/2] test/system: Update to test the migration path for @@ -42,10 +42,10 @@ ca899c8a561f357ae32c6ba6813520fd8b682abb and the parts of commit create mode 100644 test/system/100-root.bats diff --git a/test/system/002-help.bats b/test/system/002-help.bats -index a8bfbc2c79d2..5dd14025ea0b 100644 +index f7cd3f5480ab..7ad5f72e792f 100644 --- a/test/system/002-help.bats +++ b/test/system/002-help.bats -@@ -33,20 +33,6 @@ teardown() { +@@ -33,20 +33,6 @@ teardown_file() { cleanup_all } @@ -100,5 +100,5 @@ index 000000000000..cf35d60ac25c + skip "Testing of entering toolboxes is not implemented" +} -- -2.46.1 +2.51.0 diff --git a/toolbox-Make-the-build-flags-match-Fedora.patch b/toolbox-Make-the-build-flags-match-Fedora.patch index 27fd99d..5ee5fd4 100644 --- a/toolbox-Make-the-build-flags-match-Fedora.patch +++ b/toolbox-Make-the-build-flags-match-Fedora.patch @@ -1,11 +1,26 @@ -From 7dc70160c8ff531473004e879dd57ec303789d71 Mon Sep 17 00:00:00 2001 +From a1bb7d53fab70899c991feb9276cf93a12280750 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuildflags} +These reflect the defaults for Fedora 39, which is the oldest supported +Fedora, barring some exceptions mentioned below. + +The change to use the RPM's %{name}, %{version}, %{release} and the +SOURCE_DATE_EPOCH environment variable [1], instead of /dev/urandom, to +generate the build ID annotation for the toolbox(1) binary [2] was left +out. It will need more work to propagate the RPM's %{name}, %{version} +and %{release} to Meson. + Note that these flags are meant for every CPU architecture other than PPC64, and should be kept updated to match Fedora's Go guidelines. Use 'rpm --eval "%{gobuildflags}"' to expand the %{gobuildflags} macro. + +[1] https://reproducible-builds.org/docs/source-date-epoch/ + +[2] go-rpm-macros commit 1980932bf3a21890 + https://pagure.io/go-rpm-macros/c/1980932bf3a21890 + https://fedoraproject.org/wiki/Changes/ReproduciblePackageBuilds --- src/go-build-wrapper | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) @@ -43,5 +58,5 @@ index a5a1a6a508fb..5978422e9aed 100755 exit "$?" -- -2.46.1 +2.51.0 diff --git a/toolbox-Make-the-build-flags-match-RHEL-10.patch b/toolbox-Make-the-build-flags-match-RHEL-10.patch index e43e0eb..9528088 100644 --- a/toolbox-Make-the-build-flags-match-RHEL-10.patch +++ b/toolbox-Make-the-build-flags-match-RHEL-10.patch @@ -1,4 +1,4 @@ -From f08f64c0d5f2019055381c3c00426fe8545e5e31 Mon Sep 17 00:00:00 2001 +From f79f96fb8f3ec528952b9719f356e871837987df Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match RHEL 10's %{gobuildflags} @@ -67,5 +67,5 @@ index a5a1a6a508fb..5978422e9aed 100755 exit "$?" -- -2.46.1 +2.51.0 diff --git a/toolbox-Make-the-build-flags-match-RHEL-9.patch b/toolbox-Make-the-build-flags-match-RHEL-9.patch index 2c15142..492268a 100644 --- a/toolbox-Make-the-build-flags-match-RHEL-9.patch +++ b/toolbox-Make-the-build-flags-match-RHEL-9.patch @@ -1,4 +1,4 @@ -From ff1320fa869f1e4952836436ab2ad928cbba0987 Mon Sep 17 00:00:00 2001 +From 2d1b4b2492c65abd0d0bf0c71c971f550447412d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match RHEL 9's %{gobuildflags} @@ -46,5 +46,5 @@ index a5a1a6a508fb..0a2c7526f210 100755 exit "$?" -- -2.46.1 +2.51.0 diff --git a/toolbox-Revert-Work-around-bug-in-past.patch b/toolbox-Revert-Work-around-bug-in-past.patch deleted file mode 100644 index 5597a9f..0000000 --- a/toolbox-Revert-Work-around-bug-in-past.patch +++ /dev/null @@ -1,81 +0,0 @@ -From ed14cd483ae45c5f4cf5596b11c384f4b42bb53b Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Fri, 4 Oct 2024 22:09:03 +0200 -Subject: [PATCH] Revert "playbooks, test/system: Work around bug in pasta(1) - networks" - -The bug in pasta(1) that necessitated this workaround has since been -fixed in passt 2024_05_10.7288448 [1]. Some host operating systems like -CentOS Stream 10 no longer have slirp4netns(1), and it's generally -better to test the defaults. - -This reverts commit b58f9a51088afbfc22edb0b25776cfa2c4d8cc40. - -[1] https://github.com/containers/podman/issues/22575 - https://archives.passt.top/passt-dev/20240508090338.2735208-1-sbrivio@redhat.com/ - https://archives.passt.top/passt-user/20240510225714.6aa8e6c0@elisabeth/ - -https://github.com/containers/toolbox/pull/1562 ---- - playbooks/dependencies-centos-9-stream.yaml | 3 +-- - playbooks/dependencies-fedora.yaml | 3 +-- - test/system/libs/helpers.bash | 1 - - 3 files changed, 2 insertions(+), 5 deletions(-) - -diff --git a/playbooks/dependencies-centos-9-stream.yaml b/playbooks/dependencies-centos-9-stream.yaml -index 5c1194c03583..d058d314b7b3 100644 ---- a/playbooks/dependencies-centos-9-stream.yaml -+++ b/playbooks/dependencies-centos-9-stream.yaml -@@ -13,7 +13,6 @@ - - podman - - shadow-utils-subid-devel - - skopeo -- - slirp4netns - - systemd - - udisks2 - -@@ -55,7 +54,7 @@ - chdir: '{{ zuul.project.src_dir }}' - - - name: Check versions of crucial packages -- command: rpm -qa ShellCheck bats codespell *kernel* gcc *glibc* golang golang-github-cpuguy83-md2man shadow-utils-subid-devel podman conmon containernetworking-plugins containers-common container-selinux crun fuse-overlayfs flatpak-session-helper skopeo slirp4netns -+ command: rpm -qa ShellCheck bats codespell *kernel* gcc *glibc* golang golang-github-cpuguy83-md2man shadow-utils-subid-devel podman conmon containernetworking-plugins containers-common container-selinux crun fuse-overlayfs flatpak-session-helper skopeo - - - name: Show podman versions - command: podman version -diff --git a/playbooks/dependencies-fedora.yaml b/playbooks/dependencies-fedora.yaml -index ea605135a4c2..8007ce958ddb 100644 ---- a/playbooks/dependencies-fedora.yaml -+++ b/playbooks/dependencies-fedora.yaml -@@ -35,7 +35,6 @@ - - podman - - shadow-utils-subid-devel - - skopeo -- - slirp4netns - - systemd - - udisks2 - use: "{{ 'dnf' if zuul.attempts > 1 else 'auto' }}" -@@ -56,7 +55,7 @@ - chdir: '{{ zuul.project.src_dir }}' - - - name: Check versions of crucial packages -- command: rpm -qa ShellCheck bash bats codespell *kernel* gcc *glibc* shadow-utils-subid-devel golang golang-github-cpuguy83-md2man podman conmon containernetworking-plugins containers-common container-selinux crun fuse-overlayfs flatpak-session-helper skopeo slirp4netns -+ command: rpm -qa ShellCheck bash bats codespell *kernel* gcc *glibc* shadow-utils-subid-devel golang golang-github-cpuguy83-md2man podman conmon containernetworking-plugins containers-common container-selinux crun fuse-overlayfs flatpak-session-helper skopeo - - - name: Show podman versions - command: podman version -diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash -index dfd6236c2943..2d05641f5d0a 100644 ---- a/test/system/libs/helpers.bash -+++ b/test/system/libs/helpers.bash -@@ -195,7 +195,6 @@ function _setup_docker_registry() { - --env REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - --env REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - --name "${DOCKER_REG_NAME}" \ -- --network slirp4netns \ - --privileged \ - --publish 50000:5000 \ - --rm \ --- -2.46.1 - diff --git a/toolbox-Unbreak-downstream-Fedora-CI.patch b/toolbox-Unbreak-downstream-Fedora-CI.patch deleted file mode 100644 index b743f2d..0000000 --- a/toolbox-Unbreak-downstream-Fedora-CI.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 1e90c721858b3119702b93445f535f9c23af88e6 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -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 - diff --git a/toolbox-Update-fallback-release-to-40-for-non-fedo.patch b/toolbox-Update-fallback-release-to-40-for-non-fedo.patch deleted file mode 100644 index 7bad62f..0000000 --- a/toolbox-Update-fallback-release-to-40-for-non-fedo.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b524f4cebd8c65746089f898e14a99c7cfded306 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Thu, 3 Oct 2024 22:08:04 +0200 -Subject: [PATCH] pkg/utils: Update fallback release to 40 for non-fedora hosts - -Fedora 38 reached End of Life on 21st May 2024: -https://docs.fedoraproject.org/en-US/releases/eol/ - -https://bugzilla.redhat.com/show_bug.cgi?id=2316312 -https://github.com/containers/toolbox/pull/1561 ---- - src/pkg/utils/utils.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go -index eefcd1eeb2cc..37a49fedf772 100644 ---- a/src/pkg/utils/utils.go -+++ b/src/pkg/utils/utils.go -@@ -64,7 +64,7 @@ const ( - containerNamePrefixFallback = "fedora-toolbox" - distroFallback = "fedora" - idTruncLength = 12 -- releaseFallback = "38" -+ releaseFallback = "40" - ) - - const ( --- -2.46.1 - diff --git a/toolbox.rpmlintrc b/toolbox.rpmlintrc new file mode 100644 index 0000000..150b710 --- /dev/null +++ b/toolbox.rpmlintrc @@ -0,0 +1 @@ +addFilter(r'no-%check-section') diff --git a/toolbox.spec b/toolbox.spec index a58d522..09e3785 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,7 +1,16 @@ %global __brp_check_rpaths %{nil} +%if 0%{?rhel} +%if 0%{?rhel} <= 9 +%{!?bash_completions_dir: %global bash_completions_dir %{_datadir}/bash-completion/completions} +%{!?fish_completions_dir: %global fish_completions_dir %{_datadir}/fish/vendor_completions.d} +%{!?zsh_completions_dir: %global zsh_completions_dir %{_datadir}/zsh/site-functions} +%endif +%endif + + Name: toolbox -Version: 0.0.99.6 +Version: 0.3 %global goipath github.com/containers/%{name} @@ -17,10 +26,10 @@ Version: 0.0.99.6 %endif %endif -%global toolbx_go 1.20 +%global toolbx_go 1.22 %if 0%{?fedora} -%global toolbx_go 1.20 +%global toolbx_go 1.24.7 %endif %if 0%{?rhel} @@ -29,25 +38,20 @@ Version: 0.0.99.6 %elif 0%{?rhel} == 10 %global toolbx_go 1.22.5 %elif 0%{?rhel} > 10 -%global toolbx_go 1.23.1 +%global toolbx_go 1.24.4 %endif %endif -Release: 5%{?dist} +Release: 2%{?dist} Summary: Tool for interactive command line environments on Linux -License: ASL 2.0 +License: Apache-2.0 URL: https://containertoolbx.org/ Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}-vendored.tar.xz # RHEL specific Source1: %{name}.conf -# Upstream -Patch0: toolbox-Unbreak-downstream-Fedora-CI.patch -Patch1: toolbox-Update-fallback-release-to-40-for-non-fedo.patch -Patch2: toolbox-Revert-Work-around-bug-in-past.patch - # Fedora specific Patch100: toolbox-Make-the-build-flags-match-Fedora.patch @@ -61,43 +65,26 @@ BuildRequires: go-md2man BuildRequires: golang >= %{toolbx_go} BuildRequires: meson >= 0.58.0 BuildRequires: pkgconfig(bash-completion) -BuildRequires: shadow-utils-subid-devel +BuildRequires: shadow-utils-subid-devel >= 4.16.0 BuildRequires: systemd BuildRequires: systemd-rpm-macros %if ! 0%{?rhel} -BuildRequires: golang(github.com/HarryMichal/go-version) >= 1.0.1 -BuildRequires: golang-ipath(github.com/NVIDIA/go-nvlib) >= 0.6.1 -BuildRequires: golang-ipath(github.com/NVIDIA/go-nvml) >= 0.12.4.0 -BuildRequires: golang-ipath(github.com/NVIDIA/nvidia-container-toolkit) >= 1.16.1 -BuildRequires: golang(github.com/acobaugh/osrelease) >= 0.1.0 -BuildRequires: golang(github.com/briandowns/spinner) >= 1.18.0 -BuildRequires: golang(github.com/docker/go-units) >= 0.5.0 -BuildRequires: golang(github.com/fsnotify/fsnotify) >= 1.7.0 -BuildRequires: golang(github.com/go-logfmt/logfmt) >= 0.5.0 -BuildRequires: golang(github.com/godbus/dbus) >= 5.0.6 -BuildRequires: golang(github.com/google/renameio/v2) >= 2.0.0 -BuildRequires: golang(github.com/sirupsen/logrus) >= 1.9.3 -BuildRequires: golang(github.com/spf13/cobra) >= 1.3.0 -BuildRequires: golang(github.com/spf13/viper) >= 1.10.1 -BuildRequires: golang-ipath(golang.org/x/sys) >= 0.22.0 -BuildRequires: golang(golang.org/x/text) >= 0.3.8 -BuildRequires: golang-ipath(gopkg.in/yaml.v3) >= 3.0.1 -BuildRequires: golang-ipath(tags.cncf.io/container-device-interface) >= 0.8.0 BuildRequires: pkgconfig(fish) # for tests # BuildRequires: codespell -# BuildRequires: golang(github.com/stretchr/testify) >= 1.9.0 # BuildRequires: ShellCheck %endif +Recommends: p11-kit-server Recommends: skopeo +%if ! 0%{?rhel} +Recommends: fuse-overlayfs +%endif Requires: containers-common -Requires: podman >= 1.6.4 -Requires: shadow-utils-subid%{?_isa} -%if ! 0%{?rhel} Requires: flatpak-session-helper -%endif +Requires: podman >= 1.6.4 +Requires: shadow-utils-subid%{?_isa} >= 4.16.0 %description @@ -111,82 +98,6 @@ Wayland and X11 sockets, networking (including Avahi), removable devices (like USB sticks), systemd journal, SSH agent, D-Bus, ulimits, /dev and the udev database, etc.. -%if ! 0%{?rhel} - -# The list of requires packages for -support and -experience should be in sync with: -# https://github.com/containers/toolbox/blob/master/images/fedora/f33/extra-packages -%package support -Summary: Required packages for the container image to support %{name} - -# These are really required to make the image work with toolbox -Requires: passwd -Requires: shadow-utils -Requires: util-linux -Requires: vte-profile - -%description support -The %{name}-support package contains all the required packages that are needed -to be installed in the OCI image to make it work with %{name}. - -The %{name}-support package should be typically installed from the Dockerfile -if the image isn't based on the fedora-toolbox image. - - -%package experience -Summary: Set of packages to enhance the %{name} experience - -Requires: %{name}-support = %{version}-%{release} -Requires: bash-completion -Requires: bc -Requires: bzip2 -Requires: diffutils -Requires: dnf-plugins-core -Requires: findutils -Requires: flatpak-spawn -Requires: fpaste -Requires: git -Requires: gnupg -Requires: gnupg2-smime -Requires: gvfs-client -Requires: hostname -Requires: iproute -Requires: iputils -Requires: jwhois -Requires: keyutils -Requires: krb5-libs -Requires: less -Requires: lsof -Requires: man-db -Requires: man-pages -Requires: mtr -Requires: nano-default-editor -Requires: nss-mdns -Requires: openssh-clients -Requires: pigz -Requires: procps-ng -Requires: rsync -Requires: sudo -Requires: tcpdump -Requires: time -Requires: traceroute -Requires: tree -Requires: unzip -Requires: wget -Requires: which -Requires: words -Requires: xorg-x11-xauth -Requires: xz -Requires: zip - -%description experience -The %{name}-experience package contains all the packages that should be -installed in the container to provide the same default experience as working -on the host. - -The %{name}-experience package should be typically installed from the -Dockerfile if the image isn't based on the fedora-toolbox image. - -%endif %package tests Summary: Tests for %{name} @@ -206,15 +117,13 @@ Requires: skopeo Requires: bats >= 1.10.0 %endif + %description tests The %{name}-tests package contains system tests for %{name}. %prep %setup -q -%patch -P0 -p1 -%patch -P1 -p1 -%patch -P2 -p1 %if 0%{?fedora} %patch -P100 -p1 @@ -234,24 +143,22 @@ The %{name}-tests package contains system tests for %{name}. %endif %endif -%gomkdir -s %{_builddir}/%{extractdir}/src %{?rhel:-k} +%gomkdir -s %{_builddir}/%{extractdir}/src -k %build -export %{gomodulesmode} -export GOPATH=%{gobuilddir}:%{gopath} export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" %meson \ %if 0%{?rhel} - -Dfish_completions_dir=%{_datadir}/fish/vendor_completions.d \ + -Dfish_completions_dir=%{fish_completions_dir} \ %if 0%{?rhel} <= 9 -Dmigration_path_for_coreos_toolbox=true \ %endif %endif -Dprofile_dir=%{_sysconfdir}/profile.d \ -Dtmpfiles_dir=%{_tmpfilesdir} \ - -Dzsh_completions_dir=%{_datadir}/zsh/site-functions + -Dzsh_completions_dir=%{zsh_completions_dir} %meson_build @@ -272,31 +179,58 @@ install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf %files %doc CODE-OF-CONDUCT.md CONTRIBUTING.md GOALS.md NEWS README.md SECURITY.md -%license COPYING %{?rhel:src/vendor/modules.txt} +%license COPYING src/vendor/modules.txt %{_bindir}/%{name} -%{_datadir}/bash-completion -%{_datadir}/fish -%{_datadir}/zsh %{_mandir}/man1/%{name}.1* %{_mandir}/man1/%{name}-*.1* %{_mandir}/man5/%{name}.conf.5* %config(noreplace) %{_sysconfdir}/containers/%{name}.conf %{_sysconfdir}/profile.d/%{name}.sh %{_tmpfilesdir}/%{name}.conf +%{bash_completions_dir}/%{name}.bash +%{fish_completions_dir}/%{name}.fish +%{zsh_completions_dir}/_%{name} -%if ! 0%{?rhel} - -%files support - -%files experience - -%endif %files tests %{_datadir}/%{name} %changelog +* Fri Oct 10 2025 Alejandro Sáez - 0.3-2 +- rebuild + +* Wed Sep 17 2025 Debarshi Ray - 0.3-1 +- Update to 0.3 + +* Fri Aug 15 2025 Maxwell G - 0.2-2 +- Rebuild for golang-1.25.0 + +* Sat Aug 09 2025 Debarshi Ray - 0.2-1 +- Update to 0.2 +- Fix CVE-2025-23266, CVE-2025-23267, and GHSA-fv92-fjc5-jj9h or GO-2025-3787 + +* Fri Jul 25 2025 Fedora Release Engineering - 0.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Tue Jun 03 2025 Debarshi Ray - 0.1.2-1 +- Update to 0.1.2 + +* Wed Jan 22 2025 Debarshi Ray - 0.1.1-3 +- Use RPM macros for shell completions and clean up directory ownership + +* Sun Jan 19 2025 Fedora Release Engineering - 0.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Mon Nov 04 2024 Debarshi Ray - 0.1.1-1 +- Update to 0.1.1 + +* Tue Oct 22 2024 Debarshi Ray - 0.1.0-1 +- Update to 0.1.0 + +* Wed Oct 16 2024 Debarshi Ray - 0.0.99.6-6 +- Recommend fuse-overlayfs because old containers created with it need it + * Mon Oct 07 2024 Debarshi Ray - 0.0.99.6-5 - Don't use slirp4netns(1) in tests to work around bug in pasta(1) @@ -312,34 +246,59 @@ install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf * Mon Sep 30 2024 Debarshi Ray - 0.0.99.6-1 - Update to 0.0.99.6 -* Wed Jul 31 2024 Debarshi Ray - 0.0.99.5-10 +* Thu Sep 12 2024 Debarshi Ray - 0.0.99.5-18 +- Rebuild against shadow-utils-subid ABI version 5.0.0 + +* Thu Aug 08 2024 Debarshi Ray - 0.0.99.5-17 +- Ensure slirp4netns(1) is installed + +* Wed Jul 31 2024 Debarshi Ray - 0.0.99.5-16 - Avoid running out of storage space when running the tests -* Fri Jul 26 2024 Adam Williamson - 0.0.99.5-9 +* Fri Jul 26 2024 Adam Williamson - 0.0.99.5-15 - Fix CI test (hopefully) -* Thu Jul 11 2024 Debarshi Ray - 0.0.99.5-8 +* Sat Jul 20 2024 Fedora Release Engineering - 0.0.99.5-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jul 11 2024 Debarshi Ray - 0.0.99.5-13 - Silence 'rpminspect --tests=stack-prot' -* Thu Jul 11 2024 Debarshi Ray - 0.0.99.5-7 +* Thu Jul 11 2024 Debarshi Ray - 0.0.99.5-12 - Silence 'rpminspect --tests=annocheck' (part 2) -* Tue Mar 26 2024 Debarshi Ray - 0.0.99.5-6 +* Tue May 07 2024 Debarshi Ray - 0.0.99.5-11 +- Unbreak the tests with Podman 5.0 + +* Tue Mar 26 2024 Debarshi Ray - 0.0.99.5-10 - Specify the golang versions for RHEL 9 and 10 -* Tue Mar 05 2024 Debarshi Ray - 0.0.99.5-5 +* Tue Mar 05 2024 Debarshi Ray - 0.0.99.5-9 - Conditionalize the BuildRequires on golang -* Tue Feb 27 2024 Debarshi Ray - 0.0.99.5-4 +* Tue Feb 27 2024 Debarshi Ray - 0.0.99.5-8 - Unbreak Podman's downstream Fedora CI (part 2) - Backport some new upstream tests -* Tue Feb 13 2024 Debarshi Ray - 0.0.99.5-3 +* Tue Feb 13 2024 Debarshi Ray - 0.0.99.5-7 - Unbreak Podman's downstream Fedora CI +- Update the BuildRequires on golang to reflect reality -* Thu Jan 11 2024 Debarshi Ray - 0.0.99.5-2 +* Sun Feb 11 2024 Maxwell G - 0.0.99.5-6 +- Rebuild for golang 1.22.0 + +* Wed Feb 07 2024 Debarshi Ray - 0.0.99.5-5 +- Migrate to SPDX license + +* Sat Jan 27 2024 Fedora Release Engineering - 0.0.99.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 11 2024 Debarshi Ray - 0.0.99.5-3 - Drop 'Recommends: subscription-manager' +* Tue Dec 19 2023 Debarshi Ray - 0.0.99.5-2 +- Drop the experience and support subpackages + * Tue Dec 19 2023 Debarshi Ray - 0.0.99.5-1 - Update to 0.0.99.5