Skip to content

Agent Mesh

fix unit tests

Antonio Ojeaa0fdd1a39a6f
diff --git a/tests/integration/cuj_test.go b/tests/integration/cuj_test.go
index 10b88a4d..92dbfde6 100644
--- a/tests/integration/cuj_test.go
+++ b/tests/integration/cuj_test.go
@@ -44,6 +44,8 @@ func TestSamNodeRunWithManualTokenStarts(t *testing.T) {
"--jwt", "test-jwt",
"--listen", "/ip4/127.0.0.1/udp/0/quic-v1",
"--listen", "/ip4/127.0.0.1/tcp/0",
+ "--bind-addr", "127.0.0.1:0",
+ "--api-token", "dummy-token",
)
if err != context.DeadlineExceeded {
t.Fatalf("expected run command to keep running until timeout, got: %v\nstdout:\n%s\nstderr:\n%s", err, stdout, stderr)
diff --git a/tests/integration/fallback_test.go b/tests/integration/fallback_test.go
index ce6d4d5a..f498a7af 100644
--- a/tests/integration/fallback_test.go
+++ b/tests/integration/fallback_test.go
@@ -116,7 +116,7 @@ func TestFallbackReEnrollment(t *testing.T) {
}
// 5. Run Node in background
- cmd := exec.Command(nodeBin, "run", "--hub", hubAddr, "--listen", "/ip4/127.0.0.1/tcp/0", "--jwt-path", jwtPath)
+ cmd := exec.Command(nodeBin, "run", "--hub", hubAddr, "--listen", "/ip4/127.0.0.1/tcp/0", "--jwt-path", jwtPath, "--bind-addr", "127.0.0.1:0", "--api-token", "dummy-token")
cmd.Dir = repoRoot(t)
cmd.Env = env
diff --git a/tests/integration/login_test.go b/tests/integration/login_test.go
index 29ae7085..1e8ea56f 100644
--- a/tests/integration/login_test.go
+++ b/tests/integration/login_test.go
@@ -102,6 +102,8 @@ func TestSamNodeLogin(t *testing.T) {
nodeBin,
"run",
"--hub", hubAddr,
+ "--bind-addr", "127.0.0.1:0",
+ "--api-token", "dummy-token",
)
// We expect it to keep running because it uses stored identity.
if err != context.DeadlineExceeded {
diff --git a/tests/integration/proxy_test.go b/tests/integration/proxy_test.go
index 8dc5920f..1534e75d 100644
--- a/tests/integration/proxy_test.go
+++ b/tests/integration/proxy_test.go
@@ -82,6 +82,8 @@ func TestSamNodeRunWithStoredIdentity(t *testing.T) {
"run",
"--listen", "/ip4/127.0.0.1/udp/0/quic-v1",
"--listen", "/ip4/127.0.0.1/tcp/0",
+ "--bind-addr", "127.0.0.1:0",
+ "--api-token", "dummy-token",
)
if err != context.DeadlineExceeded {
t.Fatalf("expected run command to keep running until timeout, got: %v\nstdout:\n%s\nstderr:\n%s", err, runOut, runErrOut)