summaryrefslogtreecommitdiff
path: root/tests/rm/ext3-perf
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-08-30 14:13:12 +0200
committerJim Meyering <meyering@redhat.com>2012-08-30 18:55:59 +0200
commit9eb4c31eb78c28dd9f72d1cbb940270311be343c (patch)
treeea3078bc1b002a9f948ed41445ca32318002a1d3 /tests/rm/ext3-perf
parent00f5ba15dd91a3d9780fe1fbd06a4df436ae6714 (diff)
downloadcoreutils-9eb4c31eb78c28dd9f72d1cbb940270311be343c.tar.xz
tests: add .sh and .pl suffixes to shell and perl tests, respectively
Not only this shrinks the size of the generated Makefile (from > 6300 lines to ~3000), but will allow further simplifications in future changes. * tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'. (PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to $(LOG_COMPILER) for the time being. (TESTS, root_tests): Adjust as described. * All tests: Rename as described.
Diffstat (limited to 'tests/rm/ext3-perf')
-rwxr-xr-xtests/rm/ext3-perf83
1 files changed, 0 insertions, 83 deletions
diff --git a/tests/rm/ext3-perf b/tests/rm/ext3-perf
deleted file mode 100755
index 97b0a17b3..000000000
--- a/tests/rm/ext3-perf
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-# ensure that "rm -rf DIR-with-many-entries" is not O(N^2)
-
-# Copyright (C) 2008-2012 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
-print_ver_ rm
-
-very_expensive_
-
-# Using rm -rf to remove a 400k-entry directory takes:
-# - 9 seconds with the patch, on a 2-yr-old system
-# - 350 seconds without the patch, on a high-end system (disk 20-30% faster)
-threshold_seconds=60
-
-# The number of entries in our test directory.
-n=400000
-
-# Choose a value that is large enough to ensure an accidentally
-# regressed rm would require much longer than $threshold_seconds to remove
-# the directory. With n=400k, pre-patch GNU rm would require about 350
-# seconds even on a fast disk. On a relatively modern system, the
-# patched version of rm requires about 10 seconds, so even if you
-# choose to enable very expensive tests with a disk that is much slower,
-# the test should still succeed.
-
-# Skip unless "." is on an ext[34] file system.
-# FIXME-maybe: try to find a suitable file system or allow
-# the user to specify it via an envvar.
-df -T -t ext3 -t ext4dev -t ext4 . \
- || skip_ 'this test runs only on an ext3 or ext4 file system'
-
-# Skip if there are too few inodes free. Require some slack.
-free_inodes=$(stat -f --format=%d .) || framework_failure_
-min_free_inodes=$(expr 12 \* $n / 10)
-test $min_free_inodes -lt $free_inodes \
- || skip_ "too few free inodes on '.': $free_inodes;" \
- "this test requires at least $min_free_inodes"
-
-ok=0
-start=$(date +%s)
-mkdir d &&
- cd d &&
- seq $n | xargs touch &&
- test -f 1 &&
- test -f $n &&
- cd .. &&
- ok=1
-test $ok = 1 || framework_failure_
-setup_duration=$(expr $(date +%s) - $start)
-echo creating a $n-entry directory took $setup_duration seconds
-
-# If set-up took longer than the default $threshold_seconds,
-# use the longer set-up duration as the limit.
-test $threshold_seconds -lt $setup_duration \
- && threshold_seconds=$setup_duration
-
-start=$(date +%s)
-timeout ${threshold_seconds}s rm -rf d; err=$?
-duration=$(expr $(date +%s) - $start)
-
-case $err in
- 124) fail=1; echo rm took longer than $threshold_seconds seconds;;
- 0) ;;
- *) fail=1;;
-esac
-
-echo removing a $n-entry directory took $duration seconds
-
-Exit $fail