Commit Graph

987 Commits

Author SHA1 Message Date
Karel Zak 6ca268eca7 tests: add x86_64-16g lsmem test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 2b68dc7d0d tests: cleanup and update lsmem
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Heiko Carstens 2ae9a58e0d lsmem: add testcase
Add a single s390 specific test case to verify that the contents of
various output formats do not change in incompatible way if the
lsmem code is changed.

This is based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Ruediger Meier fc5fa9036a tests: let lsmod fail silently
This is mostly for non-Linux systems where lsmod is not
even available.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-07 10:51:43 +01:00
Ruediger Meier d289685cac tests: always quote $LODEV
Since there is no error handling in this test $LODEV
may be empty.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-07 10:51:43 +01:00
Ruediger Meier 2be1b27228 tests: replace sleep by udevadm
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
2016-11-07 10:51:43 +01:00
Ruediger Meier e8a7dc4bee tests: udevadm settle before losetup -d
Fails on Debian 7 (wheezy), Kernel 3.2.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
2016-11-07 10:51:43 +01:00
Karel Zak ae02bd0bd7 tests: check for timeout prog
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-03 00:01:23 +01:00
Ruediger Meier ca6d721a01 tests: wait for flock background process
Maybe we should add a --daemonize option to flock to cover
this use case.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-02 16:47:45 +01:00
Karel Zak 10146e56b0 tests: add flock tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-31 14:30:02 +01:00
Karel Zak f4126f98e1 tests: add sfdisk script case-insensitive test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26 14:08:29 +02:00
Karel Zak c95cad2098 Merge branch 'tests-raid1' of https://github.com/rudimeier/util-linux 2016-10-26 10:22:40 +02:00
Karel Zak db449e059d tests: let's follow ts_scsi_debug_rmmod
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25 14:33:08 +02:00
Karel Zak 14dbd60976 Merge branch 'test-rmmod-scsi_debug' of https://github.com/rudimeier/util-linux
* 'test-rmmod-scsi_debug' of https://github.com/rudimeier/util-linux:
  tests: consolidate rmmod scsi_debug
2016-10-25 14:31:23 +02:00
Karel Zak 9e4e2ee31e tests: add another sfdisk script tests
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25 13:43:56 +02:00
Karel Zak 0dcfebf527 tests: add sfdisk Type= and Id= test
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25 12:34:49 +02:00
Karel Zak 81d26db3e1 tests: add GPT attributes parser tests
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25 12:12:49 +02:00
Ruediger Meier 561dedcf3b test: fix raid1 minimum I/O size
Seems this has been changed in kernels >4.4.x or >4.8
from 512 bytes to 64K.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-21 16:37:58 +02:00
Ruediger Meier 5c711ba945 tests: consolidate rmmod scsi_debug
- auto cleanup on test exit
 - Add smart timeout: Newer openSUSE systems on OBS failed to rmmod
   almost always. udevadm settle does not seem to have any affect.
 - now tests will fail if rmmod fails

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-21 15:08:49 +02:00
Karel Zak 25d08572da Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux
* 'test-fixes' of https://github.com/rudimeier/util-linux:
  build-sys: fix missing ncursesw message
  tests: avoid &>> for bash compatibility
2016-10-21 13:34:28 +02:00
Ruediger Meier 39f948942b tests: avoid &>> for bash compatibility
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-20 18:32:21 +02:00
Karel Zak d22f7f7c1e tests: call umount --fake for tmpfs tests
On old systems (e.g. RHEL6) with /sbin/mount.tmpfs the mtab file is
modified although our in-tree mount does not support mtab file. We
need to call umount --fake to be sure that we remove unwanted lines
from the test.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-20 18:27:24 +02:00
Karel Zak 1c5381de55 tests: update build-sys expected output
The su(1) change based on libseccomp has been reverted.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19 14:21:15 +02:00
Karel Zak 39d726cef2 tests: (cramfs) check for test_sysinfo
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 15:53:19 +02:00
Karel Zak 8b641fd6a2 tests: add chrt vs. nice test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-03 12:06:55 +02:00
Karel Zak c9a11fe892 tests: update build-sys tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 10:29:00 +02:00
Stanislav Brabec a0a8e98844 tests: Add helper for TIOCSTI exploit
This helper/exploit injects "id -u -n\n" to the vulnerable calling terminal.

Use id -u -n to get a reproducible output of test cases based on it.

What can happen:

Nothing, no exploit: pty is not accessible, sedsid() disconnected the task from
pty, TIOCSTI failed.

The command is injected to the unprivileged environment pty, and you see e. g.
"nobody": This is acceptable.

The command is injected to the caller (privileged) pty, and you see "root" (or
caller uid name): This is not acceptable and has security implications.

References:

CVE-2016-2779
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2779
http://seclists.org/oss-sec/2016/q1/448
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815922
https://bugzilla.redhat.com/show_bug.cgi?id=173008
https://bugzilla.suse.com/show_bug.cgi?id=968674
https://bugzilla.suse.com/show_bug.cgi?id=968675

CVE-2016-2781
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2781
http://seclists.org/oss-sec/2016/q1/452

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Federico Bento <up201407890@alunos.dcc.fc.up.pt>
2016-09-29 14:24:00 +02:00
Igor Gnatenko 2889fb2da9 trivial: use tabs consistently
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-20 15:36:55 +02:00
Karel Zak 695fd479be tests: add columns separator to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 14:18:01 +02:00
Karel Zak 4a2b50f238 tests: add export and raw to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:49:37 +02:00
Karel Zak 0c3e7a0131 tests: add libsmartcols JSON test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:37:08 +02:00
Karel Zak 73bcb64f1a tests: add libsmartcols wrap and wrapnl tree tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:32:58 +02:00
Karel Zak 63a79e75ec tests: add tree libsmartcols test files
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:25:08 +02:00
Karel Zak 18ff51547d libsmartcols: add support for trees to the sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:12:18 +02:00
Karel Zak 280fe9c901 tests: add missing expected/ dir stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 17:02:54 +02:00
Karel Zak 36eb51ebb4 tests: add libsmartcols title test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:49:46 +02:00
Karel Zak 8fe4724568 tests: add another libsmartcols tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:38:34 +02:00
Karel Zak a414a17093 tests: improve libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 14:12:11 +02:00
Karel Zak fa4691833a libsmartcols: add application to test library features
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 13:08:02 +02:00
Karel Zak 2862bda919 tests: update sfdisk output strings
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-01 11:43:42 +02:00
Karel Zak 0e0e167704 tests: fix losetup tests for --nooverlap
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-17 13:54:34 +02:00
Stanislav Brabec 912d50b3be tests: Add losetup-loop test suite
Add losetup loop test suite that tests proper behavior of conflicting and
re-used loop devices.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2016-08-17 13:02:35 +02:00
Karel Zak f066f32aae tests: keep 'hppa' in fdisk/bsd test too
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-16 13:40:44 +02:00
Helge Deller 569ad28288 tests: really fix fdisk/bsd for hppa
Finally fix the bsd testcase on the hppa architecture.

Commit 1b7be556e5 tried to fix it,
but missed the fact that "uname -m" returns "parisc" or "parisc64"
instead of "hppa*".

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: 827225@bugs.debian.org
2016-08-16 13:36:12 +02:00
Karel Zak 8c4ae2fd48 tests: mark build-in paths test as optional
The test makes sense only if you know what are you doing (see
 #ifdef(s) in the include/pathnames.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-12 10:13:22 +02:00
Filipe Brandenburger 727c689908 libmount: Preserve empty string value in optstr parsing
Recent mount (since the switch to libmount in v2.22) drops the '=' in
mount options that are set to an empty value.  For example, the command
line below will be affected:

  # mount -o rw,myopt='' -t tmpfs tmpfs /mnt/tmp

Fix that by preserving an empty string in the options passed to the
mount(2) syscall when they are present on the command line.

Add test cases to ensure empty string handling is working as expected
and in order to prevent regressions in the future.

Also tested manually by stracing mount commands (on a kernel which
accepts a special extra option, for testing purposes.)

Before this commit:

  # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp
  mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myarg") = -1 EINVAL (Invalid argument)

After this commit:

  # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp
  mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myopt=") = 0

All test cases pass, including newly added test cases.  Also checked
them with valgrind using:

  $ tests/run.sh --memcheck libmount/optstr

Fixes #332.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2016-08-10 13:59:52 -07:00
Filipe Brandenburger 7cd6d50aa9 tests: Allow running a single test case from tests/run.sh
Tested by running `tests/run.sh libmount/optstr` successfully.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2016-08-10 13:59:31 -07:00
Filipe Brandenburger 88a5f90e87 tests: Use proper word splitting when executing tests
Use the shell special variable "$@" instead of the inferior $* to
execute the test command in ts_valgrind.  The expansion of "$@" respects
proper word splitting and makes it possible to pass the command empty
arguments.  It might also prevent surprises with quoting in corner
cases.

Tested that `make check` passes.

Valgrind run with `make check TS_OPTS='--nonroot --memcheck'` passes.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2016-08-10 13:37:43 -07:00
Karel Zak d4e89dea4e libmount: ignore redundant slashes
///aaa/bbb and /aaa/bbb/ are the same paths. This is important
especially with NFS where number of slashes are not the same in
the /proc/self/mountinfo and fstab or utab. The regular URI is

 euler://tmp

but /proc contains

 euler:/tmp

Reported-by: Ales Novak <alnovak@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-08 17:23:54 +02:00
Karel Zak 041d33734e tests: fix loop-overlay test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-04 15:15:12 +02:00