moby--moby/iptables/iptables_test.go

19 lines
329 B
Go
Raw Normal View History

package iptables
import (
"os"
"testing"
)
func TestIptables(t *testing.T) {
2013-11-05 15:33:07 +00:00
if _, err := Raw("-L"); err != nil {
t.Fatal(err)
}
path := os.Getenv("PATH")
os.Setenv("PATH", "")
defer os.Setenv("PATH", path)
2013-11-05 15:33:07 +00:00
if _, err := Raw("-L"); err == nil {
t.Fatal("Not finding iptables in the PATH should cause an error")
}
}