summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-05-12 14:49:13 +0100
committerPádraig Brady <P@draigBrady.com>2014-05-13 23:23:30 +0100
commitcbfb34c7d32e888b39e03a51a374ed664e9fa31b (patch)
treeff66b3e76041157c883fcc9db8f3f1dfbed22ce2 /tests
parentfb902297f536df060ff10ef06bb8fe6cfe0c845e (diff)
downloadcoreutils-cbfb34c7d32e888b39e03a51a374ed664e9fa31b.tar.xz
df: ignore non file system entries in /proc/mounts
Linux with network namespaces contains entries in /proc/mounts like: proc net:[4026532464] proc rw,nosuid,nodev,noexec,relatime 0 0 resulting in a failure to stat 'net:[...]', inducing a warning and an exit with failure status. * src/df.c (get_dev): Ignore all relative mount points. * tests/df/skip-duplicates.sh: Add an entry to test relative dirs.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/df/skip-duplicates.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/df/skip-duplicates.sh b/tests/df/skip-duplicates.sh
index d872f27fc..44f7d4ca7 100755
--- a/tests/df/skip-duplicates.sh
+++ b/tests/df/skip-duplicates.sh
@@ -56,6 +56,7 @@ struct mntent *getmntent (FILE *fp)
{.mnt_fsname="/fsname", .mnt_dir="/"},
{.mnt_fsname="virtfs", .mnt_dir="/NONROOT"},
{.mnt_fsname="virtfs", .mnt_dir="/NONROOT"},
+ {.mnt_fsname="netns", .mnt_dir="net:[1234567]"},
};
if (done == 1)
@@ -68,7 +69,7 @@ struct mntent *getmntent (FILE *fp)
if (done == 1 && !getenv ("CU_TEST_DUPE_INVALID"))
done++; /* skip the first entry. */
- while (done++ <= 6)
+ while (done++ <= 7)
{
mntents[done-2].mnt_type = "-";
if (STREQ (mntents[done-2].mnt_dir, "/NONROOT"))