|
@@ -2,9 +2,22 @@ package docker
|
|
|
|
|
|
import (
|
|
|
"net"
|
|
|
+ "os"
|
|
|
"testing"
|
|
|
)
|
|
|
|
|
|
+func TestIptables(t *testing.T) {
|
|
|
+ if err := iptables("-L"); err != nil {
|
|
|
+ t.Fatal(err)
|
|
|
+ }
|
|
|
+ path := os.Getenv("PATH")
|
|
|
+ os.Setenv("PATH", "")
|
|
|
+ defer os.Setenv("PATH", path)
|
|
|
+ if err := iptables("-L"); err == nil {
|
|
|
+ t.Fatal("Not finding iptables in the PATH should cause an error")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func TestNetworkRange(t *testing.T) {
|
|
|
// Simple class C test
|
|
|
_, network, _ := net.ParseCIDR("192.168.0.1/24")
|