From c3a0a7e156eab8ed634ffc5f27046153be54fb61 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:41:56 +0200 Subject: [PATCH] cli: set image version in tests to stamped binary version (#2485) --- cli/internal/cmd/init_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/internal/cmd/init_test.go b/cli/internal/cmd/init_test.go index 7e8603894..021c2af23 100644 --- a/cli/internal/cmd/init_test.go +++ b/cli/internal/cmd/init_test.go @@ -577,7 +577,7 @@ func TestAttestation(t *testing.T) { require.NoError(existingStateFile.WriteToFile(fileHandler, constants.StateFilename)) cfg := config.Default() - cfg.Image = "v0.0.0" // is the default version of the the CLI (before build injects the real version) + cfg.Image = constants.BinaryVersion().String() cfg.RemoveProviderAndAttestationExcept(cloudprovider.QEMU) cfg.Attestation.QEMUVTPM.Measurements[0] = measurements.WithAllBytes(0x00, measurements.Enforce, measurements.PCRMeasurementLength) cfg.Attestation.QEMUVTPM.Measurements[1] = measurements.WithAllBytes(0x11, measurements.Enforce, measurements.PCRMeasurementLength) @@ -611,6 +611,9 @@ func TestAttestation(t *testing.T) { assert.Error(err) // make sure the error is actually a TLS handshake error assert.Contains(err.Error(), "transport: authentication handshake failed") + if validationErr, ok := err.(*config.ValidationError); ok { + t.Log(validationErr.LongMessage()) + } } type testValidator struct {