Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DEBUG
  • Loading branch information
danwinship committed Nov 20, 2019
1 parent c97baa3 commit b3f688f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 10 additions & 4 deletions pkg/util/iptables/iptables.go
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions test/e2e/e2e.go
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/network/networking.go
Expand Up @@ -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()

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit b3f688f

Please sign in to comment.