diff options
Diffstat (limited to 'tests/e2e/e2e_test.go')
| -rw-r--r-- | tests/e2e/e2e_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 907bb22..98711e4 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -57,7 +57,7 @@ AllowedIPs = 10.0.0.0/24 } // 3. Launch wg-wrap with a command that triggers traffic - cmd := exec.Command(binaryPath, "--profile", profile, "--", "ping", "-c", "1", "-W", "1", "10.0.0.1") + cmd := exec.Command(binaryPath, "run", "--profile", profile, "--", "ping", "-c", "1", "-W", "1", "10.0.0.1") cmd.Env = append(os.Environ(), fmt.Sprintf("XDG_CONFIG_HOME=%s", tmpDir), fmt.Sprintf("XDG_RUNTIME_DIR=%s", tmpDir), @@ -138,7 +138,7 @@ AllowedIPs = 10.0.0.0/24 // 3. Test /etc/resolv.conf modification expectedDNS := "1.1.1.1" - cmd := exec.Command(binaryPath, "--profile", profile, "--dns-server", expectedDNS, "--", "cat", "/etc/resolv.conf") + cmd := exec.Command(binaryPath, "run", "--profile", profile, "--dns-server", expectedDNS, "--", "cat", "/etc/resolv.conf") cmd.Env = append(os.Environ(), fmt.Sprintf("XDG_CONFIG_HOME=%s", tmpDir), fmt.Sprintf("XDG_RUNTIME_DIR=%s", tmpDir), @@ -154,7 +154,7 @@ AllowedIPs = 10.0.0.0/24 } // 4. Test Data Path: Send a ping to trigger Handshake on the mock server - cmdQuery := exec.Command(binaryPath, "--profile", profile, "--", "ping", "-c", "1", "-W", "1", dnsServerIP) + cmdQuery := exec.Command(binaryPath, "run", "--profile", profile, "--", "ping", "-c", "1", "-W", "1", dnsServerIP) cmdQuery.Env = cmd.Env packetReceived := make(chan bool, 1) @@ -236,7 +236,7 @@ AllowedIPs = 10.0.0.0/24 _ = os.WriteFile(profilePath, []byte(confContent), 0644) // Prepare command args - args := []string{"--profile", profileName} + args := []string{"run", "--profile", profileName} if tt.cliDNS != "" { args = append(args, "--dns-server", tt.cliDNS) } @@ -263,7 +263,7 @@ AllowedIPs = 10.0.0.0/24 func TestMTUFragmentation(t *testing.T) { binaryPath := EnsureBinary(t) - cmd := exec.Command(binaryPath, "--profile", "default", "--", "true") + cmd := exec.Command(binaryPath, "run", "--profile", "default", "--", "true") if err := cmd.Run(); err != nil { t.Errorf("expected command to pass, got: %v", err) } @@ -273,7 +273,7 @@ func TestExitCodePropagation(t *testing.T) { binaryPath := EnsureBinary(t) // Run a command that exits with code 42 - cmd := exec.Command(binaryPath, "--profile", "default", "--", "sh", "-c", "exit 42") + cmd := exec.Command(binaryPath, "run", "--profile", "default", "--", "sh", "-c", "exit 42") err := cmd.Run() if err == nil { t.Fatalf("expected command to fail with exit status 42, but it succeeded") |
