diff --git a/pkg/util/iptables/iptables.go b/pkg/util/iptables/iptables.go index 50dce1543c93..7e14a5a273a1 100644 --- a/pkg/util/iptables/iptables.go +++ b/pkg/util/iptables/iptables.go @@ -397,12 +397,18 @@ func (runner *runner) runContext(ctx context.Context, op operation, args []strin iptablesCmd := iptablesCommand(runner.protocol) fullArgs := append(runner.waitFlag, string(op)) fullArgs = append(fullArgs, args...) - klog.V(5).Infof("running iptables: %s %v", iptablesCmd, fullArgs) + klog.V(1).Infof("running iptables: %s %v", iptablesCmd, fullArgs) + var out []byte + var err error if ctx == nil { - return runner.exec.Command(iptablesCmd, fullArgs...).CombinedOutput() + out, err = runner.exec.Command(iptablesCmd, fullArgs...).CombinedOutput() + } else { + out, err = runner.exec.CommandContext(ctx, iptablesCmd, fullArgs...).CombinedOutput() + } + if err != nil { + klog.V(1).Infof("iptables returned %v:\n%s", err, string(out)) } - return runner.exec.CommandContext(ctx, iptablesCmd, fullArgs...).CombinedOutput() - // Don't log err here - callers might not think it is an error. + return out, err } // Returns (bool, nil) if it was able to check the existence of the rule, or diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 6046ce4573ea..21ab21f1144b 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -86,10 +86,7 @@ func RunE2ETests(t *testing.T) { defer logs.FlushLogs() gomega.RegisterFailHandler(e2elog.Fail) - // Disable skipped tests unless they are explicitly requested. - if config.GinkgoConfig.FocusString == "" && config.GinkgoConfig.SkipString == "" { - config.GinkgoConfig.SkipString = `\[Flaky\]|\[Feature:.+\]` - } + config.GinkgoConfig.FocusString = "should recreate its iptables rules if they are deleted" // Run tests through the Ginkgo runner with output to console + JUnit for Jenkins var r []ginkgo.Reporter diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index cdd8e08dfa7d..2ca2775b37f8 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -311,7 +311,7 @@ var _ = SIGDescribe("Networking", func() { }) }) - ginkgo.It("should recreate its iptables rules if they are deleted [Disruptive]", func() { + ginkgo.It("should recreate its iptables rules if they are deleted", func() { framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) framework.SkipUnlessSSHKeyPresent() @@ -382,8 +382,8 @@ var _ = SIGDescribe("Networking", func() { ginkgo.By("verifying that kubelet rules are eventually recreated") err = utilwait.PollImmediate(framework.Poll, framework.RestartNodeReadyAgainTimeout, func() (bool, error) { result, err = e2essh.SSH("sudo iptables-save -t nat", host, framework.TestContext.Provider) + e2essh.LogResult(result) if err != nil || result.Code != 0 { - e2essh.LogResult(result) return false, err }