1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-18 13:21:58 +02:00

Avoid test failures when root (/) is not readable.

* tests/test-lib.sh (require_readable_root_): New function.
* tests/misc/pwd-long: Skip this test when / is unreadable.
* tests/du/slash: Likewise.
This is required at least for Mandrake/Mandriva in "secure" mode.
Reported by Theodoros V. Kalamatianos in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12800
This commit is contained in:
Jim Meyering
2008-02-23 23:22:58 +01:00
parent a15329798c
commit f656cafd4c
3 changed files with 9 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# `du /' would omit the `/' on the last line.
# Copyright (C) 2003, 2004, 2006-2007 Free Software Foundation, Inc.
# Copyright (C) 2003, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@ if test "$VERBOSE" = yes; then
fi
. $srcdir/../test-lib.sh
require_readable_root_
fail=0

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that pwd works even when run from a very deep directory.
# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
. $srcdir/../require-perl
. $srcdir/../test-lib.sh
require_readable_root_
ARGV_0=$0
export ARGV_0

View File

@@ -39,6 +39,11 @@ require_ulimit_()
&& skip_test_ "this shell lacks ulimit support"
}
require_readable_root_()
{
test -r / || skip_test_ "/ is not readable"
}
# Skip the current test if strace is not available or doesn't work.
require_strace_()
{