Commit Graph

105 Commits

Author SHA1 Message Date
Gilles Espinasse
ab7009888e procps-ng : tests, remove which dependency
which is a separate package that may not be available and is not yet build on Linux from scratch build order.
Instead use posix command -v. command -v  is a builtin working with bash-4.2, 3.0.25 or even old bash-2.05 or current debian dash

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2013-05-26 07:30:16 +10:00
Gilles Espinasse
53b253b75a skip kill test too if running runtest
I find more readable instead of make check to run
cd testsuite && make site.exp && DEJAGNU=global-conf.exp runtest

But in that case, kill.exp was still trying to run with
ERROR: tcl error sourcing ./kill.test/kill.exp.
ERROR: couldn't execute "/usr/src/procps-ng-3.3.7/kill": no such file or
directory
...

Simply return from test if kill is not build

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2013-05-26 07:25:55 +10:00
Pierre Labastie
1b63eb8671 Improved regexp test for pmap
The change in pmap is necessary if it happens that the whole output of
pmap -X or -XX has been done before the second regexp is matched. Since
the matching is greedy, it is matched by the full output, so that
nothing is left for the third regexp and the test fails with
FAIL: extra extended output (footer).

Reference: http://comments.gmane.org/gmane.linux.lfs.devel/13961

Signed-off-by: Craig Small <csmall@enc.com.au>
2013-04-07 18:31:26 +10:00
Gilles Espinasse
a059034856 Revert "Fixed last_value for loops over 99999"
This reverts bogus commit 2840d7f4c6.
99 was already added with 7f15f07b3f

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2013-04-07 08:30:48 +10:00
Craig Small
2840d7f4c6 Fixed last_value for loops over 99999
For large loops, the value 999,999 was big, but not big enough.

References: http://www.linuxfromscratch.org/lfs/view/development/chapter06/procps-ng.html
2013-03-25 21:56:23 +11:00
Craig Small
0696570a94 Conditionally test kill when we compile it 2013-03-25 21:46:17 +11:00
Jim Warner
f85439e42d pmap: restore a proper response when arguments missing
Ever since pmap was refactored via the reference below
(and sprinkled with those damn tabs), the response for
the absence of any argument has been an error message.

This patch restores the proper behavior ('usage' text)
and updates the dejagnu 'no arguments' expect pattern.

Reference(s):
commit d50884788d

Signed-off-by: Jim Warner <james.warner@comcast.net>
2013-03-18 18:42:07 +01:00
Jaromir Capik
7f15f07b3f testsuite: increasing the upper limit of permitted values
This commit increases the upper limit of permitted values
in the expect_table_dsc procedure from 999,999 to 99,999,999.
The previous value was insufficient and causing the slabtop test
to fail on build systems where the number of objects exceeds
one milion.
2013-03-14 14:31:03 +01:00
Jim Warner
fe75e26ab6 miscellaneous: clean up trailing whitespace throughout
The entire tree's polluted with inappropriate trailing
whitespace. This commit rids our environment of all of
those useless keystrokes. Unfortunately, it sure ain't
a permanent solution and requires every contributor to
instruct their editor(s) to prevent or eliminate them.

Plus it's strongly recommended we all insert something
like what's shown below to our '.gitconfig' file so as
to provide at least some warnings when we try to apply
any patches (git am) that do contain the #@!%& things!

References(s):
~/.gitconfig excerpt ---------------------------------
[core]
  whitespace = trailing-space, space-before-tab, blank-at-eof
[apply]
  whitespace = warn
--------------------------------- ~/.gitconfig excerpt

Signed-off-by: Jim Warner <james.warner@comcast.net>
2013-03-14 12:36:47 +01:00
Craig Small
0e6e79522b test for previous commit
Add a test routine to test for --since option added to uptime in
previous commit
2012-12-26 23:21:44 +11:00
Craig Small
1f1201f896 Added pmap -X and -XX tests
The two extra extended pmap options were not tested previously.
We test against our known process and process 1 which we should
not be able to get data for.

Unfortunately, the tests cannot catch SEGSEGVs but they should.

Signed-off-by: Craig Small <csmall@enc.com.au>
2012-12-24 10:05:24 +11:00
Wouter van Kesteren
cfd0dbd336 ps.test: see truncated user/group names as valid
With ps now truncating the names instead of chaning to UIDs for long
usernames, the check needs to be updated too
2012-12-13 21:45:28 +11:00
Craig Small
ee03bb92cb Add missing fileutils test files
Reference: http://www.freelists.org/post/procps/procpsng-version-334-released,7

Signed-off-by: Craig Small <csmall@enc.com.au>
2012-10-31 22:47:48 +11:00
Craig Small
ff6c8aad3e Added debian patch for kfreebsd bug 674785 2012-10-30 21:36:04 +11:00
Alfredo Esteban
f12277c74d Debian Bug report #526355
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526355

Flag -f doesn't modify output anymore.

There is a new flag -a to show full command line processes.

Signed-off-by: Alfredo Esteban <aedelatorre@gmail.com>
2012-08-29 16:47:51 +10:00
Craig Small
30d5db1a8d Set the locale to C.
Some checks will fail due to different locales. For example 1.2 will
become 1,2 so the match fails.  Problem reported by Alfredo Esteban
with fix suggested by Mike Frysinger
2012-06-30 16:43:17 +10:00
Gilles Espinasse
664eaaebc6 Run pgrep and pkill tests whithout host ps
When ps is not available (like it may happen in a chroot), pgrep.exp and pkill.exp tests fail.
Use just build ps instead.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-06-28 21:53:22 +10:00
Sami Kerola
af271cf8c8 tests: add pkill test to catch signal option order regressions
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-24 14:40:02 +02:00
Sami Kerola
e730a6b4dc tests: enable basic pkill test
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-24 14:39:20 +02:00
Steven Chamberlain
a5ba6b98c1 Description: fix to build on non-Linux arches
Fix the build where it seems a code fix for Linux was likely untested
on other systems.
Define SCHED_BATCH in test-schedbatch, for systems that don't have it;
the corresponding RH BZ#741090 patch used the magic value 3 in output.c
anyway.

Bug-Debian: http://bugs.debian.org/677055
2012-06-11 22:11:23 +10:00
Gilles Espinasse
be1bb68c55 Fix pmap -x test in when sizeof(KLONG) != 8
-x test should have work only in sizeof(KLONG) == 8 case where 3 numbers are printed
In sizeof(KLONG) != 8, only one number and three '-' are printed, so allow '-' character

I am compiling x86 32bits userspace, so I should be in (sizeof(KLONG) != 8) case

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-05-08 22:55:23 +10:00
Gilles Espinasse
e6bc629756 Fix w tests when no user is logged in
When the build system is a chroot with no user logged in , all w tests fail because of {1,} match rule for the userline
Allow 0 match replacing {1,} with *

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-05-08 22:51:19 +10:00
Jim Warner
421b08a4df all: fix misspellings in docs and program comments
We might as well join the coreutils and util-linux
projects in correcting our own typos.

The following was left unchanged:
   top/top.c[1797]: thru -> "through"

references:
http://lists.gnu.org/archive/html/coreutils/2012-04/msg00057.html
http://marc.info/?l=util-linux-ng&m=133518057419736&w=2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2012-04-25 13:46:02 +10:00
Sami Kerola
beab98a036 tests: do not assume sleep command path
The testsuite failed on archlinux which has sleep in /usr/bin/
instead of /bin/ directory.  This commit will make expect to use
$PATH to determine where sleep is.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-16 20:25:23 +02:00
Sami Kerola
f97fd76667 tests: add lib/ contents to make check
This will take tests in following commits in use.

commit 56ed9826a5
commit c7cf98b0e0

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-06 15:32:57 +02:00
Sami Kerola
c7cf98b0e0 lib: add fileutils file with stream error checking facility
The close_stream() is copied from GNU lib. Inspiration to do this
is talk by Jim Meyering - Goodbye World! The perils of relying on
output streams in C.

Reference: http://www.irill.org/events/ghm-gnu-hackers-meeting/videos/jim-meyering-goodbye-world-the-perils-of-relying-on-output-streams-in-c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-23 15:57:41 +01:00
Sami Kerola
00744108c6 docs: add testsuite readme file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-03 18:36:29 +11:00
Sami Kerola
56ed9826a5 test: add lib/strutils check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-03 18:36:29 +11:00
Craig Small
502a79e02f Merge remote-tracking branch 'sami/to-craig' into sami-merge
Conflicts:
	pgrep.c
	w.c
2012-03-03 13:56:32 +11:00
Craig Small
a15520db8c ps abort causes problems in testsuite
Under certain circumstances, using abort() when either make check
or make distcheck puts ps into an infinite loop around the
function catastrophic_failure() in ps and the C library raise
and abort functions.

Using exit removes this problem and does almost the same thing.
2012-03-03 11:49:48 +11:00
Craig Small
82c6fccacb fixed uptime check regexp 2012-03-02 23:05:28 +11:00
Sami Kerola
4d8f9522a7 tests: fix dejagnu pwdx and vmstat checks
The pwdx check expected error message, which where in use for only
short period of time.  The old message was put in place in commit
9d47cb0c38

The vmstat issue was triggered by 'sr0' cdrom device, which gives
following unexpected output.  Fix simply ignores partitions which has
zero activity.  Besides such partitions probably would not apply as
good candidate of -p option anyway.

$ vmstat -p sr0
Partition was not found

Reported-By: Moritz Muehlenhoff <jmm@debian.org>
Bug-Debian: http://bugs.debian.org/656508
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-11 21:42:21 +01:00
Jim Warner
3ad8fd56ed vmstat: slabinfo (-m option) test disabled if not readable
The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions.  This commit provides the same check
for vmstat under its -m (slabinfo) option.
2012-01-14 00:04:46 +11:00
Mike Fleetwood
23d2e0b0b7 tests: add SCHED_BATCH test
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=741090
Acked-by:: Jaromir Capik <jcapik@redhat.com>
Acked-by:  Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
2012-01-09 21:37:41 +01:00
Craig Small
5219a9c453 Check for 0 repeat count and tests in free
free checks for -c 0 now too.
testsuite has new checks for the checks.
2012-01-04 10:07:31 +11:00
Craig Small
532dc9239d Updated testsuite files for new NLS output 2012-01-02 17:39:41 +11:00
Craig Small
f9ab2fec43 Added Debian bug note for pgrep -u and testsuite
Makefile.am testsuite needed to explicitly state the files because while
everything else works, make distcheck fails.

NEWS got updated with the Debian bug number for pgrep -u
2011-12-06 21:37:45 +11:00
Craig Small
db602e1d44 slabtop check has optional spaces at start of line
There is a race condition between expect script consuming the output
from slabtop. There were a sequences of lines that looked like
^\d+ ... \s*
with the last \s* consuming the first space on the start of the line.
However if the line takes too long to print, then expect stops there and
the space at the start of the subsquent line does not match.

The solution is a \s* at the start ofthe line.
2011-12-04 22:08:23 +11:00
Sami Kerola
5277341278 tests: clean up kill temporary file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-03 20:20:27 +01:00
Sami Kerola
adab19653a build-sys: site.exp does not need to be in dist package
The file is automatically generated by make.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-03 20:20:27 +01:00
Sami Kerola
9d6dc4d8c3 build-sys: simplify tests EXTRA_DIST configuration
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-03 20:20:27 +01:00
Sami Kerola
03a1a42e28 build-sys: make DEJATOOL definition uncondictional
Fix to ./autogen.sh error bellow.

/usr/share/automake-1.11/am/dejagnu.am: DEJATOOL was already defined in condition LINUX, which is included in condition TRUE ...
testsuite/Makefile.am:6: ... `DEJATOOL' previously defined here

Reference: http://www.freelists.org/post/procps/procpsng-331-nearly-there,5
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-03 20:20:14 +01:00
Craig Small
e7a0fe5bee Fixing tests due to some results
Makefile will now only test for Linux systems, a work around in the
makefile due to some silly redefine restrictions.

uptime and w now won't error due to being one user logged in, thanks to
Sami for the patch

kill processes by pid test commented out due to false negatives

pwdx process 1 check also commented out due to false negatives
2011-12-04 00:50:36 +11:00
Craig Small
3d807ae853 Minor test fixes for non-linux
procps works well on Linux, on other arches there are some strange
differences due to their emulation of procfs which is not 100%
Disabling checks for non-linux until that can be sorted out.
2011-12-03 00:32:14 +11:00
Craig Small
226c1f2a6f Added slabtop tests 2011-12-02 22:41:03 +11:00
Craig Small
23afed732a fixed small tests for pmap and ps checks 2011-12-01 22:42:23 +11:00
Craig Small
f05e15e830 More testing added for procps 2011-11-30 23:11:35 +11:00
Craig Small
261a3fae83 fixed pgrep and added ps tests 2011-11-29 22:55:03 +11:00
Craig Small
b36fe6efc5 Add sysctl check and tests to extra_dist 2011-11-28 22:02:27 +11:00
Craig Small
919e37787e added uptime and vmstat tests 2011-11-27 19:12:56 +11:00
Craig Small
5c48d8b79a rearranged testsuite 2011-11-27 18:32:10 +11:00
Craig Small
2cad7c5667 more free tests and pgrep tests
Almost fully testing all features of pgrep now.
free had additional tests added to it
2011-11-27 15:30:04 +11:00
Craig Small
49c99b1189 Additional tests for free command 2011-11-24 23:06:06 +11:00
Craig Small
82eafe3fe8 new free commands 2011-11-23 22:48:49 +11:00
Craig Small
451f6e6111 testsuite fixes 2011-11-23 21:44:51 +11:00