summaryrefslogtreecommitdiff
path: root/libpod/sql_state_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/sql_state_test.go')
-rw-r--r--libpod/sql_state_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/libpod/sql_state_test.go b/libpod/sql_state_test.go
index 5ccd069d3..9f6b5d078 100644
--- a/libpod/sql_state_test.go
+++ b/libpod/sql_state_test.go
@@ -15,7 +15,7 @@ import (
func getTestContainer(id, name string) *Container {
ctr := &Container{
- config: &containerConfig{
+ config: &ContainerConfig{
ID: id,
Name: name,
RootfsImageID: id,
@@ -518,4 +518,15 @@ func TestGetAllContainersTwoContainers(t *testing.T) {
ctrs, err := state.AllContainers()
assert.NoError(t, err)
assert.Equal(t, 2, len(ctrs))
+
+ // Containers should be ordered by creation time
+
+ // Use assert.EqualValues if the test fails to pretty print diff
+ // between actual and expected
+ if !testContainersEqual(testCtr2, ctrs[0]) {
+ assert.EqualValues(t, testCtr2, ctrs[0])
+ }
+ if !testContainersEqual(testCtr1, ctrs[1]) {
+ assert.EqualValues(t, testCtr1, ctrs[1])
+ }
}