Commit 1971e1bd authored by Russ Cox's avatar Russ Cox

os: do not test error case of TestRemoveAll when root

Fixes #22.

R=r1, r
https://golang.org/cl/152073
parent 364e564e
......@@ -104,6 +104,7 @@ func TestRemoveAll(t *testing.T) {
t.Fatalf("Lstat %q succeeded after RemoveAll (second)", path)
}
if Getuid() != 0 { // Test fails as root
// Make directory with file and subdirectory and trigger error.
if err = MkdirAll(dpath, 0777); err != nil {
t.Fatalf("MkdirAll %q: %s", dpath, err)
......@@ -133,6 +134,8 @@ func TestRemoveAll(t *testing.T) {
if perr.Path != dpath {
t.Fatalf("RemoveAll %q failed at %q not %q", path, perr.Path, dpath)
}
}
if err = Chmod(dpath, 0777); err != nil {
t.Fatalf("Chmod %q 0777: %s", dpath, err)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment