Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick lint from connector_test #84

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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"))

Expand Down Expand Up @@ -611,10 +618,13 @@ 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 {
}
if ip != nil {
assert.Contains(t, string(readBuffer), *ip)
}
if mac != nil {
assert.Contains(t, string(readBuffer), *mac)
}
}
Loading