Files
docker-cli/components/engine/integration/iptables_test.go
Solomon Hykes d5d32a285c Move utility package 'iptables' to pkg/iptables
Upstream-commit: 7799ae27ca1dd85761f0595346a0dda15bbeda6c
Component: engine
2014-01-06 15:41:24 -08:00

23 lines
512 B
Go

package docker
import (
"github.com/dotcloud/docker/pkg/iptables"
"os"
"testing"
)
// FIXME: this test should be a unit test.
// For example by mocking os/exec to make sure iptables is not actually called.
func TestIptables(t *testing.T) {
if _, err := iptables.Raw("-L"); err != nil {
t.Fatal(err)
}
path := os.Getenv("PATH")
os.Setenv("PATH", "")
defer os.Setenv("PATH", path)
if _, err := iptables.Raw("-L"); err == nil {
t.Fatal("Not finding iptables in the PATH should cause an error")
}
}