Extend Iptables interface with SaveInto

This commit is contained in:
Wojciech Tyczynski
2017-05-18 11:51:07 +02:00
parent 028ac8034b
commit bcfae7e1ed
7 changed files with 69 additions and 7 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package testing
import (
"bytes"
"fmt"
"strings"
@@ -78,6 +79,11 @@ func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error) {
return lines, nil
}
func (f *FakeIPTables) SaveInto(table iptables.Table, buffer *bytes.Buffer) error {
buffer.Write(f.Lines)
return nil
}
func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error {
return nil
}