diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/e2e/config_test.go | 10 | ||||
| -rw-r--r-- | tests/e2e/lifecycle_test.go | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/tests/e2e/config_test.go b/tests/e2e/config_test.go index 83cfc15..e613b13 100644 --- a/tests/e2e/config_test.go +++ b/tests/e2e/config_test.go @@ -38,12 +38,12 @@ func TestConfigPropagation(t *testing.T) { // Test 2: Configuration after bootstrap (Isolated) // We use 'test-ns' as a way to run a command that we know is isolated. - // Actually, we can just run 'show-config' but the current 'Route' - // handles 'show-config' BEFORE the bootstrap. - // To test isolated config, we can't use 'show-config' because it's a diagnostic + // Actually, we can just run 'show-config' but the current 'Route' + // handles 'show-config' BEFORE the bootstrap. + // To test isolated config, we can't use 'show-config' because it's a diagnostic // command designed to run outside isolation. - - // To verify what an isolated process sees, we can use a target command + + // To verify what an isolated process sees, we can use a target command // that prints the environment. cmdIsolated := exec.Command(binaryPath, "--profile", profile, "--", "sh", "-c", "echo $XDG_RUNTIME_DIR") cmdIsolated.Env = append(os.Environ(), fmt.Sprintf("XDG_RUNTIME_DIR=%s", tmpRuntimeDir)) diff --git a/tests/e2e/lifecycle_test.go b/tests/e2e/lifecycle_test.go index 649dbc0..08887e1 100644 --- a/tests/e2e/lifecycle_test.go +++ b/tests/e2e/lifecycle_test.go @@ -48,9 +48,11 @@ func TestNamespaceLifecycleAutomation(t *testing.T) { tmpRuntimeDir := t.TempDir() profile := "e2e-lifecycle-test" pidsDir := filepath.Join(tmpRuntimeDir, "profiles", profile, "pids") - + // Clean up before starting - os.RemoveAll(filepath.Join(tmpRuntimeDir, "profiles", profile)) + if err := os.RemoveAll(filepath.Join(tmpRuntimeDir, "profiles", profile)); err != nil { + t.Fatalf("failed to remove profile directory: %v", err) + } t.Run("ReferenceCounting", func(t *testing.T) { // Start a process that exits quickly @@ -75,7 +77,7 @@ func TestNamespaceLifecycleAutomation(t *testing.T) { if err := cmd1.Wait(); err != nil { t.Fatalf("cmd1 failed: %v", err) } - + // Poll for the count to drop back to 1 timeout := time.After(2 * time.Second) found := false @@ -97,7 +99,7 @@ func TestNamespaceLifecycleAutomation(t *testing.T) { if err := cmd2.Wait(); err != nil { t.Fatalf("cmd2 failed: %v", err) } - + // Verify a clean state (expect 0 files) timeout = time.After(2 * time.Second) found = false |
