21657: Update docker archive ID introspection code for OCIv2.
[arvados.git] / lib / diagnostics / docker_image_test.go
diff --git a/lib/diagnostics/docker_image_test.go b/lib/diagnostics/docker_image_test.go
new file mode 100644 (file)
index 0000000..ace4a2c
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package diagnostics
+
+import (
+       "testing"
+
+       . "gopkg.in/check.v1"
+)
+
+func Test(t *testing.T) {
+       TestingT(t)
+}
+
+var _ = Suite(&suite{})
+
+type suite struct{}
+
+func (*suite) TestGetSHA2FromImageData(c *C) {
+       imageSHA2, err := getSHA2FromImageData(HelloWorldDockerImage)
+       c.Check(err, IsNil)
+       c.Check(imageSHA2, Matches, `[0-9a-f]{64}`)
+}