summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-21 04:17:25 -0500
committerGitHub <noreply@github.com>2022-01-21 04:17:25 -0500
commit845256bdb356bf280347c41de76f5998faa9e24b (patch)
treead974769a097dcc7985f88935f03d1734e109d41 /pkg/domain/infra/abi/images_test.go
parent993c072029fb2c3938d3685ca7e38b5eab29c400 (diff)
parent2947ded7a8fced28fb3478f556194d12433145ad (diff)
downloadpodman-845256bdb356bf280347c41de76f5998faa9e24b.tar.gz
podman-845256bdb356bf280347c41de76f5998faa9e24b.tar.bz2
podman-845256bdb356bf280347c41de76f5998faa9e24b.zip
Merge pull request #12936 from cgwalters/null-history
Don't segfault if an image layer has no creation timestamp
Diffstat (limited to 'pkg/domain/infra/abi/images_test.go')
-rw-r--r--pkg/domain/infra/abi/images_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/images_test.go b/pkg/domain/infra/abi/images_test.go
index 20ef1b150..e38b9390d 100644
--- a/pkg/domain/infra/abi/images_test.go
+++ b/pkg/domain/infra/abi/images_test.go
@@ -1,5 +1,22 @@
package abi
+import (
+ "testing"
+
+ "github.com/containers/common/libimage"
+ "github.com/stretchr/testify/assert"
+)
+
+// This is really intended to verify what happens with a
+// nil pointer in layer.Created, but we'll just sanity
+// check round tripping 42.
+func TestToDomainHistoryLayer(t *testing.T) {
+ var layer libimage.ImageHistory
+ layer.Size = 42
+ newLayer := toDomainHistoryLayer(&layer)
+ assert.Equal(t, layer.Size, newLayer.Size)
+}
+
//
// import (
// "context"