Fix various integration test issues with SQLite state

Two main changes:
- The transient state tests relied on BoltDB paths, change to
  make them agnostic
- The volume code in SQLite wasn't retrieving and setting the
  volume plugin for volumes that used one.

Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
Matt Heon
2023-03-07 14:37:50 -05:00
parent 0f8530b1ee
commit 2ec11b16ab
5 changed files with 45 additions and 10 deletions

View File

@ -54,8 +54,14 @@ var _ = Describe("Podman run with volumes", func() {
Expect(filepath.Join(containerStorageDir, "volatile-containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "volatile-containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(BeARegularFile())
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
if podmanTest.DatabaseBackend == "sqlite" {
Expect(filepath.Join(containerStorageDir, "db.sql")).Should(BeARegularFile())
Expect(filepath.Join(runContainerStorageDir, "db.sql")).Should(Not(BeAnExistingFile()))
} else {
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(BeARegularFile())
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
}
})
It("podman run --rm with no transient-store", func() {
@ -68,8 +74,14 @@ var _ = Describe("Podman run with volumes", func() {
Expect(filepath.Join(containerStorageDir, "volatile-containers.json")).Should(BeARegularFile())
Expect(filepath.Join(runContainerStorageDir, "containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "volatile-containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(BeARegularFile())
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
if podmanTest.DatabaseBackend == "sqlite" {
Expect(filepath.Join(containerStorageDir, "db.sql")).Should(BeARegularFile())
Expect(filepath.Join(runContainerStorageDir, "db.sql")).Should(Not(BeAnExistingFile()))
} else {
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(BeARegularFile())
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
}
})
It("podman run --transient-store", func() {
@ -83,8 +95,14 @@ var _ = Describe("Podman run with volumes", func() {
Expect(filepath.Join(containerStorageDir, "volatile-containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "containers.json")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "volatile-containers.json")).Should(BeARegularFile())
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(BeARegularFile())
if podmanTest.DatabaseBackend == "sqlite" {
Expect(filepath.Join(containerStorageDir, "db.sql")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runContainerStorageDir, "db.sql")).Should(BeARegularFile())
} else {
Expect(filepath.Join(dbDir, "bolt_state.db")).Should(Not(BeAnExistingFile()))
Expect(filepath.Join(runDBDir, "bolt_state.db")).Should(BeARegularFile())
}
})
})