summaryrefslogtreecommitdiff
path: root/libpod/sql_state_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-29 14:37:35 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-30 18:05:56 +0000
commit7eb5ce940c8145ef57920ef90b52857e9716ffc9 (patch)
tree0a9d90a27d87820f8c08c802ad6c0a1859e614fb /libpod/sql_state_test.go
parented5d686076b9b01ce5da7ed0bd37faeed216ae75 (diff)
downloadpodman-7eb5ce940c8145ef57920ef90b52857e9716ffc9.tar.gz
podman-7eb5ce940c8145ef57920ef90b52857e9716ffc9.tar.bz2
podman-7eb5ce940c8145ef57920ef90b52857e9716ffc9.zip
Add schema validation to DB
This ensures we don't open a DB with an earlier schema or a config that differs from ours Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #86 Approved by: rhatdan
Diffstat (limited to 'libpod/sql_state_test.go')
-rw-r--r--libpod/sql_state_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/sql_state_test.go b/libpod/sql_state_test.go
index 9f6b5d078..124959544 100644
--- a/libpod/sql_state_test.go
+++ b/libpod/sql_state_test.go
@@ -9,6 +9,7 @@ import (
"testing"
"time"
+ "github.com/containers/storage"
"github.com/opencontainers/runtime-tools/generate"
"github.com/stretchr/testify/assert"
)
@@ -102,7 +103,11 @@ func getEmptyState() (s State, p string, err error) {
dbPath := filepath.Join(tmpDir, "db.sql")
lockPath := filepath.Join(tmpDir, "db.lck")
- state, err := NewSQLState(dbPath, lockPath, tmpDir, nil)
+ runtime := new(Runtime)
+ runtime.config = new(RuntimeConfig)
+ runtime.config.StorageConfig = storage.StoreOptions{}
+
+ state, err := NewSQLState(dbPath, lockPath, tmpDir, runtime)
if err != nil {
return nil, "", err
}