Skip to content

Commit 0c6dbd9

Browse files
committed
os: fix Root tests on Plan9
Fixes #70484 Change-Id: I609834aca3e97bf494565da513cd2b8a83123c89 Reviewed-on: https://go-review.googlesource.com/c/go/+/630216 Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 5a22174 commit 0c6dbd9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/os/root_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ func (test rootConsistencyTest) run(t *testing.T, f func(t *testing.T, path stri
810810
if f := test.detailedErrorMismatch; f != nil {
811811
detailedErrorMismatch = f(t)
812812
}
813+
if runtime.GOOS == "plan9" {
814+
// Plan9 syscall errors aren't comparable.
815+
detailedErrorMismatch = true
816+
}
813817
if !detailedErrorMismatch && e1.Err != e2.Err {
814818
t.Errorf("with root: err=%v", e1.Err)
815819
t.Errorf("without root: err=%v", e2.Err)
@@ -1143,9 +1147,11 @@ func TestRootRaceRenameDir(t *testing.T) {
11431147
// and then rename a directory near the root.
11441148
time.Sleep(avg / 4)
11451149
if err := os.Rename(dir+"/base/a", dir+"/b"); err != nil {
1146-
// Windows won't let us rename a directory if we have
1150+
// Windows and Plan9 won't let us rename a directory if we have
11471151
// an open handle for it, so an error here is expected.
1148-
if runtime.GOOS != "windows" {
1152+
switch runtime.GOOS {
1153+
case "windows", "plan9":
1154+
default:
11491155
t.Fatal(err)
11501156
}
11511157
}

0 commit comments

Comments
 (0)