Ruediger Meier [Thu, 15 May 2014 11:20:31 +0000 (13:20 +0200)]
tests, add function ts_mount
We want to generalize mounts similar to how we do it already in
minix/mkfs. Currently most of our other checks just fail if
"fs not supported".
Note that the new function checks a bit stronger than before in
minix/mkfs. It respects mount's return value and stderr goes
to $TS_OUTPUT too.
It's a bit ugly that we write to $TS_OUTPUT from inside of the
function. But if the caller would do it then we couldn't
ts_skip and the whole function would be pointless.
Karel Zak [Wed, 14 May 2014 12:15:58 +0000 (14:15 +0200)]
Merge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux
* 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux:
travis-ci: enable root checks
travis-ci: minor cleanup and speedup
tests: introduce TS_CMD_UUIDGEN (never use installed one)
tests, don't write TS_DEVICE to stdout anymore
tests: ts_scsi_debug_init must not run in a subshell
tests: cleanup ts_scsi_debug_init
tests: some more tests need loop support
tests: ts_device_init requires loop support
tests: use ts_check_losetup in losetup test
tests: add function ts_check_losetup
tests: ts_device_init remove useless error handling
Karel Zak [Wed, 14 May 2014 11:19:37 +0000 (13:19 +0200)]
Merge branch 'tests-known' of https://github.com/rudimeier/util-linux
* 'tests-known' of https://github.com/rudimeier/util-linux:
tests, script/race is known to fail
tests: script/race would work with variable loop count
tests: ipcs/limits2 is known to fail
tests: fix hexdump for big endian
tests, add missing output for hexdump
tests: fix hexdump, add ts_finalize
tests: fix "KNOWN FAILED" for subtests
Ruediger Meier [Tue, 13 May 2014 11:19:22 +0000 (13:19 +0200)]
tests: fix hexdump for big endian
For now endianess dependent subtests have undefined output on
BE systems until sombody re-checks this and provides expected
output files with .BE suffix.
Ruediger Meier [Sun, 11 May 2014 06:50:28 +0000 (08:50 +0200)]
tests: ts_scsi_debug_init must not run in a subshell
ts_skip and ts_die won't work from subshell. Now we simply use
TS_DEVICE which is globally set in that function.
I've made sure that we never change TS_DEVICE variable after
we've got it. So we could use it again for cleanup on exit in
ts_{finalize,die,skip} functions.
Karel Zak [Tue, 13 May 2014 13:07:08 +0000 (15:07 +0200)]
agetty: use the "best" interface for \4 and \6
The issue file escape sequences \4 and \6 prints the host IP when no
interface is specified. That's useless on some virtual machines where
gethostname()+getaddrinfo() returns 127.0.0.1.
The seems better to print IP of the "best" interface (UP, RUNNING, non-LOOPBACK)
and use gethostname() as painful fallback only.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1090935 Signed-off-by: Karel Zak <kzak@redhat.com>
Werner Fink [Thu, 8 May 2014 10:09:25 +0000 (12:09 +0200)]
agetty: beside virtual consoles support xvc and hvc device lines as well
For this approach do not use the ioctl TIOCMGET anymore as this
is for real serial lines only. But switch over to use the ioctl
KDGKBMODE as this is unique to the virtual console lines only.
Werner Fink [Thu, 8 May 2014 10:09:24 +0000 (12:09 +0200)]
agetty: better support of the special system consoles on S390
That is that there are several consoles, the /dev/ttyS0 which
is type of ibm3215 and a dumb terminal, then there is the device
/dev/3270/tty1 which can handle ANSI color escape sequences and is
a ibm327x terminal, and the /dev/ttyS1 which is a vt220 terminal.
The macro is_speed() in agetty.c allows to distinguish between the
terminal line (/dev)3270/tty1 and the speed options on the command
line used in
Werner Fink [Thu, 8 May 2014 10:09:22 +0000 (12:09 +0200)]
agetty: avoid that agetty nor sulogin are fooled by a running plymouth
The nowadays used plymouth locks the devices used for the system
console which causes that agetty as well as sulogin can not modify
the termios settings of e.g. the serial devices of the systenm console.
Sami Kerola [Sun, 11 May 2014 19:26:42 +0000 (20:26 +0100)]
logger: check numeric priority and facility input values
Earlier use of unknown facility or priority number was accepted, and
resulted in unexpected result. For example when looking journalctl
--priority=7.8 was converted to priotity 0 and facility 1.
Sami Kerola [Sun, 11 May 2014 19:26:39 +0000 (20:26 +0100)]
cytune: remove from util-linux
Assumption is there are not many who need this tool. Whom ever they
might be the recommendation is to use the command from old util-linux
release. Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such. Basically the command has reached dead end what comes to
maintainability of it.
Sami Kerola [Sun, 11 May 2014 19:26:38 +0000 (20:26 +0100)]
tests: check /proc availability, and go-around if it is incomplete
Unavailability of /proc is fatal for kill, and continuing with the test
in that case does not make sense as it will only mean false positive
errors.
Where /proc/<pid>/status file(s) does not exist the check will perform
opportunistic sleep with assumption the test_sigreceive will be ready to
be killed if it has some time to init.
[kzak@redhat.com: - remove dependence on gawk, just use shell
- fix typo in "test /proc"]
CC: Ruediger Meier <sweet_f_a@gmx.de>
Reference: https://travis-ci.org/rudimeier/util-linux/jobs/24561058 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 12 May 2014 10:32:33 +0000 (12:32 +0200)]
Merge branch 'tests-features' of https://github.com/rudimeier/util-linux
* 'tests-features' of https://github.com/rudimeier/util-linux:
tests: style Makefile and make output
tests: allow to add or override test suite options
tests: add exit case "KNOWN FAILED"
tests: fix var names
tests: allow test options to be overridden by env
tests: call ts_init_env as early as possible
Ruediger Meier [Sat, 10 May 2014 01:57:26 +0000 (03:57 +0200)]
tests: add exit case "KNOWN FAILED"
Now we can mark tests as known to be broken without bothering
users with exit failure. In the build log this "KNOWN FAILED"
may be interpreted as TODO ;)
The main advantage of "known-fail" instead of just skipping
is that we will still find the test diff.
Ruediger Meier [Sat, 10 May 2014 00:00:53 +0000 (02:00 +0200)]
tests: allow test options to be overridden by env
Specially for automated builds the user may want to have some
fine granulated influence like
export TS_OPT_libmount_verbose="yes"
export TS_OPT_ipcs_fake="yes"
export TS_OPT_ipcs_limits2_fake="no"
if <big endian> then
export TS_OPT_hexdump_fake="yes"
fi
make check
Even for interactive developers this could be useful for example to
debug just one particuar test while having a regular run with stress:
Ruediger Meier [Thu, 8 May 2014 15:45:31 +0000 (17:45 +0200)]
last: --time-format=full should do the same like -F
For no reason "full" did something else than "iso" or -F as you
see here:
$ ./last -f ../tests/ts/last/wtmp.LE --time-format=full | grep -A2 "no logout"
torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout
reboot system boot system-name Wed Aug 28 20:00:00 2013 still running
reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00)
$ ./last -f ../tests/ts/last/wtmp.LE --time-format=iso | grep -A2 "no logout"
torvalds linux hobby 1991-08-26T02:57:08+0200 gone - no logout
reboot system boot system-name 2013-08-28T20:00:00+0200 still running
reboot system boot system-name 2013-08-28T18:00:00+0200 - 2013-08-28T19:00:00+0200 (01:00)
$ ./last -f ../tests/ts/last/wtmp.LE -F | grep -A2 "no logout"
torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout
reboot system boot system-name Wed Aug 28 20:00:00 2013 still running
reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00)
Also note the useless leading space before "gone"
The only thing which matters is fmt->out width when printing these
strings like "still running". Now ctl->fulltime flag is unsused and
removed.
Sami Kerola [Sun, 4 May 2014 15:39:38 +0000 (16:39 +0100)]
column: inform user when multibyte conversion error occurs
The column(1) read input until conversion error, and used incomplete
input when outputing, that made at least me to wonder where the rest
disappeared without explanation. IMHO it is better to fail immediately
rather than do only half of the task.
Ruediger Meier [Tue, 6 May 2014 17:16:53 +0000 (19:16 +0200)]
tests: fix kill problems
There were several failures (missing tmp files, missing pids) on travis
build farm which I couldn't track down completely. Here we fix some
possible issues:
- mktemp -u is unsafe, maybe even in practice if there is a bad random
generator
- make sure that mktemp does not give us pure integer filnames which
would not work for "kill by-name"
- avoid using trap, could be that it removed tmp files on wrong signals