Added missing gating tests files and patch for tests

Related: rhbz#2000051
This commit is contained in:
Oliver Gutierrez 2021-09-03 17:42:09 +01:00
parent 768bb82508
commit 62a7b56985
No known key found for this signature in database
GPG Key ID: C4D0A809DC608C15
3 changed files with 134 additions and 1 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -0,0 +1,120 @@
From c65a6e06e38bad6f1f1a1139953fc112f49def33 Mon Sep 17 00:00:00 2001
From: Oliver Gutierrez <ogutsua@gmail.com>
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

View File

@ -9,7 +9,7 @@ Version: 0.0.99.3
%global goipath github.com/containers/%{name} %global goipath github.com/containers/%{name}
%gometa %gometa
Release: 0.6.git660b6970e998%{?dist} Release: 0.7.git660b6970e998%{?dist}
Summary: Unprivileged development environment Summary: Unprivileged development environment
License: ASL 2.0 License: ASL 2.0
@ -26,6 +26,7 @@ Source1: %{name}.conf
Patch100: toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch Patch100: toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch
Patch101: toolbox-Make-the-build-flags-match-RHEL-s-gobuild-for-PPC64.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 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 # https://bugzilla.redhat.com/show_bug.cgi?id=1905383
ExcludeArch: %{ix86} ExcludeArch: %{ix86}
@ -50,6 +51,7 @@ other standard container technologies from OCI.
Summary: Tests for %{name} Summary: Tests for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: skopeo
%description tests %description tests
The %{name}-tests package contains system tests for %{name}. The %{name}-tests package contains system tests for %{name}.
@ -65,6 +67,7 @@ The %{name}-tests package contains system tests for %{name}.
%endif %endif
%patch102 -p1 %patch102 -p1
%patch103 -p1
# %%gomkdir is absent from RHEL 8. # %%gomkdir is absent from RHEL 8.
GOBUILDDIR="$(pwd)/_build" GOBUILDDIR="$(pwd)/_build"
@ -112,6 +115,10 @@ install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf
%changelog %changelog
* Fri Sep 03 2021 Oliver Gutiérrez <ogutierrez@redhat.com> - 0.0.99.3-0.7.git660b6970e998
- Added missing gating tests files and patch for tests
Related: #2000051
* Fri Sep 03 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-0.6.git660b6970e998 * Fri Sep 03 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-0.6.git660b6970e998
- re-add gating tests - re-add gating tests
- Related: #2000051 - Related: #2000051