summaryrefslogtreecommitdiff
path: root/tests/e2e/mount_leak_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/e2e/mount_leak_test.go')
-rw-r--r--tests/e2e/mount_leak_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/e2e/mount_leak_test.go b/tests/e2e/mount_leak_test.go
index bdc9d75..428675f 100644
--- a/tests/e2e/mount_leak_test.go
+++ b/tests/e2e/mount_leak_test.go
@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
+ "path/filepath"
"strings"
"testing"
)
@@ -21,11 +22,11 @@ func TestDNSMountLeak(t *testing.T) {
dnsServer := "8.8.8.8"
// Pre-create a dummy config for the profile
- configDir := "/tmp/wg-wrap-test-configs"
- if err := os.MkdirAll(configDir, 0755); err != nil {
- t.Fatalf("failed to create config dir: %v", err)
+ configDir := t.TempDir()
+ if err := os.MkdirAll(filepath.Join(configDir, "profiles"), 0755); err != nil {
+ t.Fatalf("failed to create profiles dir: %v", err)
}
- configPath := fmt.Sprintf("%s/%s.conf", configDir, profile)
+ configPath := filepath.Join(configDir, "profiles", profile+".conf")
if err := os.WriteFile(configPath, []byte("[Interface]\nAddress = 10.0.0.1/24\nPrivateKey = aAAA\n"), 0644); err != nil {
t.Fatalf("failed to write config file: %v", err)
}