[client] Cleanup dns and route states on startup (#2757)

This commit is contained in:
Viktor Liu
2024-10-24 10:53:46 +02:00
committed by GitHub
parent 44f2ce666e
commit 869537c951
42 changed files with 786 additions and 377 deletions

View File

@ -77,10 +77,10 @@ func TestAddRemoveRoutes(t *testing.T) {
r := NewSysOps(wgInterface, nil)
_, _, err = r.SetupRouting(nil)
_, _, err = r.SetupRouting(nil, nil)
require.NoError(t, err)
t.Cleanup(func() {
assert.NoError(t, r.CleanupRouting())
assert.NoError(t, r.CleanupRouting(nil))
})
index, err := net.InterfaceByName(wgInterface.Name())
@ -403,10 +403,10 @@ func setupTestEnv(t *testing.T) {
})
r := NewSysOps(wgInterface, nil)
_, _, err := r.SetupRouting(nil)
_, _, err := r.SetupRouting(nil, nil)
require.NoError(t, err, "setupRouting should not return err")
t.Cleanup(func() {
assert.NoError(t, r.CleanupRouting())
assert.NoError(t, r.CleanupRouting(nil))
})
index, err := net.InterfaceByName(wgInterface.Name())