Commit e7b8f5fa authored by Russ Cox's avatar Russ Cox

path.TestWalk: disable error case if root

(chmod 0 doesn't cause errors for root)

Fixes #22.

R=gri
https://golang.org/cl/152120
parent 87bc9b53
......@@ -233,6 +233,7 @@ func TestWalk(t *testing.T) {
}
checkMarks(t);
if os.Getuid() != 0 {
// introduce 2 errors: chmod top-level directories to 0
os.Chmod(Join(tree.name, tree.entries[1].name), 0);
os.Chmod(Join(tree.name, tree.entries[3].name), 0);
......@@ -258,6 +259,7 @@ func TestWalk(t *testing.T) {
}
// the inaccessible subtrees were marked manually
checkMarks(t);
}
// cleanup
os.Chmod(Join(tree.name, tree.entries[1].name), 0770);
......
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