File: 999-final.bats

package info (click to toggle)
podman 5.4.2%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,124 kB
  • sloc: sh: 6,119; perl: 2,710; python: 2,258; ansic: 1,556; makefile: 1,022; xml: 121; ruby: 42; awk: 12; csh: 8
file content (30 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bats
#
# Final set of tests to run.
#

load helpers

# Confirm that we're still using the same database we started with.
#
# This should never fail! If it does, it means that some test somewhere
# has run podman with --db-backend, which is known to wreak havoc.
#
# See  https://github.com/containers/podman/issues/20563
@test "podman database backend has not changed" {
    # File is always written in 005-info.bats. It must always exist
    # by the time we get here...
    db_backend_file=$BATS_SUITE_TMPDIR/db-backend

    if [[ ! -e "$db_backend_file" ]]; then
        # ...except in a manual run like "hack/bats 999"
        if [[ $BATS_SUITE_TEST_NUMBER -le 5 ]]; then
            skip "$db_backend_file missing, but this is a short manual bats run, so, ok"
        fi

        die "Internal error: $db_backend_file does not exist! (check 005-*.bats)"
    fi

    run_podman info --format '{{.Host.DatabaseBackend}}'
    assert "$output" = "$(<$db_backend_file)" ".Host.DatabaseBackend has changed!"
}