Ruediger Meier [Fri, 6 Jun 2014 11:40:48 +0000 (13:40 +0200)]
tests: rewrite hwclock test
Major changes:
- don't use deprecated ntpdate but sntp client
- don't update sys time from ntp, just compare offsets
- now hwclock is the only command which needs root permissions
- resolve ntp server to one fixed IP to get comparable offsets
always from the same remote machine
- don't enter the systohc/hctosys loop if not even --show works
- verbose but not too ugly debug output
Note, maybe later the resolve_host function could be moved to functions.sh
because other tests (e.g. last) should check whether dns is available.
Nicolas Boichat [Sat, 7 Jun 2014 13:38:00 +0000 (21:38 +0800)]
umount: Make sure exit code does not overflow
POSIX exit code is only 8-bit, and since umount sums up error
codes, it can sometimes report success (exit code 0) even though
a number of operations failed.
For example, running, in an empty directory:
umount `seq 1 7`
returns 224 (7*32), since none of the 7 mount point exists but
umount `seq 1 8`
returns 0 (8*32=256)
This patch clips the return value to 255.
Signed-off-by: Nicolas Boichat <nicolas@boichat.ch>
Ruediger Meier [Sun, 1 Jun 2014 22:58:01 +0000 (00:58 +0200)]
travis-ci: refactor and add .travis-functions.sh
Travis yaml syntax, where we can only use shell one-liners, is awful
and ugly. We add a real shell script and source it from .travis.yml.
This commit squashes a lot changes because we don't want to pollute
history with this meta CI stuff.
Highlights of this commit:
- enable make distcheck
- cleanup configure options (enable all progs, with python and docs)
- shorter config.log dump
- out-of-tree build supported
- workaround broken libtool on travis host
- now it's easy to add temporary debugging stuff
- testing locally is possible now
What are we testing now:
- gcc and clang compiler
- configure mostly with --enable-all-programs, --with-python and
--enable-gtk-doc
- make check with and without root permissions
- make distcheck
- make install (with and without --prefix as well as DESTDIR=...)
- usually we always build in-tree but distcheck does out-of-tree
What do we want/expect at all:
- This travis setup is intended to always work without fixing or
updating this build script all the time. Thats why we only use a
few configure flags.
- We want to avoid predictable failures on travis host to not make
developers tired of this machinery. Any tested feature which is
known to be (sometimes) broken should be fixed or skipped as soon
as possible.
- If this works like wanted then in future almost any point in master
commit history should at least survive the build and common tests
on this reference host/arch. Moreover we will have a comparable,
deterministic build log history. This could make bisecting real
bugs easier.
- It's not our goal to test any kind of config flags, host setup and
arch combination. This would be done better by external build
scripts which do not live within the project itself.
- Of course this machinery can be also used to reproduce bugs with
more exotic config and host setup by pushing a debug branch with
modified travis script to github.
Karel Zak [Wed, 4 Jun 2014 12:16:22 +0000 (14:16 +0200)]
Merge branch 'misc-build-sys' of https://github.com/rudimeier/util-linux
* 'misc-build-sys' of https://github.com/rudimeier/util-linux:
tests: fix python tests for dist and out-of-tree builds
build-sys: fix update-potfiles script
build-sys: restore make distcheck's configure flags
build-sys: use automake's PYTHON primary for __init__.py
tests: ignore deprecated last
tests: remove deprecated mount tests
Karel Zak [Wed, 4 Jun 2014 09:16:48 +0000 (11:16 +0200)]
build-sys: add --enable-pylibmount
* globally disable all Python bindings by --without-python
* use --with-python=<version> to specify Python version
* --enable-pylibmount to override --disable-all-programs
Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Ruediger Meier [Tue, 3 Jun 2014 17:07:37 +0000 (19:07 +0200)]
build-sys: fix update-potfiles script
Now are using "git ls-files" to avoid finding non-project
files or autoheaders which could break the dist tarball.
For non-git source dirs we assume that any existing POTFILES.in is
up-todate (build from tarball) or we provide at least an empty list
to not be a show-stopper for builds from poor "git archive".
Karel Zak [Fri, 30 May 2014 10:01:27 +0000 (12:01 +0200)]
Merge branch 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux
* 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux:
lscpu: improve vmware detection
tests: add lscpu IBM pSeries test data
lscpu: detect OS/400 and pHyp hypervisors
tests: add vbox lscpu dump
lscpu: minor cleanup and improve hypervisor detection
Ruediger Meier [Thu, 29 May 2014 23:18:09 +0000 (01:18 +0200)]
build: fix some compiler warnings
Most of them catched on 32bit gcc and icc.
disk-utils/fsck.cramfs.c: printf format type
lib/boottime.c: unused variables
misc-utils/cal.c: set but never used
sys-utils/losetup.c: set but never used
sys-utils/lscpu-dmi.c: defined but not used
sys-utils/switch_root.c: comparison between signed and unsigned
tests/helpers/test_sysinfo.c: printf format type
Ruediger Meier [Tue, 20 May 2014 11:26:48 +0000 (11:26 +0000)]
lscpu: detect OS/400 and pHyp hypervisors
This patch comes originally from openSUSE / SLE. Author was probably
Petr Uzel.
Internal SUSE references: fate310255, sr226509
In comparison to the original patch we have slightly corrected iSeries
and pSeries detection according to Alexander Graf's comments on
util-linux@vger.kernel.org. Maybe we would need to add some more code
to detect pSeries emulated by Qemu/KVM.
CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> CC: Alexander Graf <agraf@suse.de> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Karel Zak [Thu, 29 May 2014 10:48:40 +0000 (12:48 +0200)]
lslogins: clean up password hash check
* rename to PWD-* column names
* add PWD-DENY for accounts where is no possible to login by password
* PWD-LOCK (was LOCKED) checks for valid but locked pawwords
* LOGIN renamed to USER
Karel Zak [Thu, 29 May 2014 09:37:15 +0000 (11:37 +0200)]
lslogins: remove --sort-by-name
If we really need a sort functionality hardcoded into lslogins(1) then we need
a generic sort options (like for lsblk,--sort <column>).
Note that it seems that "lslogins | sort --key <col>" is good enough for now as
lslogins(1) does not convert any data to human readable non-precise format (like
for example lsblk SIZE column etc.).
Karel Zak [Wed, 28 May 2014 07:37:41 +0000 (09:37 +0200)]
Merge branch 'tests-stuff' of https://github.com/rudimeier/util-linux
* 'tests-stuff' of https://github.com/rudimeier/util-linux:
tests: split off losetup scsi_debug part
tests: fix, typo schedutils/cpuset
tests: run tests in deterministic order
tests: ts_scsi_debug_init skip instead of die
Stanislav Brabec [Tue, 27 May 2014 18:38:17 +0000 (20:38 +0200)]
losetup: don't ignore EBUSY in losetup when the loop device is given
losetup ignores the EBUSY error. In the loop fo A_CREATE action, it skips
the error handling when errno = EBUSY. It's OK for the case where no loop
device is specified, but the error has to be handled when the device is given
explicitly.
Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Stanislav Brabec [Tue, 27 May 2014 18:38:10 +0000 (20:38 +0200)]
losetup: don't clear FD at EBUSY error in loopcxt_setup_device()
loopback lib clears the existing FD unconditionally at error in
loopcxt_setup_device(). This is done even after EBUSY, thus the second call
actually clears the previous setup wrongly.
Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Petr Uzel [Mon, 26 May 2014 16:28:03 +0000 (18:28 +0200)]
sfdisk: suppress Linux-irrelevant warnings with -L
Sfdisk prints out a warning about extended partition not
starting at a cylinder boundary. Since this is irrelevant
for linux, the -L option should suppress this warning.
Ruediger Meier [Wed, 21 May 2014 23:37:17 +0000 (01:37 +0200)]
tests: ts_scsi_debug_init skip instead of die
If any of these modprobe commands fails then it's not a broken test.
ALso ts_die often does not work correctly from subtests which should
be fixed someday too.
BTW modprobe dry-run (even the real modprobe) is not reliable.
Moreover now we respect blacklisted modules (-b).
This error handling is not only useful to let the test-suite succeed
on broken systems but also to not fail all "scsi_debug tests" after
just one of them failed to umount something.
Sami Kerola [Sat, 24 May 2014 16:38:49 +0000 (17:38 +0100)]
uuidd: ensure pid file is wrote when it is requested
Earlier for example this 'uuidd --pid /dev/full' worked, now error is
printed about truncating not being possible for character device and
assuming someone would write pid to full disk it should not be go by
unnoticed.
Ruediger Meier [Tue, 20 May 2014 10:23:33 +0000 (10:23 +0000)]
libblkid: detect squashfs 3 vs 4
Detect squashfs version <= 3 as squashfs3 and version >= 4 as squashfs.
squashfs kernel module version 4.0 (kernel 2.6.29) is not backward
compatible to open squashfs created with previous versions.
Also fixed version number parsing, see
$ mkdir test
$ mksquashfs test test.sqsh
$ blkid -p test.sqsh
- test.sqsh: VERSION="1024.0" TYPE="squashfs" USAGE="filesystem"
+ test.sqsh: VERSION="4.0" TYPE="squashfs" USAGE="filesystem"
This patch comes from openSUSE / SLE. Original author was probably
Miklos Szeredi.
Internal SUSE references: bnc#666893, sr226509
Ruediger Meier [Thu, 22 May 2014 07:19:08 +0000 (09:19 +0200)]
setarch: flush output streams before exec
This fixes the following (non-deterministic) discrepancy:
$ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success
Switching on READ_IMPLIES_EXEC.
Switching on ADDR_LIMIT_32BIT.
Switching on SHORT_INODE.
Switching on WHOLE_SECONDS.
Switching on STICKY_TIMEOUTS.
Switching on ADDR_LIMIT_3GB.
Switching on UNAME26.
success