From 6a22d6d708a8db92e25cd16720ecf94ff90b33ed Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Mon, 21 Oct 2024 14:25:38 -0400 Subject: [PATCH] Pick lint from connector_test --- connector_test.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/connector_test.go b/connector_test.go index adc2689..e77726d 100644 --- a/connector_test.go +++ b/connector_test.go @@ -14,7 +14,7 @@ import ( "time" "go.arcalot.io/assert" - log "go.arcalot.io/log/v2" + "go.arcalot.io/log/v2" "go.flow.arcalot.io/deployer" "go.flow.arcalot.io/podmandeployer/tests" ) @@ -577,7 +577,14 @@ func readOutputUntil(t *testing.T, plugin io.Reader, lookForOutput string) []byt return readBuffer[:n] } -func testNetworking(t *testing.T, podmanNetworking string, containerTest string, expectedOutput *string, ip *string, mac *string) { +func testNetworking( + t *testing.T, + podmanNetworking string, + containerTest string, + expectedOutput *string, + ip *string, + mac *string, +) { logger := log.NewTestLogger(t) assert.NoErrorR[string](t)(exec.LookPath("ifconfig")) @@ -611,10 +618,12 @@ func testNetworking(t *testing.T, podmanNetworking string, containerTest string, // assert the container input is not empty assert.Equals(t, len(readBuffer) > 0, true) - if ip == nil && mac == nil && expectedOutput != nil { + if expectedOutput != nil { assert.Contains(t, string(readBuffer), *expectedOutput) - } else { + } else if ip != nil && mac != nil { assert.Contains(t, string(readBuffer), *ip) assert.Contains(t, string(readBuffer), *mac) + } else { + t.Fatalf("Test bug: \"expectedOutput\" is nil AND \"ip\" or \"mac\" is too.") } }