From a75f74a83f69b5bc8b52e174f5d252a2149bfe0a Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 19 Sep 2023 11:12:04 +0200 Subject: [PATCH] make sure default scenario does not yield remote unavailable --- .../upgrade/artifact/download/fs/verifier_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/pkg/agent/application/upgrade/artifact/download/fs/verifier_test.go b/internal/pkg/agent/application/upgrade/artifact/download/fs/verifier_test.go index e45cb24a854..2b55abbe59f 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/fs/verifier_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/fs/verifier_test.go @@ -173,7 +173,7 @@ func prepareFetchVerifyTests(dropPath, targetDir, targetFilePath, hashTargetFile } func TestVerify(t *testing.T) { - log, _ := logger.New("", false) + log, obs := logger.NewTesting("TestVerify") targetDir, err := ioutil.TempDir(os.TempDir(), "") if err != nil { t.Fatal(err) @@ -214,6 +214,10 @@ func TestVerify(t *testing.T) { err = testVerifier.Verify(beatSpec, version, false) require.NoError(t, err) + // log message informing remote PGP was skipped + logs := obs.FilterMessageSnippet("Skipped remote PGP located at") + require.Equal(t, 0, logs.Len()) + os.Remove(artifact) os.Remove(artifact + ".sha512") os.RemoveAll(config.DropPath)