summaryrefslogtreecommitdiff
path: root/libpod/sql_state_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-22 12:21:53 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-22 18:12:57 +0000
commit34ba0cb8a922347364afaa14f199409ad7dc2451 (patch)
tree23fa7811dcf3de1501399f76373dc13bf4744d64 /libpod/sql_state_test.go
parentbd4e106de3d890bd2b0520083c9ad7d314b61487 (diff)
downloadpodman-34ba0cb8a922347364afaa14f199409ad7dc2451.tar.gz
podman-34ba0cb8a922347364afaa14f199409ad7dc2451.tar.bz2
podman-34ba0cb8a922347364afaa14f199409ad7dc2451.zip
Order containers returned from state and make container config public
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #63 Approved by: baude
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])
+ }
}