github.com/containers/podman/v5@v5.1.0-rc1/test/system/999-final.bats (about)

     1  #!/usr/bin/env bats
     2  #
     3  # Final set of tests to run.
     4  #
     5  
     6  load helpers
     7  
     8  # Confirm that we're still using the same database we started with.
     9  #
    10  # This should never fail! If it does, it means that some test somewhere
    11  # has run podman with --db-backend, which is known to wreak havoc.
    12  #
    13  # See  https://github.com/containers/podman/issues/20563
    14  @test "podman database backend has not changed" {
    15      # File is always written in 005-info.bats. It must always exist
    16      # by the time we get here...
    17      db_backend_file=$BATS_SUITE_TMPDIR/db-backend
    18  
    19      if [[ ! -e "$db_backend_file" ]]; then
    20          # ...except in a manual run like "hack/bats 999"
    21          if [[ $BATS_SUITE_TEST_NUMBER -le 5 ]]; then
    22              skip "$db_backend_file missing, but this is a short manual bats run, so, ok"
    23          fi
    24  
    25          die "Internal error: $db_backend_file does not exist! (check 005-*.bats)"
    26      fi
    27  
    28      run_podman info --format '{{.Host.DatabaseBackend}}'
    29      assert "$output" = "$(<$db_backend_file)" ".Host.DatabaseBackend has changed!"
    30  }