From d55a17ee43c4d3d03f58d0f8a96ce07a826195cb Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Tue, 15 Aug 2017 01:45:24 +1000 Subject: [PATCH] integration: re-enable image-tools upstream validation This effectively reverts f4a44f00b826 ("integration: disable check with image-tools for image-spec RC5"), which disabled the compliance validation due to upstream bugs. Since those bugs have been fixed, re-enable the tests (to make the smoke tests far more effective). Fixes: f4a44f00b826 ("integration: disable check with image-tools for image-spec RC5") Signed-off-by: Aleksa Sarai --- integration/copy_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/integration/copy_test.go b/integration/copy_test.go index e42908e2..bd15c2e4 100644 --- a/integration/copy_test.go +++ b/integration/copy_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "log" "net/http" "net/http/httptest" "os" @@ -14,6 +15,7 @@ import ( "github.com/containers/image/signature" "github.com/go-check/check" "github.com/opencontainers/go-digest" + "github.com/opencontainers/image-tools/image" ) func init() { @@ -241,13 +243,15 @@ func (s *CopySuite) TestCopyOCIRoundTrip(c *check.C) { c.Assert(out, check.Equals, "") // For some silly reason we pass a logger to the OCI library here... - //logger := log.New(os.Stderr, "", 0) + logger := log.New(os.Stderr, "", 0) - // TODO: Verify using the upstream OCI image validator. - //err = image.ValidateLayout(oci1, nil, logger) - //c.Assert(err, check.IsNil) - //err = image.ValidateLayout(oci2, nil, logger) - //c.Assert(err, check.IsNil) + // Verify using the upstream OCI image validator, this should catch most + // non-compliance errors. DO NOT REMOVE THIS TEST UNLESS IT'S ABSOLUTELY + // NECESSARY. + err = image.ValidateLayout(oci1, nil, logger) + c.Assert(err, check.IsNil) + err = image.ValidateLayout(oci2, nil, logger) + c.Assert(err, check.IsNil) // Now verify that everything is identical. Currently this is true, but // because we recompute the manifests on-the-fly this doesn't necessarily