]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: accept permission errors in TestExecPtrace
authorElias Naur <mail@eliasnaur.com>
Sun, 16 Jun 2019 15:05:11 +0000 (17:05 +0200)
committerElias Naur <mail@eliasnaur.com>
Sun, 16 Jun 2019 20:04:54 +0000 (20:04 +0000)
Fixes the test on the linux-arm64-packet builder.

Change-Id: Icaf9edf9542f4f6e3791ca43298a1e7051eaa576
Reviewed-on: https://go-review.googlesource.com/c/go/+/182378
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/syscall/syscall_ptrace_test.go

index dd1f084fcb68ea47715a788684deb1ad0ddc0411..6b7f54dcfd5c8d3881aad5b57d50187d916dd622 100644 (file)
@@ -28,8 +28,10 @@ func TestExecPtrace(t *testing.T) {
                },
        }
        proc, err := os.StartProcess(bin, []string{bin}, attr)
-       if err != nil {
+       if err == nil {
+               proc.Kill()
+       }
+       if err != nil && !os.IsPermission(err) {
                t.Fatalf("StartProcess with ptrace enabled failed: %v", err)
        }
-       proc.Kill()
 }