Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove leaked tmp file in unit tests #45481

Merged
merged 1 commit into from
May 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/util/iptables/iptables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ func TestRestoreAll(t *testing.T) {
},
}
runner := newInternal(&fexec, dbus.NewFake(nil, nil), ProtocolIpv4, TestLockfilePath)
defer os.Remove(TestLockfilePath)
defer runner.Destroy()

err := runner.RestoreAll([]byte{}, NoFlushTables, RestoreCounters)
Expand Down Expand Up @@ -1086,6 +1087,7 @@ func TestRestoreAllWait(t *testing.T) {
},
}
runner := newInternal(&fexec, dbus.NewFake(nil, nil), ProtocolIpv4, TestLockfilePath)
defer os.Remove(TestLockfilePath)
defer runner.Destroy()

err := runner.RestoreAll([]byte{}, NoFlushTables, RestoreCounters)
Expand Down Expand Up @@ -1131,6 +1133,7 @@ func TestRestoreAllWaitOldIptablesRestore(t *testing.T) {
},
}
runner := newInternal(&fexec, dbus.NewFake(nil, nil), ProtocolIpv4, TestLockfilePath)
defer os.Remove(TestLockfilePath)
defer runner.Destroy()

err := runner.RestoreAll([]byte{}, NoFlushTables, RestoreCounters)
Expand Down Expand Up @@ -1177,6 +1180,7 @@ func TestRestoreAllGrabNewLock(t *testing.T) {
}

runner := newInternal(&fexec, dbus.NewFake(nil, nil), ProtocolIpv4, TestLockfilePath)
defer os.Remove(TestLockfilePath)
defer runner.Destroy()

// Grab the /run lock and ensure the RestoreAll fails
Expand Down Expand Up @@ -1219,6 +1223,7 @@ func TestRestoreAllGrabOldLock(t *testing.T) {
}

runner := newInternal(&fexec, dbus.NewFake(nil, nil), ProtocolIpv4, TestLockfilePath)
defer os.Remove(TestLockfilePath)
defer runner.Destroy()

// Grab the abstract @xtables socket
Expand Down