summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2021-03-09 20:10:16 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-09 20:12:20 -0800
commite0e04814b40f1d4077d1cf6001395bd6a919b288 (patch)
treeed6b51e8493347a7e23e015b5773d82bd5c6aa9e
parent2a888a106da39f1d5e280417e48a05341a41f4dd (diff)
Fix invalid interface conversion in runner
panic: interface conversion: interface {} is syscall.WaitStatus, not unix.WaitStatus goroutine 1 [running]: main.runTestCaseNative(0xc0001fc000, 0xe3, 0xc000119b60, 0x1, 0x1, 0x0, 0x0) test/runner/runner.go:185 +0xa94 main.main() test/runner/runner.go:118 +0x745 PiperOrigin-RevId: 361957796
-rw-r--r--runsc/specutils/namespace.go2
-rw-r--r--test/runner/runner.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/runsc/specutils/namespace.go b/runsc/specutils/namespace.go
index d8b9334c7..69d7ba5c4 100644
--- a/runsc/specutils/namespace.go
+++ b/runsc/specutils/namespace.go
@@ -275,7 +275,7 @@ func MaybeRunAsRoot() error {
}()
if err := cmd.Wait(); err != nil {
if exit, ok := err.(*exec.ExitError); ok {
- if ws, ok := exit.Sys().(unix.WaitStatus); ok {
+ if ws, ok := exit.Sys().(syscall.WaitStatus); ok {
os.Exit(ws.ExitStatus())
}
log.Warningf("No wait status provided, exiting with -1: %v", err)
diff --git a/test/runner/runner.go b/test/runner/runner.go
index 009de5d0c..a8a134fe2 100644
--- a/test/runner/runner.go
+++ b/test/runner/runner.go
@@ -182,7 +182,7 @@ func runTestCaseNative(testBin string, args []string) error {
}
if err := cmd.Run(); err != nil {
- ws := err.(*exec.ExitError).Sys().(unix.WaitStatus)
+ ws := err.(*exec.ExitError).Sys().(syscall.WaitStatus)
return fmt.Errorf("test exited with status %d, want 0", ws.ExitStatus())
}
return nil