dspinellis/pmonitor

Unit Test failure: expected 50, got '50 '

BenBE opened this issue · 1 comments

BenBE commented

Running the unit test fails on Ubuntu 18.04 Bionic/LTS

$ ./test-pmonitor.sh 
FAIL pmonitor: expected 50, got '50 '

Usually have LANG=de_DE.UTF-8, but fails with LANG=C too.

Installed version of lsof, in case this matters:

$ dpkg -s lsof
Package: lsof
Status: install ok installed
Priority: standard
Section: utils
Installed-Size: 440
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 4.89+dfsg-0.1
Depends: libc6 (>= 2.14), libselinux1 (>= 1.32)
Suggests: perl
Description: Utility to list open files
 Lsof is a Unix-specific diagnostic tool.  Its name stands
 for LiSt Open Files, and it does just that.  It lists
 information about any files that are open, by processes
 currently running on the system.
Original-Maintainer: Norbert Tretkowski <nobse@debian.org>
Homepage: http://people.freebsd.org/~abe/

Also: When parsing program output, consider running this program unter locale LANG=C explicitly.

It looks like there’s an unexpected space after the % mark, from this part of the awk script:

print fname, offset / len * 100 "%", eta

print prints its arguments separated by spaces, even if they are empty (as eta is in this case).