From 62a7b569851ba6df6ad6bed15e88c96410261795 Mon Sep 17 00:00:00 2001 From: Oliver Gutierrez Date: Fri, 3 Sep 2021 17:42:09 +0100 Subject: [PATCH] Added missing gating tests files and patch for tests Related: rhbz#2000051 --- gating.yaml | 6 ++ toolbox-Test-fixes-for-gating.patch | 120 ++++++++++++++++++++++++++++ toolbox.spec | 9 ++- 3 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 gating.yaml create mode 100644 toolbox-Test-fixes-for-gating.patch diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/toolbox-Test-fixes-for-gating.patch b/toolbox-Test-fixes-for-gating.patch new file mode 100644 index 0000000..38b85c8 --- /dev/null +++ b/toolbox-Test-fixes-for-gating.patch @@ -0,0 +1,120 @@ +From c65a6e06e38bad6f1f1a1139953fc112f49def33 Mon Sep 17 00:00:00 2001 +From: Oliver Gutierrez +Date: Fri, 3 Sep 2021 12:04:24 +0100 +Subject: [PATCH] Test fixes for gating + + +diff --git a/test/system/002-help.bats b/test/system/002-help.bats +index 4ff02c6..cca3da4 100644 +--- a/test/system/002-help.bats ++++ b/test/system/002-help.bats +@@ -4,6 +4,10 @@ load 'libs/bats-support/load' + load 'libs/bats-assert/load' + load 'libs/helpers.bash' + ++setup() { ++ check_xdg_runtime_dir ++} ++ + @test "help: Run command 'help'" { + run $TOOLBOX help + +diff --git a/test/system/101-create.bats b/test/system/101-create.bats +index 3cc3eaf..63d4fcb 100644 +--- a/test/system/101-create.bats ++++ b/test/system/101-create.bats +@@ -5,6 +5,7 @@ load 'libs/bats-assert/load' + load 'libs/helpers' + + setup() { ++ check_xdg_runtime_dir + cleanup_containers + } + +@@ -62,7 +63,7 @@ teardown() { + + assert_success + assert_output --partial "Created container: fedora-toolbox-32" +- assert_output --partial "Enter with: toolbox enter fedora-toolbox-32" ++ assert_output --partial "Enter with: toolbox enter --release 32" + + # Make sure the container has actually been created + run podman ps -a +diff --git a/test/system/102-list.bats b/test/system/102-list.bats +index 184ad6c..770e8d2 100644 +--- a/test/system/102-list.bats ++++ b/test/system/102-list.bats +@@ -5,6 +5,7 @@ load 'libs/bats-assert/load' + load 'libs/helpers' + + setup() { ++ check_xdg_runtime_dir + cleanup_all + } + +diff --git a/test/system/104-run.bats b/test/system/104-run.bats +index 026126b..03cf291 100644 +--- a/test/system/104-run.bats ++++ b/test/system/104-run.bats +@@ -5,6 +5,7 @@ load 'libs/bats-assert/load' + load 'libs/helpers' + + setup() { ++ check_xdg_runtime_dir + cleanup_containers + } + +diff --git a/test/system/105-rm.bats b/test/system/105-rm.bats +index 9f1435b..68e3c03 100644 +--- a/test/system/105-rm.bats ++++ b/test/system/105-rm.bats +@@ -5,6 +5,7 @@ load 'libs/bats-assert/load' + load 'libs/helpers' + + setup() { ++ check_xdg_runtime_dir + cleanup_containers + } + +diff --git a/test/system/106-rmi.bats b/test/system/106-rmi.bats +index 0ef0ebe..b48f802 100644 +--- a/test/system/106-rmi.bats ++++ b/test/system/106-rmi.bats +@@ -5,6 +5,7 @@ load 'libs/bats-assert/load' + load 'libs/helpers' + + setup() { ++ check_xdg_runtime_dir + cleanup_all + } + +diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash +index d59d661..89248fb 100644 +--- a/test/system/libs/helpers.bash ++++ b/test/system/libs/helpers.bash +@@ -8,8 +8,7 @@ readonly TOOLBOX=${TOOLBOX:-toolbox} + readonly SKOPEO=$(command -v skopeo) + + # Helpful globals +-readonly PROJECT_DIR=${PWD} +-readonly IMAGE_CACHE_DIR="${PROJECT_DIR}/image-cache" ++readonly IMAGE_CACHE_DIR="${BATS_RUN_TMPDIR}/image-cache" + + # Images + declare -Ag IMAGES=([busybox]="docker.io/library/busybox" \ +@@ -271,3 +270,11 @@ function get_system_version() { + + echo $(awk -F= '/VERSION_ID/ {print $2}' $os_release | head -n 1) + } ++ ++ ++# Setup the XDG_RUNTIME_DIR variable if not set ++function check_xdg_runtime_dir() { ++ if [[ -z "${XDG_RUNTIME_DIR}" ]]; then ++ export XDG_RUNTIME_DIR="/run/user/${UID}" ++ fi ++} +\ No newline at end of file +-- +2.31.1 + diff --git a/toolbox.spec b/toolbox.spec index 4efc417..605e3ad 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -9,7 +9,7 @@ Version: 0.0.99.3 %global goipath github.com/containers/%{name} %gometa -Release: 0.6.git660b6970e998%{?dist} +Release: 0.7.git660b6970e998%{?dist} Summary: Unprivileged development environment License: ASL 2.0 @@ -26,6 +26,7 @@ Source1: %{name}.conf Patch100: toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch Patch101: toolbox-Make-the-build-flags-match-RHEL-s-gobuild-for-PPC64.patch Patch102: toolbox-cmd-run-Make-sosreport-work-by-setting-the-HOST-envi.patch +Patch103: toolbox-Test-fixes-for-gating.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1905383 ExcludeArch: %{ix86} @@ -50,6 +51,7 @@ other standard container technologies from OCI. Summary: Tests for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: skopeo %description tests The %{name}-tests package contains system tests for %{name}. @@ -65,6 +67,7 @@ The %{name}-tests package contains system tests for %{name}. %endif %patch102 -p1 +%patch103 -p1 # %%gomkdir is absent from RHEL 8. GOBUILDDIR="$(pwd)/_build" @@ -112,6 +115,10 @@ install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf %changelog +* Fri Sep 03 2021 Oliver GutiƩrrez - 0.0.99.3-0.7.git660b6970e998 +- Added missing gating tests files and patch for tests + Related: #2000051 + * Fri Sep 03 2021 Jindrich Novy - 0.0.99.3-0.6.git660b6970e998 - re-add gating tests - Related: #2000051