From da924fc337f760cff055202a75e637d84f422bed Mon Sep 17 00:00:00 2001 From: Shyam Jeedigunta Date: Tue, 16 May 2017 00:56:58 +0200 Subject: [PATCH] Make fake iptables' Save operation more realistic --- pkg/util/iptables/testing/fake.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/util/iptables/testing/fake.go b/pkg/util/iptables/testing/fake.go index 863f4e0aed1..16cd90ba306 100644 --- a/pkg/util/iptables/testing/fake.go +++ b/pkg/util/iptables/testing/fake.go @@ -72,8 +72,10 @@ func (*FakeIPTables) IsIpv6() bool { return false } -func (*FakeIPTables) Save(table iptables.Table) ([]byte, error) { - return make([]byte, 0), nil +func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error) { + lines := make([]byte, len(f.Lines)) + copy(lines, f.Lines) + return lines, nil } func (*FakeIPTables) SaveAll() ([]byte, error) {