Fix iptables Interface mocking, move Restore/RestoreAll to shared impl

also put TODO for unit tests, move defer file deletion until after file
creation error is checked.
This commit is contained in:
BenTheElder
2015-08-07 19:06:54 -04:00
parent 6b3906b07e
commit 5867fca8bf
2 changed files with 27 additions and 39 deletions

View File

@@ -104,6 +104,22 @@ func (fake *fakeIptables) IsIpv6() bool {
return false
}
func (fake *fakeIptables) Save(table iptables.Table) ([]byte, error) {
return []byte{}, nil
}
func (fake *fakeIptables) SaveAll() ([]byte, error) {
return []byte{}, nil
}
func (fake *fakeIptables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error {
return nil
}
func (fake *fakeIptables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error {
return nil
}
var tcpServerPort int
var udpServerPort int