diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-14 11:24:56 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-14 11:24:56 -0700 |
commit | 3be8b49c703e5b9b692fbce74946bc3e84f8dbbb (patch) | |
tree | 44f1098144133983f2032a3a52153ea5d8cc26c5 /test/iptables/runner/main.go | |
parent | e6ea59203ba6e9c0431999463795a2c14036053f (diff) | |
parent | 805a96d7ba78762a3bb96bb1cc9e32ccc569437a (diff) |
Merge pull request #3375 from kevinGC:ipt-test-early-return
PiperOrigin-RevId: 326693922
Diffstat (limited to 'test/iptables/runner/main.go')
-rw-r--r-- | test/iptables/runner/main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/iptables/runner/main.go b/test/iptables/runner/main.go index 69d3ef121..9ae2d1b4d 100644 --- a/test/iptables/runner/main.go +++ b/test/iptables/runner/main.go @@ -16,6 +16,7 @@ package main import ( + "context" "flag" "fmt" "log" @@ -46,7 +47,9 @@ func main() { } // Run the test. - if err := test.ContainerAction(ip, *ipv6); err != nil { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + if err := test.ContainerAction(ctx, ip, *ipv6); err != nil { log.Fatalf("Failed running test %q: %v", *name, err) } |