File: 0002-Allow-skipping-tests-that-connec-to-the-internet-Clo.patch

package info (click to toggle)
golang-github-notaryproject-notation-go 1.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,724 kB
  • sloc: makefile: 21
file content (30 lines) | stat: -rw-r--r-- 804 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Reinhard Tartler <siretart@tauware.de>
Date: Thu, 26 Dec 2024 07:20:35 -0500
Subject: Allow skipping tests that connec to the internet, Closes: #1090825

---
 signer/signer_test.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/signer/signer_test.go b/signer/signer_test.go
index 1dac5eb..bf937ea 100644
--- a/signer/signer_test.go
+++ b/signer/signer_test.go
@@ -27,6 +27,7 @@ import (
 	"os"
 	"path/filepath"
 	"regexp"
+	"strings"
 	"testing"
 	"time"
 
@@ -398,6 +399,9 @@ func validateSignWithCerts(t *testing.T, envelopeType string, key crypto.Private
 	}
 	sig, _, err := s.Sign(ctx, desc, sOpts)
 	if err != nil {
+		if strings.Contains(err.Error(), "dial tcp: lookup") {
+			t.Skipf("Failed to connect to external host: %v", err)
+		}
 		t.Fatalf("Sign() error = %v", err)
 	}