]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 years agoMerge branch 'tests-mount' of https://github.com/rudimeier/util-linux
Karel Zak [Fri, 16 May 2014 12:30:05 +0000 (14:30 +0200)] 
Merge branch 'tests-mount' of https://github.com/rudimeier/util-linux

* 'tests-mount' of https://github.com/rudimeier/util-linux:
  tests: use ts_mount for cramfs
  tests: ts_mount knows which fs is expected
  tests: ts_mount validates error message
  tests, add function ts_mount

11 years agoMerge branch 'tests-check-prog' of https://github.com/rudimeier/util-linux
Karel Zak [Fri, 16 May 2014 12:27:11 +0000 (14:27 +0200)] 
Merge branch 'tests-check-prog' of https://github.com/rudimeier/util-linux

* 'tests-check-prog' of https://github.com/rudimeier/util-linux:
  tests: check for mkfs.ext{2,3,4}
  tests: consolidate some checks for commands
  tests: add function ts_check_prog

11 years agolslogins: add FAILED-LOGIN to pretty output
Karel Zak [Fri, 16 May 2014 12:14:02 +0000 (14:14 +0200)] 
lslogins: add FAILED-LOGIN to pretty output

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: sync man page and usage()
Karel Zak [Fri, 16 May 2014 12:04:54 +0000 (14:04 +0200)] 
lslogins: sync man page and usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: improve pretty output
Karel Zak [Fri, 16 May 2014 10:35:46 +0000 (12:35 +0200)] 
lslogins: improve pretty output

 * use Yes/No
 * print all available information (columns)
 * cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: use ts_mount for cramfs
Ruediger Meier [Thu, 15 May 2014 15:01:00 +0000 (17:01 +0200)] 
tests: use ts_mount for cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_mount knows which fs is expected
Ruediger Meier [Thu, 15 May 2014 14:56:18 +0000 (16:56 +0200)] 
tests: ts_mount knows which fs is expected

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_mount validates error message
Ruediger Meier [Thu, 15 May 2014 14:27:28 +0000 (16:27 +0200)] 
tests: ts_mount validates error message

Skip only if mount reports a non-empty fs which is not available
in /proc/filesystems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, add function ts_mount
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolslogins: NLS for all messages
Karel Zak [Fri, 16 May 2014 09:41:18 +0000 (11:41 +0200)] 
lslogins: NLS for all messages

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: conding style changes
Karel Zak [Fri, 16 May 2014 09:31:00 +0000 (11:31 +0200)] 
lslogins: conding style changes

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: improve supplementary groups code, add SUPP-GIDS
Karel Zak [Fri, 16 May 2014 09:14:32 +0000 (11:14 +0200)] 
lslogins: improve supplementary groups code, add SUPP-GIDS

 * don't build list, but directly create a string
 * don't mix IDs and group names on output
 * add SUPP-GIDS to print only IDs

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: align to right 0|1 columns
Karel Zak [Thu, 15 May 2014 12:10:50 +0000 (14:10 +0200)] 
lslogins: align to right 0|1 columns

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup status[] usage
Karel Zak [Thu, 15 May 2014 12:01:51 +0000 (14:01 +0200)] 
lslogins: cleanup status[] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup fill_table()
Karel Zak [Thu, 15 May 2014 11:35:08 +0000 (13:35 +0200)] 
lslogins: cleanup fill_table()

 * check xasprintf() return code is unnecessary
 * just check all scols_line_set_data() return codes on one place

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: mention --time-format in usage
Ondrej Oprala [Wed, 30 Apr 2014 13:59:01 +0000 (15:59 +0200)] 
lslogins: mention --time-format in usage

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: fix option exclusivity
Ondrej Oprala [Wed, 30 Apr 2014 13:52:50 +0000 (15:52 +0200)] 
lslogins: fix option exclusivity

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: add option --time-format
Ondrej Oprala [Wed, 30 Apr 2014 13:46:50 +0000 (15:46 +0200)] 
lslogins: add option --time-format

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: comment-in an expensive realloc
Ondrej Oprala [Wed, 30 Apr 2014 12:46:47 +0000 (14:46 +0200)] 
lslogins: comment-in an expensive realloc

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: add option --iso
Ondrej Oprala [Wed, 30 Apr 2014 12:42:51 +0000 (14:42 +0200)] 
lslogins: add option --iso

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: add support for multiple time formats
Ondrej Oprala [Wed, 30 Apr 2014 12:25:54 +0000 (14:25 +0200)] 
lslogins: add support for multiple time formats

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: pretty printing and extended -l,-g
Ondrej Oprala [Tue, 29 Apr 2014 11:40:32 +0000 (13:40 +0200)] 
lslogins: pretty printing and extended -l,-g

11 years agolslogins: also add readutmp.c
Ondrej Oprala [Mon, 28 Apr 2014 10:33:11 +0000 (12:33 +0200)] 
lslogins: also add readutmp.c

11 years agolslogins: add readtump.h header
Ondrej Oprala [Mon, 28 Apr 2014 10:18:18 +0000 (12:18 +0200)] 
lslogins: add readtump.h header

11 years agolslogins: make it work
Ondrej Oprala [Wed, 23 Apr 2014 10:46:56 +0000 (12:46 +0200)] 
lslogins: make it work

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: use thread-safe functions
Ondrej Oprala [Wed, 23 Apr 2014 07:33:25 +0000 (09:33 +0200)] 
lslogins: use thread-safe functions

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: store users in a tree
Ondrej Oprala [Tue, 22 Apr 2014 13:38:27 +0000 (15:38 +0200)] 
lslogins: store users in a tree

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: add functionality
Ondrej Oprala [Mon, 7 Apr 2014 16:24:19 +0000 (18:24 +0200)] 
lslogins: add functionality

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agologin: extract get_hushlogin_status
Ondrej Oprala [Tue, 8 Apr 2014 11:26:33 +0000 (13:26 +0200)] 
login: extract get_hushlogin_status

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins: move to login-utils
Ondrej Oprala [Tue, 8 Apr 2014 08:51:02 +0000 (10:51 +0200)] 
lslogins: move to login-utils

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agolslogins(1): skeleton and argparsing for a new utility
Ondrej Oprala [Fri, 4 Apr 2014 15:58:06 +0000 (17:58 +0200)] 
lslogins(1): skeleton and argparsing for a new utility

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agotests: check for mkfs.ext{2,3,4}
Ruediger Meier [Wed, 14 May 2014 21:54:23 +0000 (23:54 +0200)] 
tests: check for mkfs.ext{2,3,4}

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: consolidate some checks for commands
Ruediger Meier [Thu, 15 May 2014 09:24:59 +0000 (11:24 +0200)] 
tests: consolidate some checks for commands

Use ts_check_prog for mdadm, readelf, file, ntpdate, bc (mdadm was
not always checked so far).

There are some positive side-effects. We are using always $PATH now
instead of randomly hardcoded /usr/bin, /sbin, etc. If we ever want
to change this again, we should do this generically in ts_init.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add function ts_check_prog
Ruediger Meier [Wed, 14 May 2014 21:53:52 +0000 (23:53 +0200)] 
tests: add function ts_check_prog

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoMerge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux
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

11 years agotests: add .BE hexdump test results (from s390)
Karel Zak [Wed, 14 May 2014 12:05:54 +0000 (14:05 +0200)] 
tests: add .BE hexdump test results (from s390)

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'tests-known' of https://github.com/rudimeier/util-linux
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

11 years agolosetup: fix -f on systems without /dev/loop-control
Karel Zak [Wed, 14 May 2014 10:53:24 +0000 (12:53 +0200)] 
losetup: fix -f on systems without /dev/loop-control

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests, script/race is known to fail
Ruediger Meier [Tue, 13 May 2014 13:19:35 +0000 (15:19 +0200)] 
tests, script/race is known to fail

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: script/race would work with variable loop count
Ruediger Meier [Tue, 13 May 2014 13:13:12 +0000 (15:13 +0200)] 
tests: script/race would work with variable loop count

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ipcs/limits2 is known to fail
Ruediger Meier [Tue, 13 May 2014 10:10:17 +0000 (12:10 +0200)] 
tests: ipcs/limits2 is known to fail

See github issue #51, comment 2
https://github.com/karelzak/util-linux/issues/51

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix hexdump for big endian
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotravis-ci: enable root checks
Ruediger Meier [Mon, 12 May 2014 11:50:25 +0000 (13:50 +0200)] 
travis-ci: enable root checks

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotravis-ci: minor cleanup and speedup
Ruediger Meier [Sun, 11 May 2014 04:49:02 +0000 (06:49 +0200)] 
travis-ci: minor cleanup and speedup

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: introduce TS_CMD_UUIDGEN (never use installed one)
Ruediger Meier [Sun, 11 May 2014 21:58:53 +0000 (23:58 +0200)] 
tests: introduce TS_CMD_UUIDGEN (never use installed one)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, don't write TS_DEVICE to stdout anymore
Ruediger Meier [Tue, 13 May 2014 15:17:24 +0000 (17:17 +0200)] 
tests, don't write TS_DEVICE to stdout anymore

11 years agotests: ts_scsi_debug_init must not run in a subshell
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: cleanup ts_scsi_debug_init
Ruediger Meier [Sun, 11 May 2014 20:48:16 +0000 (22:48 +0200)] 
tests: cleanup ts_scsi_debug_init

Sort out global and local vars. Now we set TS_DEVICE globally
to be use later.
Skip really quiet if modprobe fails.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: some more tests need loop support
Ruediger Meier [Sun, 11 May 2014 20:47:22 +0000 (22:47 +0200)] 
tests: some more tests need loop support

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_device_init requires loop support
Ruediger Meier [Mon, 12 May 2014 10:45:03 +0000 (12:45 +0200)] 
tests: ts_device_init requires loop support

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: use ts_check_losetup in losetup test
Ruediger Meier [Mon, 12 May 2014 10:42:07 +0000 (12:42 +0200)] 
tests: use ts_check_losetup in losetup test

In losetup test we have to handle the special case that ts_check_losetup
requires a working losetup binary.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add function ts_check_losetup
Ruediger Meier [Mon, 12 May 2014 00:45:10 +0000 (02:45 +0200)] 
tests: add function ts_check_losetup

Unfortunately losetup -f does not return an error nowadays.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests, add missing output for hexdump
Ruediger Meier [Tue, 13 May 2014 11:36:08 +0000 (13:36 +0200)] 
tests, add missing output for hexdump

One file was missing and one was too much.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix hexdump, add ts_finalize
Ruediger Meier [Mon, 12 May 2014 21:16:25 +0000 (23:16 +0200)] 
tests: fix hexdump, add ts_finalize

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix "KNOWN FAILED" for subtests
Ruediger Meier [Mon, 12 May 2014 20:56:57 +0000 (22:56 +0200)] 
tests: fix "KNOWN FAILED" for subtests

It didn't worked for tests with subtests.

Here we consolidate both cases which fixes the issue by the way. This
is basically a rewrite of 7641ccec.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoagetty: use the "best" interface for \4 and \6
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>
11 years agolib/colors: add to the man page hint about $HOME stuff
Karel Zak [Tue, 13 May 2014 11:26:50 +0000 (13:26 +0200)] 
lib/colors: add to the man page hint about $HOME stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoagetty: fix odd check for chardev/tty
Karel Zak [Tue, 13 May 2014 10:28:48 +0000 (12:28 +0200)] 
agetty: fix odd check for chardev/tty

References: https://bugzilla.redhat.com/show_bug.cgi?id=1069902
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocfdisk: update man page COLORS section
Karel Zak [Mon, 12 May 2014 08:27:53 +0000 (10:27 +0200)] 
cfdisk: update man page COLORS section

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: support colors customization
Karel Zak [Mon, 12 May 2014 08:22:09 +0000 (10:22 +0200)] 
fdisk: support colors customization

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: add --color to the man page
Karel Zak [Mon, 12 May 2014 08:03:41 +0000 (10:03 +0200)] 
hexdump: add --color to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodmesg: support colors customization
Karel Zak [Mon, 12 May 2014 07:53:39 +0000 (09:53 +0200)] 
dmesg: support colors customization

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: update man page
Karel Zak [Mon, 12 May 2014 07:51:01 +0000 (09:51 +0200)] 
lib/colors: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: use new colors API
Karel Zak [Mon, 5 May 2014 14:32:58 +0000 (16:32 +0200)] 
hexdump: use new colors API

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibsmartcols: use new colors API
Karel Zak [Mon, 5 May 2014 14:32:14 +0000 (16:32 +0200)] 
libsmartcols: use new colors API

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: support schemes customization
Karel Zak [Mon, 5 May 2014 14:22:43 +0000 (16:22 +0200)] 
lib/colors: support schemes customization

 * parse terminal-colors.d/*.scheme files, expected format is

    <name> <color-sequence>

 * supported color sequences:

     - color name (e.g. "red")
     - dir_colors compatible xx;yy (e.g. 01;31) where the sequence may
       contains control chars like \e \a  ..etc.

 * scheme is parsed on demand

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: allow to temporary disable colors
Karel Zak [Wed, 30 Apr 2014 12:51:46 +0000 (14:51 +0200)] 
lib/colors: allow to temporary disable colors

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/colors: add support for @term and /home/kzak
Karel Zak [Wed, 30 Apr 2014 10:59:28 +0000 (12:59 +0200)] 
lib/colors: add support for @term and /home/kzak

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolosetup: return EXIT_FAILURE on unsuccessful -f
Karel Zak [Tue, 13 May 2014 09:34:30 +0000 (11:34 +0200)] 
losetup: return EXIT_FAILURE on unsuccessful -f

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoagetty: beside virtual consoles support xvc and hvc device lines as well
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.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agoagetty: better support of the special system consoles on S390
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

/run/systemd/generator/getty.target.wants/serial-getty@3270-tty1.service

which is a symbolic link to /usr/lib/systemd/system/serial-getty@.service

Signed-off-by: Werner Fink <werner@suse.de>
11 years agosulogin: find a suitable console device
Werner Fink [Thu, 8 May 2014 10:09:23 +0000 (12:09 +0200)] 
sulogin: find a suitable console device

Enable sulogin to find a suitable console device even if the first line
in /proc/consoles does not have any major and minor number.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agoagetty: avoid that agetty nor sulogin are fooled by a running plymouth
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.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agocfdisk: fix compiler warning [-Wsign-compare]
Karel Zak [Tue, 13 May 2014 07:58:58 +0000 (09:58 +0200)] 
cfdisk: fix compiler warning [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoRevert "blkid: remove unused variable"
Karel Zak [Tue, 13 May 2014 07:55:10 +0000 (09:55 +0200)] 
Revert "blkid: remove unused variable"

This reverts commit 0fd4b8132587a264f1e0df46eec7c12bba68c752.

11 years agolibfdisk: fix %ju -> %zu
Karel Zak [Tue, 13 May 2014 07:52:42 +0000 (09:52 +0200)] 
libfdisk: fix %ju -> %zu

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: ts_device_init remove useless error handling
Ruediger Meier [Sun, 11 May 2014 23:43:03 +0000 (01:43 +0200)] 
tests: ts_device_init remove useless error handling

Don't know why we should deinit the empty string.
This patch prepares further refactoring or error handling.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agosetterm: convert remaining magic values to symbolic references
Sami Kerola [Sun, 11 May 2014 19:26:49 +0000 (20:26 +0100)] 
setterm: convert remaining magic values to symbolic references

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetterm: convert various constant number definitions to enums
Sami Kerola [Sun, 11 May 2014 19:26:48 +0000 (20:26 +0100)] 
setterm: convert various constant number definitions to enums

The enum strings are visible when using debugger.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agosetterm: cleanup printf() usage
Karel Zak [Mon, 12 May 2014 11:53:10 +0000 (13:53 +0200)] 
setterm: cleanup printf() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetterm: remove unused code
Sami Kerola [Sun, 11 May 2014 19:26:46 +0000 (20:26 +0100)] 
setterm: remove unused code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agowall: replace magic number by named value
Sami Kerola [Sun, 11 May 2014 19:26:45 +0000 (20:26 +0100)] 
wall: replace magic number by named value

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoterm-utils: avoid error message string length couting errors
Sami Kerola [Sun, 11 May 2014 19:26:44 +0000 (20:26 +0100)] 
term-utils: avoid error message string length couting errors

Remove various magic numbers with either a string lenght count, or a
symbolic variable that is recognized by gdb.

[kzak@redhat.com: - use snprintf() everywhere,
                  - check snprintf() return code rather than mess up
                    the code with strlens]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: remove unnecessary void casts
Sami Kerola [Sun, 11 May 2014 19:26:43 +0000 (20:26 +0100)] 
build-sys: remove unnecessary void casts

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: check numeric priority and facility input values
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agologger: fail when io vector number exceeds maximum
Sami Kerola [Sun, 11 May 2014 19:26:41 +0000 (20:26 +0100)] 
logger: fail when io vector number exceeds maximum

Earlier version silently failed without logging anything.

$ logger --journald=/etc/services ; echo $?
1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoblkid: remove unused variable
Sami Kerola [Sun, 11 May 2014 19:26:40 +0000 (20:26 +0100)] 
blkid: remove unused variable

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocytune: remove from util-linux
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: check /proc availability, and go-around if it is incomplete
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>
11 years agoMerge branch 'tests-features' of https://github.com/rudimeier/util-linux
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

11 years agotests: style Makefile and make output
Ruediger Meier [Sat, 10 May 2014 15:23:22 +0000 (17:23 +0200)] 
tests: style Makefile and make output

We break long lines and make output sill looks nice with and without
V=1.

As a side effect we can now run
  make TS_COMMAND="true"
to do nothing but building all check_PROGRAMS.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: allow to add or override test suite options
Ruediger Meier [Sat, 10 May 2014 15:14:45 +0000 (17:14 +0200)] 
tests: allow to add or override test suite options

Now we can do something like this
  make check TS_OPTS="--fake --parallel=32"

Note we still always set --parallel but the last one wins.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add exit case "KNOWN FAILED"
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: avoid leading "-" before "no logout"
Ruediger Meier [Thu, 8 May 2014 17:01:03 +0000 (19:01 +0200)] 
last: avoid leading "-" before "no logout"

This affects option --time-format=notime.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: fix var names
Ruediger Meier [Sat, 10 May 2014 05:04:11 +0000 (07:04 +0200)] 
tests: fix var names

Translate "." and "-" to "_". We assume that nobody will add
completely stupid test file names.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: allow test options to be overridden by env
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:

TS_OPT_script_verbose="yes" \
TS_OPT_script_memcheck="yes" \
../tests/run.sh --parallel=256 --srcdir=.. --builddir=. --nonroot

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: call ts_init_env as early as possible
Ruediger Meier [Sat, 10 May 2014 02:51:22 +0000 (04:51 +0200)] 
tests: call ts_init_env as early as possible

Soon we want to use some env vars within ts_has_option(). That's
why we move some lines to make this possible.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: minor cleanup if statements
Ruediger Meier [Thu, 8 May 2014 16:48:21 +0000 (18:48 +0200)] 
last: minor cleanup if statements

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: add test case for last -time-format=full
Ruediger Meier [Thu, 8 May 2014 15:58:37 +0000 (17:58 +0200)] 
tests: add test case for last -time-format=full

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolast: --time-format=full should do the same like -F
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>