Skip to content

Commit

Permalink
Merge pull request #17822 from edsantiago/confirm_db
Browse files Browse the repository at this point in the history
CI: test and confirm DESIRED_DATABASE
  • Loading branch information
openshift-merge-robot authored Mar 17, 2023
2 parents 1ddf6fa + e2d49fb commit cf70c75
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/e2e/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,19 @@ var _ = Describe("Podman Info", func() {
Expect(session).To(Exit(0))
Expect(session.OutputToString()).To(Equal(want))
})

It("Podman info: check desired database backend", func() {
// defined in .cirrus.yml
want := os.Getenv("CI_DESIRED_DATABASE")
if want == "" {
if os.Getenv("CIRRUS_CI") == "" {
Skip("CI_DESIRED_DATABASE is not set--this is OK because we're not running under Cirrus")
}
Fail("CIRRUS_CI is set, but CI_DESIRED_DATABASE is not! See #16389")
}
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.DatabaseBackend}}"})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
Expect(session.OutputToString()).To(Equal(want))
})
})
1 change: 1 addition & 0 deletions test/system/001-basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function setup() {
'Logdriver:{{.Host.LogDriver}}'
'Cgroups:{{.Host.CgroupsVersion}}+{{.Host.CgroupManager}}'
'Net:{{.Host.NetworkBackend}}'
'DB:{{.Host.DatabaseBackend}}'
)
run_podman info --format "$(IFS='/' echo ${want[@]})"
echo "# $output" >&3
Expand Down
20 changes: 20 additions & 0 deletions test/system/005-info.bats
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ host.slirp4netns.executable | $expr_path
is "$output" "$CI_DESIRED_NETWORK" "CI_DESIRED_NETWORK (from .cirrus.yml)"
}

@test "podman info - confirm desired database" {
skip "FIXME: no way yet (2023-03-16) to override DB in system tests"
if [[ -z "$CI_DESIRED_DATABASE" ]]; then
# When running in Cirrus, CI_DESIRED_DATABASE *must* be defined
# in .cirrus.yml so we can double-check that all CI VMs are
# using netavark or cni as desired.
if [[ -n "$CIRRUS_CI" ]]; then
die "CIRRUS_CI is set, but CI_DESIRED_DATABASE is not! See #16389"
fi

# Not running under Cirrus (e.g., gating tests, or dev laptop).
# Totally OK to skip this test.
skip "CI_DESIRED_DATABASE is unset--OK, because we're not in Cirrus"
fi

run_podman info --format '{{.Host.DatabaseBackend}}'
is "$output" "$CI_DESIRED_DATABASE" "CI_DESIRED_DATABASE (from .cirrus.yml)"
}


# 2021-04-06 discussed in watercooler: RHEL must never use crun, even if
# using cgroups v2.
@test "podman info - RHEL8 must use runc" {
Expand Down

0 comments on commit cf70c75

Please sign in to comment.