Commit Graph

874 Commits

Author SHA1 Message Date
Karel Zak 076153f816 tests: don't compare btrfs mount options
We don't control mount options in the mountinfo file and the options
depend on kernel version. It does not make sense to hardcode the
options in the expected outputs.

Note that libmount should be portable enough to be able to work with
all kernel versions. It seems better to check libmount functionality
than kernel mount options formatting.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-08 13:38:36 +01:00
Ruediger Meier 0ab03906c1 tests: improve getopt loop error case
Avoid exit 1 in test scripts. Simplify and complete redirection
to TS_OUPUT.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:36:42 +01:00
Ruediger Meier 06311163e5 tests: getopt2, add function gnu_getopt_clean()
This makes the test compatible to OpenBSD, OSX and musl libc.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:34:51 +01:00
Ruediger Meier 7e604f3c80 tests: don't skip case "output undefined"
Treat missing expected files as empty and let the test fail if
there is non-empty output.

Expected output may be missing in these cases:
 1. forgot to commit the file after changing/adding a (sub)test
 2. a bug in a test where we do tricks with TS_EXPECTED
 3. and most notable if ts_die() is called before a subtest is
    initialized, e.g. in ts_scsi_debug_init()

I always wondered why we don't treat this as FAILED. Now we do
so, ts_finalize and ts_gen_diff looks much cleaner now.

The change discovers that tests with subtest were ignoring the
"non-sub" expected files which had to be fixed. BTW we removed
any zero sized files.

Moreover now we respect diff's return value. In past all test
succeeded when diff was not able to write to diffdir, e.g. when
running tests as normal user after they run as root.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:34:24 +01:00
Ruediger Meier 91aced978b tests: cramfs, fix root group
Sudo may login as group wheel or may use user's original group.
Note that group 0 is not named "root" on all Unix systems.

We have some more tests with similar issues but they are Linux-only
(losetup, scsi_debug). We don't fix them unless somebody complains.

BTW we use hexdump instead of md5sum.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:30:34 +01:00
Karel Zak cd1c5986b8 Merge branch 'tests-results-again' of https://github.com/rudimeier/util-linux
* 'tests-results-again' of https://github.com/rudimeier/util-linux:
  tests: add option --parsable
  tests: --parallel prints results in a single line
2016-03-07 15:55:08 +01:00
Ruediger Meier 855f7f0650 tests: add option --parsable
This is to force the one-line results also for non-parallel case.
We are using it for travis auto-build and on other build farms.

Moreover you can set this (and any other) option globally by env
which is the only way to pass it to make distcheck.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-05 22:19:24 +01:00
Ruediger Meier 2979724f5d tests: --parallel prints results in a single line
Like in non-parallel case we are printing only one line per
(sub)test now. The output lines must contain the full test name
to be useful.

This patch does not change anything for the non-parallel output
format except a bit code cleanup.

BTW changed blkid/low-probe test description to have shorter
lines.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-05 17:43:45 +01:00
Ruediger Meier 716133fc1c tests: minix, add a useful non-root check
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:25:40 +01:00
Ruediger Meier b0dc5809d7 tests: fix minix tests for big endian
You may diff the new .BE files with non-BE file to see whether they
look fine.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:25:26 +01:00
Ruediger Meier 7252874a48 mkfs.minix: fix v2/v3 .badblocks inode number for big endian
For minix v2/v3 on big endian systems the inode number of the unwanted
".badblocks" file was not set to zero. This was introduced when v3 was
added in a2657ae3.

Actually it did not seem to cause any problems but since we zero it out
at all we should do it correctly. Now we zero out the whole directory
entry (inclusive ".badblocks" file name, also for v1). Unfortunately we
have to update the test data checksums.

CC: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:25:10 +01:00
Ruediger Meier 84e324ae65 tests: minix, some corrections and cleanup
- move generic "check_minix_fs_type" tests to the top
 - add some todos/notes about potential issues
 - add "real" badblocks test (-l)
 - don't check sed's but fsck's return value
 - to see debian bug 773892 we would need "-f"
 - add some more hexdumps

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:20:10 +01:00
Ruediger Meier 730f79fc3d tests: minix, use hexdump instead of md5sum
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 02:15:32 +01:00
Ruediger Meier 423ef37592 tests: add logger tests "id _numbers_ with spaces"
Leading spaces are allowed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-21 18:10:09 +01:00
Ruediger Meier 4303124ad5 tests: fix ts_option helpers
These two problems should be fixed now:
  - BSD awk only accepts 1-char field seperator
  - ts_has_option() did not returned "yes" if an option was given
    multiple times

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Ruediger Meier 51658498c4 build-sys: portable usage of find command
- use dot instead of skipping search-path
 - avoid -perm /a+x
 - avoid -path

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:47 +01:00
Ruediger Meier e7fccab111 tests: mkfs.ext3 image-file needs option -F
Maybe on newer systems it's not needed anymore.

CC: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-12 18:08:57 +01:00
Ruediger Meier 6744eedcc7 tests: disable eject for broken kernels
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-12 14:13:37 +01:00
Ruediger Meier 63d14fe939 tests: add some check_test_command requirements
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-12 14:11:29 +01:00
Ruediger Meier 0ec9bba2ca misc-utils: build test_uuidd only if BUILD_UUIDD
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-12 14:11:19 +01:00
Karel Zak 9a18b8bce3 Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux
* 'test-fixes' of https://github.com/rudimeier/util-linux:
  tests: ts_fdisk_clean(), remove optimal iosize
  tests: minor cleanup ts_fdisk_clean()
2016-02-12 13:15:00 +01:00
Stanislav Brabec 5ee870c98c tests: add test for loop option in fstab
Add a new fstab tests which check loop mount of the same source multiple times
in multiple steps.

The test is currently failing, but it should not fail once the triggering bug
will be fixed.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2016-02-12 11:09:04 +01:00
Stanislav Brabec b59c3bf292 tests: fix redirection
Many tests do.
2>&1 >> $TS_OUTPUT
It redirects stdout to $TS_OUTPUT and stderr to stdout.

It could cause unintended ignoring of errors on strerr and false positive result
of the test.

Use
>> $TS_OUTPUT 2>&1
instead to redirect both stdout and stderr to $TS_OUTPUT.

Automatically created by:
cd tests/ts
sed -i 's:2>\&1 >> \$TS_OUTPUT:>> $TS_OUTPUT 2>\&1:g' $(fgrep -rl '2>&1 >> $TS_OUTPUT' .)

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2016-02-12 10:39:14 +01:00
Stanislav Brabec c4af75a84e tests: add btrfs mount tests
btrfs needs a special support in mount. Add a testcase for btrfs specific
problems.

Coverage:
352740e8: bind mounts pointing to btrfs
2cd28fc8: mounting default subvolume
d2f82678: use of "auto"
618a8814: use of "subvolid"

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2016-02-12 10:33:17 +01:00
Karel Zak 8292273fde Merge branch 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit
* 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: update colcrt test expectations
  colcrt: reimplementation
  tests: add colcrt functional tests
2016-02-11 11:59:58 +01:00
Ruediger Meier 01e8c90ca2 tests: ts_fdisk_clean(), remove optimal iosize
It's a pity a pity that we have to remove it. In past our test suite
could discover a kernel bug (4.4). But now they've changed optimal
iosizes on purpose.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-10 21:06:41 +01:00
Ruediger Meier 23d8c55684 tests: minor cleanup ts_fdisk_clean()
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-10 21:06:40 +01:00
Ruediger Meier 3fd1f7711e docs: fix typos found by codespell
Using "codespell" from https://github.com/lucasdemarchi/codespell

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-03 15:10:08 +01:00
Sami Kerola c1ca4fc108
tests: update colcrt test expectations
The reimplementation caused output to change in some corner cases, such as
how binary inputs, long lines with underscores, and white space trimming,
are handled.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-02-02 17:27:28 +00:00
Sami Kerola 5abd5d8aec
tests: add colcrt functional tests
Output formats are based on colcrt before recent asan fixes and magic
constant replace, that are the commits ee24ab6f1..70e3fcf29.  It seems the
fixes caused unintentional, and not detected change to output format - which
to me means colcrt has a regression that got to be part of release v2.27.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-02-02 17:27:28 +00:00
Karel Zak 7ed6a6a00d tests: make swaplabel test more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-26 16:49:39 +01:00
Karel Zak b35831b755 tests: update swapfile output
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-26 16:02:54 +01:00
Boris Egorov 4ec6062678 tests: remove redundant check for NULL [cppcheck]
We set SA_SIGINFO flag, so we should not get NULL.

[tests/helpers/test_sigreceive.c:45] -> [tests/helpers/test_sigreceive.c:47]: (warning) Either the condition 'if(info)' is redundant or there is possible null pointer dereference: info.
2016-01-19 12:59:12 +06:00
Karel Zak 98604ef9f2 tests: fallback for missing TS_DESC
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-05 12:31:32 +01:00
Ruediger Meier 0e0c823874 tests: wipefs fix, ts_init was called too late
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-01-05 12:28:17 +01:00
Ruediger Meier 81b3d7eda5 tests: fix run.sh --parallel=1
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-01-05 12:21:56 +01:00
Ruediger Meier 1cb10736e4 tests: always create sparse image files
This saves about 400M disk I/O and space.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-01-05 12:21:56 +01:00
Ruediger Meier 01b38917ad tests: no more sleep, udevadm settle only
This seems to work nowadays and saves 37s.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-01-05 12:21:55 +01:00
Ruediger Meier 67c78d5f6d tests: use sfdisk --no-reread wherever it's needed
The first BLKRRPART ioctl causes udev events and then second one may
fail, see Discussion
http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/11885

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-01-05 12:21:55 +01:00
Ruediger Meier 6ea6964367 tests: sfdisk/gpt-reorder, add missing results
follow-up 9a17d946

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-10 19:05:29 +01:00
Ruediger Meier ee6c0ca65b tests: skip nonroot before checking for progs in PATH
The least annoying and most useful order is this one:
  1. check for compiled UL commands
  2. check for root
  3. check for loop support
  4. check for external progs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-10 19:05:25 +01:00
Karel Zak 96c6ccd554 Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux
* 'test-fixes' of https://github.com/rudimeier/util-linux:
  tests: use xz instead of bzip2 for blkid images
  tests: add some line tests
  tests: avoid sed -E
2015-12-10 11:18:04 +01:00
Ruediger Meier fdc106a4eb tests: skip BLKDISCARD if unsupported
CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:30 +01:00
Ruediger Meier 45eb5b2917 tests: blkdiscard, check return values
CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:30 +01:00
Ruediger Meier 84918ad0fc tests: use xz instead of bzip2 for blkid images
xz decompression creates sparse files if possible. This saves about 1G
disk space in build directory and a lot I/O and time.

BTW regarding compatibility ... CentOS 7 is the first system I've met
which does not install bzip2 but xz only by default.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 08:40:44 +01:00
Ruediger Meier caad4ded12 tests: add some line tests
regarding e03f29b6 ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-03 01:56:53 +01:00
Ruediger Meier e2142701ac tests: avoid sed -E
GNU sed's -E option for BSD compatibility is relatively new (>=4.2) and
undocumented.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-03 01:54:33 +01:00
Karel Zak 0172ebba52 tests: update ZFS test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 19:08:00 +01:00
Sami Kerola 244d48331e
tests: add uuidd output check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 20:17:07 +01:00
Sami Kerola 4bd90ec864
tests: add uuidgen output check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 20:17:01 +01:00