Skip to contentSkip to conversation

tests: lots of tests

PATCH Applied Sami Kerola 2 participants 27 messages Jan 19, 2013 – Jan 25, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

cover tests: lots of tests

Hi Karel, and everyone,

While back I where politely asked to write regression tests...

http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/7005

...and here is few. As everyone can see there are also couple non-tests patches. Here's explanation about them.

The 0001 is about ignoring coverage files. To me it makes sense to check the coverage report after writing a check to verify code lines where ran by the test.

The 0009 is a go-around to reach more(1) code. The command did not seem to want behave same way for script as it did for terminal, which made validation bit difficult.

The 0013 became to be after a crash with dmesg when I used unexpected input. I have a hunch kernel buffer might never have values out of bound, but perhaps it is best to check than rely on how thing should be.

While writing fallocate check I realized mkswap manual is still recommending to use dd if=/dev/null of=swapfile creation. Is there any reason why fallocate, the patch 0017, would not be more recommendable?

During dmesg testing I notice --color not working as I (as user) thought it should. Problem was that one had to combine --color with either --facility, --console-level, or --decode. IMHO when --color is asked, one should get colors regardless if there are or aren't other options in use. The 0020 fixes the issue.

Finally the 0022 will sort the tests/commands.sh list. I like sorted list; they are quick to find items, and you always know add the new ones.

Thats' that about tests this time.

The following changes since commit b4ec4573dfa41b81668e141921cf00e6123234bc:

mount: make --verbose more verbose about propagation (2013-01-15 16:09:07 +0100)

are available in the git repository at:

git://github.com/kerolasa/lelux-utiliteetit.git 2013wk02

for you to fetch changes up to 271dd9b59d7d66d8f8f0890a32e7e71683fd957a:

tests: sort commands strings (2013-01-18 23:37:35 +0000)

----------------------------------------------------------------
Sami Kerola (22):
build-sys: add gcov files to .gitignore
tests: add rev(1) check
tests: add utmpdump(1) check
tests: add getopt(1) check
tests: add mcookie(1) check
tests: add tailf(1) check
tests: add ul(1) check
tests: add ionice(1) check
more: allow non-interactive invocation of the command
tests: add more(1) check
tests: add line(1) check
tests: add dmesg(1) check
dmesg: add boundary check to facility & level array usage
tests: add setsid(1) check
tests: add setarch(8) check
tests: add fallocate(1) check
docs: mkswap.8: recommend fallocate(1)
tests: add isosize(1) check
tests: add whereis(1) check
dmesg: parse level when --color is used
tests: add ipcmk(1) and ipcrm(1) checks
tests: sort commands strings

 .gitignore                          |   3 ++
 disk-utils/mkswap.8                 |   2 +-
 sys-utils/dmesg.c                   |   6 ++-
 tests/commands.sh                   |  69 +++++++++++++-----------
 tests/expected/dmesg/console-levels | 104 +++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/decode         | 105 ++++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/delta          | 105 ++++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/facilities     |  96 +++++++++++++++++++++++++++++++++
 tests/expected/ipcs/mk-rm-msg       |   2 +
 tests/expected/ipcs/mk-rm-sem       |   2 +
 tests/expected/ipcs/mk-rm-shm       |   2 +
 tests/expected/isosize/print-size   |   1 +
 tests/expected/misc/fallocate       |   1 +
 tests/expected/misc/getopt          |   9 ++++
 tests/expected/misc/ionice          |   9 ++++
 tests/expected/misc/line            |   1 +
 tests/expected/misc/mcookie         |   1 +
 tests/expected/misc/rev             |   1 +
 tests/expected/misc/setarch         |   1 +
 tests/expected/misc/setsid          |   1 +
 tests/expected/misc/ul              |   3 ++
 tests/expected/misc/whereis         |   1 +
 tests/expected/more/regexp          |   4 ++
 tests/expected/more/squeeze         |   3 ++
 tests/expected/tailf/simple         |   2 +
 tests/expected/utmpdump/to-binary   | Bin 0 -> 3840 bytes
 tests/expected/utmpdump/to-text     |  10 ++++
 tests/ts/dmesg/console-levels       |  25 +++++++++
 tests/ts/dmesg/decode               |  23 ++++++++
 tests/ts/dmesg/delta                |  23 ++++++++
 tests/ts/dmesg/facilities           |  25 +++++++++
 tests/ts/dmesg/input                | 105 ++++++++++++++++++++++++++++++++++++
 tests/ts/ipcs/functions.sh          |  17 ++++++
 tests/ts/ipcs/mk-rm-msg             |  36 +++++++++++++
 tests/ts/ipcs/mk-rm-sem             |  36 +++++++++++++
 tests/ts/ipcs/mk-rm-shm             |  36 +++++++++++++
 tests/ts/isosize/print-size         |  25 +++++++++
 tests/ts/isosize/sample.iso.gz      | Bin 0 -> 632 bytes
 tests/ts/misc/fallocate             |  25 +++++++++
 tests/ts/misc/getopt                |  46 ++++++++++++++++
 tests/ts/misc/ionice                |  28 ++++++++++
 tests/ts/misc/line                  |  24 +++++++++
 tests/ts/misc/mcookie               |  26 +++++++++
 tests/ts/misc/rev                   |  24 +++++++++
 tests/ts/misc/setarch               |  23 ++++++++
 tests/ts/misc/setsid                |  23 ++++++++
 tests/ts/misc/ul                    |  24 +++++++++
 tests/ts/misc/whereis               |  28 ++++++++++
 tests/ts/more/regexp                |  24 +++++++++
 tests/ts/more/squeeze               |  24 +++++++++
 tests/ts/tailf/simple               |  29 ++++++++++
 tests/ts/utmpdump/binary            | Bin 0 -> 3840 bytes
 tests/ts/utmpdump/text              |  10 ++++
 tests/ts/utmpdump/to-binary         |  23 ++++++++
 tests/ts/utmpdump/to-text           |  23 ++++++++
 text-utils/more.1                   |   5 ++
 text-utils/more.c                   |  17 +++---
 57 files changed, 1281 insertions(+), 40 deletions(-)
 create mode 100644 tests/expected/dmesg/console-levels
 create mode 100644 tests/expected/dmesg/decode
 create mode 100644 tests/expected/dmesg/delta
 create mode 100644 tests/expected/dmesg/facilities
 create mode 100644 tests/expected/ipcs/mk-rm-msg
 create mode 100644 tests/expected/ipcs/mk-rm-sem
 create mode 100644 tests/expected/ipcs/mk-rm-shm
 create mode 100644 tests/expected/isosize/print-size
 create mode 100644 tests/expected/misc/fallocate
 create mode 100644 tests/expected/misc/getopt
 create mode 100644 tests/expected/misc/ionice
 create mode 100644 tests/expected/misc/line
 create mode 100644 tests/expected/misc/mcookie
 create mode 100644 tests/expected/misc/rev
 create mode 100644 tests/expected/misc/setarch
 create mode 100644 tests/expected/misc/setsid
 create mode 100644 tests/expected/misc/ul
 create mode 100644 tests/expected/misc/whereis
 create mode 100644 tests/expected/more/regexp
 create mode 100644 tests/expected/more/squeeze
 create mode 100644 tests/expected/tailf/simple
 create mode 100644 tests/expected/utmpdump/to-binary
 create mode 100644 tests/expected/utmpdump/to-text
 create mode 100755 tests/ts/dmesg/console-levels
 create mode 100755 tests/ts/dmesg/decode
 create mode 100755 tests/ts/dmesg/delta
 create mode 100755 tests/ts/dmesg/facilities
 create mode 100644 tests/ts/dmesg/input
 create mode 100755 tests/ts/ipcs/mk-rm-msg
 create mode 100755 tests/ts/ipcs/mk-rm-sem
 create mode 100755 tests/ts/ipcs/mk-rm-shm
 create mode 100755 tests/ts/isosize/print-size
 create mode 100644 tests/ts/isosize/sample.iso.gz
 create mode 100755 tests/ts/misc/fallocate
 create mode 100755 tests/ts/misc/getopt
 create mode 100755 tests/ts/misc/ionice
 create mode 100755 tests/ts/misc/line
 create mode 100755 tests/ts/misc/mcookie
 create mode 100755 tests/ts/misc/rev
 create mode 100755 tests/ts/misc/setarch
 create mode 100755 tests/ts/misc/setsid
 create mode 100755 tests/ts/misc/ul
 create mode 100755 tests/ts/misc/whereis
 create mode 100755 tests/ts/more/regexp
 create mode 100755 tests/ts/more/squeeze
 create mode 100755 tests/ts/tailf/simple
 create mode 100644 tests/ts/utmpdump/binary
 create mode 100644 tests/ts/utmpdump/text
 create mode 100755 tests/ts/utmpdump/to-binary
 create mode 100755 tests/ts/utmpdump/to-text
#2 lore raw

PATCH 2/22 tests: add rev(1) check

Fairly lenghty input line tries to ensure realloc segment in code is hit at least once.

---
 tests/commands.sh       |  1 +
 tests/expected/misc/rev |  1 +
 tests/ts/misc/rev       | 24 ++++++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 tests/expected/misc/rev
 create mode 100755 tests/ts/misc/rev
tests/commands.sh +1 -0
index 3672095..f1643a6 100644
@@ -45,6 +45,7 @@ TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/ipcs"}
 TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/col"}
 TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/column"}
 TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/colrm"}
+TS_CMD_REV=${TS_CMD_REV:-"$top_builddir/rev"}
 
 TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
 TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/look"}
tests/expected/misc/rev new file +1 -0
new file mode 100644
index 0000000..77ceb56
@@ -0,0 +1 @@
+ z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a!

z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a! z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v!
u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v! u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v! u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m !
l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m ! l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m ! l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c!
b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c! b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c! b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t !
s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t ! s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t ! s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j!
i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j! i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j! i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a !
z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a ! z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a ! z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q!
p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q! p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q! p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h !
g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h ! g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h ! g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x!
w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x! w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x! w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o !
n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o ! n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o ! n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e!
d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e! d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e! d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v !
u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v ! u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v ! u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l!
k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a

tests/ts/misc/rev new file +24 -0
new file mode 100755
index 0000000..d1fba16
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="rev"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+for I in {0..512}; do printf "%s " {a..z}; done |
+	$TS_CMD_REV > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#3 lore raw

PATCH 3/22 tests: add utmpdump(1) check

In reply to Sami Kerola
---
 tests/commands.sh                 |   2 ++
 tests/expected/utmpdump/to-binary | Bin 0 -> 3840 bytes
 tests/expected/utmpdump/to-text   |  10 ++++++++++
 tests/ts/utmpdump/binary          | Bin 0 -> 3840 bytes
 tests/ts/utmpdump/text            |  10 ++++++++++
 tests/ts/utmpdump/to-binary       |  23 +++++++++++++++++++++++
 tests/ts/utmpdump/to-text         |  23 +++++++++++++++++++++++
 7 files changed, 68 insertions(+)
 create mode 100644 tests/expected/utmpdump/to-binary
 create mode 100644 tests/expected/utmpdump/to-text
 create mode 100644 tests/ts/utmpdump/binary
 create mode 100644 tests/ts/utmpdump/text
 create mode 100755 tests/ts/utmpdump/to-binary
 create mode 100755 tests/ts/utmpdump/to-text
tests/commands.sh +2 -0
index f1643a6..73725c9 100644
@@ -64,3 +64,5 @@ TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
 TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
 
 TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
+
+TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
tests/expected/utmpdump/to-binary new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..45d35bbb0ba5f1c3db170f18b1a4da1c7f92cf61
GIT binary patch
tests/expected/utmpdump/to-text new file +10 -0
new file mode 100644
index 0000000..02fb22d
@@ -0,0 +1,10 @@
+[7] [17058] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:44:09 2013 GMT]
+[7] [22098] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:49:17 2013 GMT]
+[7] [24915] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 12:23:33 2013 GMT]
+[8] [24915] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 12:24:49 2013 GMT]
+[7] [30629] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 13:12:39 2013 GMT]
+[8] [30629] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:19 2013 GMT]
+[8] [22098] [ts/2] [kerolasa] [pts/2       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[8] [17058] [ts/1] [kerolasa] [pts/1       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[7] [31545] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 20:17:21 2013 GMT]
+[7] [28496] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 21:09:39 2013 GMT]
tests/ts/utmpdump/binary new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..45d35bbb0ba5f1c3db170f18b1a4da1c7f92cf61
GIT binary patch
tests/ts/utmpdump/text new file +10 -0
new file mode 100644
index 0000000..02fb22d
@@ -0,0 +1,10 @@
+[7] [17058] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:44:09 2013 GMT]
+[7] [22098] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:49:17 2013 GMT]
+[7] [24915] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 12:23:33 2013 GMT]
+[8] [24915] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 12:24:49 2013 GMT]
+[7] [30629] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 13:12:39 2013 GMT]
+[8] [30629] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:19 2013 GMT]
+[8] [22098] [ts/2] [kerolasa] [pts/2       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[8] [17058] [ts/1] [kerolasa] [pts/1       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[7] [31545] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 20:17:21 2013 GMT]
+[7] [28496] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 21:09:39 2013 GMT]
tests/ts/utmpdump/to-binary new file +23 -0
new file mode 100755
index 0000000..25acbf6
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="to-binary"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_UTMPDUMP -r $TS_SELF/text >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/utmpdump/to-text new file +23 -0
new file mode 100755
index 0000000..f454e5f
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="to-text"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_UTMPDUMP $TS_SELF/binary >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize
Signature · 1 line
1.8.1.1
#4 lore raw

PATCH 4/22 tests: add getopt(1) check

In reply to Sami Kerola
---
 tests/commands.sh          |  1 +
 tests/expected/misc/getopt |  9 +++++++++
 tests/ts/misc/getopt       | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)
 create mode 100644 tests/expected/misc/getopt
 create mode 100755 tests/ts/misc/getopt
tests/commands.sh +1 -0
index 73725c9..cb2f444 100644
@@ -66,3 +66,4 @@ TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
 TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
 
 TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
+TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
tests/expected/misc/getopt new file +9 -0
new file mode 100644
index 0000000..c2c90ae
@@ -0,0 +1,9 @@
+Option a
+Option b, argument `1'
+Option c, argument `2'
+Option a
+Option b, argument `3'
+Option c, no argument
+Remaining arguments:
+--> `foo'
+--> `bar'
tests/ts/misc/getopt new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
1.8.1.1
#5 lore raw

PATCH 5/22 tests: add mcookie(1) check

In reply to Sami Kerola
---
 tests/commands.sh           |  1 +
 tests/expected/misc/mcookie |  1 +
 tests/ts/misc/mcookie       | 26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/expected/misc/mcookie
 create mode 100755 tests/ts/misc/mcookie
tests/commands.sh +1 -0
index cb2f444..3465d41 100644
@@ -67,3 +67,4 @@ TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
 
 TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
 TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
+TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
tests/expected/misc/mcookie new file +1 -0
new file mode 100644
index 0000000..d1c0351
@@ -0,0 +1 @@
+the string meets expecations
tests/ts/misc/mcookie new file +26 -0
new file mode 100755
index 0000000..9e650b2
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="mcookie"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_MCOOKIE -f /etc/services |
+	# The sed will convert only 32 characters long hexadecimal string
+	# to expected string, but nothing else.
+	sed 's/^[0-9a-f]\{32\}$/the string meets expecations/' > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#6 lore raw

PATCH 6/22 tests: add tailf(1) check

In reply to Sami Kerola
---
 tests/commands.sh           |  1 +
 tests/expected/tailf/simple |  2 ++
 tests/ts/tailf/simple       | 29 +++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 tests/expected/tailf/simple
 create mode 100755 tests/ts/tailf/simple
tests/commands.sh +1 -0
index 3465d41..2718640 100644
@@ -68,3 +68,4 @@ TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
 TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
 TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
 TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
+TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
tests/expected/tailf/simple new file +2 -0
new file mode 100644
index 0000000..ddf72de
@@ -0,0 +1,2 @@
+a b c d e f g h i j k l m n o p q r s t u v w x y z
+0 1 2 3 4 5 6 7 8 9
tests/ts/tailf/simple new file +29 -0
new file mode 100755
index 0000000..ad00b25
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="simple"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+rm -f $TS_SELF/input
+echo {a..z}  > $TS_SELF/input
+$TS_CMD_TAILF  $TS_SELF/input > $TS_OUTPUT 2>&1 &
+sleep 0.1
+echo {0..9} >> $TS_SELF/input
+sleep 0.1
+rm -f $TS_SELF/input
+
+ts_finalize
Signature · 1 line
1.8.1.1
#7 lore raw

PATCH 7/22 tests: add ul(1) check

In reply to Sami Kerola
---
 tests/commands.sh      |  1 +
 tests/expected/misc/ul |  3 +++
 tests/ts/misc/ul       | 24 ++++++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/expected/misc/ul
 create mode 100755 tests/ts/misc/ul
tests/commands.sh +1 -0
index 2718640..fe79cf4 100644
@@ -69,3 +69,4 @@ TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
 TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
 TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
 TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
+TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
tests/expected/misc/ul new file +3 -0
new file mode 100644
index 0000000..f3aecd1
@@ -0,0 +1,3 @@
+a(Bbc
+        tab
+
\ No newline at end of file
tests/ts/misc/ul new file +24 -0
new file mode 100755
index 0000000..bc0ecf7
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="ul"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "a\x08ab\x5F\x08c\\n\\ttab\\f\\b\\r" |
+	$TS_CMD_UL -t xterm > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#8 lore raw

PATCH 8/22 tests: add ionice(1) check

In reply to Sami Kerola
---
 tests/commands.sh          |  1 +
 tests/expected/misc/ionice |  9 +++++++++
 tests/ts/misc/ionice       | 28 ++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+)
 create mode 100644 tests/expected/misc/ionice
 create mode 100755 tests/ts/misc/ionice
tests/commands.sh +1 -0
index fe79cf4..c5f7140 100644
@@ -70,3 +70,4 @@ TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
 TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
 TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
 TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
+TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
tests/expected/misc/ionice new file +9 -0
new file mode 100644
index 0000000..39cfb60
@@ -0,0 +1,9 @@
+ionice: ignoring given class data for none class
+ionice: unknown prio class 7
+ionice: ioprio_set failed: Invalid argument
+ionice: unknown prio class 7
+ionice: ioprio_set failed: Invalid argument
+ionice: unknown prio class 8
+ionice: ioprio_set failed: Invalid argument
+/etc/passwd
+unknown: prio 0
tests/ts/misc/ionice new file +28 -0
new file mode 100755
index 0000000..d0cca8e
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="ionice"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_IONICE -p $$ -n 0 -c 0 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 3 -c 7 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 4 -c 7 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 1 -c 8 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -n 3 ls /etc/passwd >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ >> $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#9 lore raw

PATCH 9/22 more: allow non-interactive invocation of the command

In reply to Sami Kerola

Needed for testing.

---
 text-utils/more.1 |  5 +++++
 text-utils/more.c | 17 +++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)
text-utils/more.1 +5 -0
index 479f037..b50fdfc 100644
@@ -97,6 +97,11 @@ remainder of each line as it is displayed.
 .B \-s
 Squeeze multiple blank lines into one.
 .TP
+.B \-n
+Allow non-interactive terminal to behave like a normal terminal.  Useful
+for more tests scripts.  The switch will effect properly only when it is
+part of MORE options.
+.TP
 .B \-u
 Suppress underlining.
 .TP
text-utils/more.c +11 -6
index 41caeb1..b115539 100644
@@ -134,7 +134,7 @@ void prepare_line_buffer(void);
 
 struct termios otty, savetty0;
 long file_pos, file_size;
-int fnum, no_intty, no_tty, slow_tty;
+int fnum, no_intty, no_tty, slow_tty, non_interactive;
 int dum_opt, dlines;
 void onquit(int), onsusp(int), chgwinsz(int), end_it(int);
 int nscroll = SCROLL_LEN;	/* Number of lines scrolled by 'd' */
@@ -323,6 +323,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 		  "  -c        suppress scroll, display text and clean line ends\n"
 		  "  -u        suppress underlining\n"
 		  "  -s        squeeze multiple blank lines into one\n"
+		  "  -n        allow non-interactive terminal\n"
 		  "  -NUM      specify the number of lines per screenful\n"
 		  "  +NUM      display file beginning from line number NUM\n"
 		  "  +/STRING  display file beginning from search string match\n"
@@ -351,6 +352,10 @@ int main(int argc, char **argv)
 	nfiles = argc;
 	fnames = argv;
 	setlocale(LC_ALL, "");
+
+	if ((s = getenv("MORE")) != NULL)
+		argscan(s);
+
 	initterm();
 
 	/* Auto set no scroll on when binary is called page */
@@ -362,10 +367,6 @@ int main(int argc, char **argv)
 	nscroll = Lpp / 2 - 1;
 	if (nscroll <= 0)
 		nscroll = 1;
-
-	if ((s = getenv("MORE")) != NULL)
-		argscan(s);
-
 	while (--nfiles > 0) {
 		if ((ch = (*++fnames)[0]) == '-') {
 			argscan(*fnames + 1);
@@ -556,6 +557,9 @@ void argscan(char *s)
 		case 's':
 			ssp_opt = 1;
 			break;
+		case 'n':
+			non_interactive = 1;
+			break;
 		case 'u':
 			ul_opt = 0;
 			break;
@@ -1759,7 +1763,8 @@ void initterm(void)
 #ifdef do_SIGTTOU
  retry:
 #endif
-	no_tty = tcgetattr(fileno(stdout), &otty);
+	if (non_interactive == 0)
+		no_tty = tcgetattr(fileno(stdout), &otty);
 	if (!no_tty) {
 		docrterase = (otty.c_cc[VERASE] != 255);
 		docrtkill = (otty.c_cc[VKILL] != 255);
Signature · 1 line
1.8.1.1
#11 lore raw

PATCH 10/22 tests: add more(1) check

In reply to Sami Kerola
---
 tests/commands.sh           |  1 +
 tests/expected/more/regexp  |  4 ++++
 tests/expected/more/squeeze |  3 +++
 tests/ts/more/regexp        | 24 ++++++++++++++++++++++++
 tests/ts/more/squeeze       | 24 ++++++++++++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 tests/expected/more/regexp
 create mode 100644 tests/expected/more/squeeze
 create mode 100755 tests/ts/more/regexp
 create mode 100755 tests/ts/more/squeeze
tests/commands.sh +1 -0
index c5f7140..dad7010 100644
@@ -71,3 +71,4 @@ TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
 TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
 TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
 TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
+TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
tests/expected/more/regexp new file +4 -0
new file mode 100644
index 0000000..e88c99b
@@ -0,0 +1,4 @@
+
+...skipping
+foo
+xyzzy
tests/expected/more/squeeze new file +3 -0
new file mode 100644
index 0000000..a1a53b5
@@ -0,0 +1,3 @@
+a
+
+b
tests/ts/more/regexp new file +24 -0
new file mode 100755
index 0000000..af2ccc7
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="regexp"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "abba\nbar\nfoo\nxyzzy\n" |
+	MORE='-n' $TS_CMD_MORE +/foo > $TS_OUTPUT 2>&1
+
+ts_finalize
tests/ts/more/squeeze new file +24 -0
new file mode 100755
index 0000000..2aeb053
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="squeeze"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "a\n\n\nb\n" |
+	MORE='-n' $TS_CMD_MORE -s > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#12 lore raw

PATCH 11/22 tests: add line(1) check

In reply to Sami Kerola
---
 tests/commands.sh        |  1 +
 tests/expected/misc/line |  1 +
 tests/ts/misc/line       | 24 ++++++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 tests/expected/misc/line
 create mode 100755 tests/ts/misc/line
tests/commands.sh +1 -0
index dad7010..f1e20ed 100644
@@ -72,3 +72,4 @@ TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
 TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
 TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
 TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
+TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
tests/expected/misc/line new file +1 -0
new file mode 100644
index 0000000..7898192
@@ -0,0 +1 @@
+a
tests/ts/misc/line new file +24 -0
new file mode 100755
index 0000000..41a95fe
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="line"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "a\nb\n" |
+	$TS_CMD_LINE > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#13 lore raw

PATCH 12/22 tests: add dmesg(1) check

In reply to Sami Kerola
---
 tests/commands.sh                   |   1 +
 tests/expected/dmesg/console-levels | 104 +++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/decode         | 105 ++++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/delta          | 105 ++++++++++++++++++++++++++++++++++++
 tests/expected/dmesg/facilities     |  96 +++++++++++++++++++++++++++++++++
 tests/ts/dmesg/console-levels       |  25 +++++++++
 tests/ts/dmesg/decode               |  23 ++++++++
 tests/ts/dmesg/delta                |  23 ++++++++
 tests/ts/dmesg/facilities           |  25 +++++++++
 tests/ts/dmesg/input                | 105 ++++++++++++++++++++++++++++++++++++
 10 files changed, 612 insertions(+)
 create mode 100644 tests/expected/dmesg/console-levels
 create mode 100644 tests/expected/dmesg/decode
 create mode 100644 tests/expected/dmesg/delta
 create mode 100644 tests/expected/dmesg/facilities
 create mode 100755 tests/ts/dmesg/console-levels
 create mode 100755 tests/ts/dmesg/decode
 create mode 100755 tests/ts/dmesg/delta
 create mode 100755 tests/ts/dmesg/facilities
 create mode 100644 tests/ts/dmesg/input
tests/commands.sh +1 -0
index f1e20ed..d4f30a3 100644
@@ -73,3 +73,4 @@ TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
 TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
 TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
 TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
+TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
tests/expected/dmesg/console-levels new file +104 -0

104 lines not on this page · raw message

tests/expected/dmesg/decode new file +105 -0

105 lines not on this page · raw message

tests/expected/dmesg/delta new file +105 -0

105 lines not on this page · raw message

tests/expected/dmesg/facilities new file +96 -0

96 lines not on this page · raw message

tests/ts/dmesg/console-levels new file +25 -0
new file mode 100755
index 0000000..b87d3fd
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="levels"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+for I in {-1..8}; do
+	$TS_CMD_DMESG -F $TS_SELF/input -l $I >> $TS_OUTPUT 2>/dev/null
+done
+
+ts_finalize
tests/ts/dmesg/decode new file +23 -0
new file mode 100755
index 0000000..a1afa6f
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="decode"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_DMESG -x -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/delta new file +23 -0
new file mode 100755
index 0000000..774ffb1
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="delta"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_DMESG -d -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
tests/ts/dmesg/facilities new file +25 -0
new file mode 100755
index 0000000..1b7b0d4
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="facilities"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+for I in {-1..12}; do
+	$TS_CMD_DMESG -F $TS_SELF/input -f $I >> $TS_OUTPUT 2>/dev/null
+done
+
+ts_finalize
tests/ts/dmesg/input new file +105 -0

105 lines not on this page · raw message

Signature · 1 line
1.8.1.1
#14 lore raw

PATCH 13/22 dmesg: add boundary check to facility & level array usage

In reply to Sami Kerola

The dmesg should not crash while --decode'ing message facilities and levels to readable string even if the values are out of bounds.

---
 sys-utils/dmesg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sys-utils/dmesg.c +3 -1
index f95db40..ddab9b4 100644
@@ -803,7 +803,9 @@ static void print_record(struct dmesg_control *ctl,
 	/*
 	 * facility : priority :
 	 */
-	if (ctl->decode && rec->level >= 0 && rec->facility >= 0)
+	if (ctl->decode &&
+	    -1 < rec->level    && rec->level     < (int) ARRAY_SIZE(level_names) &&
+	    -1 < rec->facility && rec->facility  < (int) ARRAY_SIZE(facility_names))
 		printf("%-6s:%-6s: ", facility_names[rec->facility].name,
 				      level_names[rec->level].name);
 
Signature · 1 line
1.8.1.1
#15 lore raw

PATCH 14/22 tests: add setsid(1) check

In reply to Sami Kerola
---
 tests/commands.sh          |  1 +
 tests/expected/misc/setsid |  1 +
 tests/ts/misc/setsid       | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 tests/expected/misc/setsid
 create mode 100755 tests/ts/misc/setsid
tests/commands.sh +1 -0
index d4f30a3..548f95f 100644
@@ -74,3 +74,4 @@ TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
 TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
 TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
 TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
+TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
tests/expected/misc/setsid new file +1 -0
new file mode 100644
index 0000000..2e9ba47
@@ -0,0 +1 @@
+success
tests/ts/misc/setsid new file +23 -0
new file mode 100755
index 0000000..43a76f9
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="setsid"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_SETSID echo "success" > $TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#16 lore raw

PATCH 15/22 tests: add setarch(8) check

In reply to Sami Kerola
---
 tests/commands.sh           |  1 +
 tests/expected/misc/setarch |  1 +
 tests/ts/misc/setarch       | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 tests/expected/misc/setarch
 create mode 100755 tests/ts/misc/setarch
tests/commands.sh +1 -0
index 548f95f..401342f 100644
@@ -75,3 +75,4 @@ TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
 TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
 TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
 TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
+TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
tests/expected/misc/setarch new file +1 -0
new file mode 100644
index 0000000..2e9ba47
@@ -0,0 +1 @@
+success
tests/ts/misc/setarch new file +23 -0
new file mode 100755
index 0000000..8050556
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="setarch"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_SETARCH $(uname -m) -vRFZLXBIST3 --uname-2.6 echo "success" >$TS_OUTPUT 2>&1
+
+ts_finalize
Signature · 1 line
1.8.1.1
#17 lore raw

PATCH 16/22 tests: add fallocate(1) check

In reply to Sami Kerola
---
 tests/commands.sh             |  1 +
 tests/expected/misc/fallocate |  1 +
 tests/ts/misc/fallocate       | 25 +++++++++++++++++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 tests/expected/misc/fallocate
 create mode 100755 tests/ts/misc/fallocate
tests/commands.sh +1 -0
index 401342f..e502aeb 100644
@@ -76,3 +76,4 @@ TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
 TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
 TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
 TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
+TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
tests/expected/misc/fallocate new file +1 -0
new file mode 100644
index 0000000..e45b99e
@@ -0,0 +1 @@
+384
tests/ts/misc/fallocate new file +25 -0
new file mode 100755
index 0000000..4b9db70
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="fallocate"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_FALLOCATE -o 128 -l 256 $TS_SELF/fallocate_test > $TS_OUTPUT 2>&1
+stat -c "%s" $TS_SELF/fallocate_test > $TS_OUTPUT 2>&1
+rm -f $TS_SELF/fallocate_test
+
+ts_finalize
Signature · 1 line
1.8.1.1
#18 lore raw

PATCH 17/22 docs: mkswap.8: recommend fallocate(1)

In reply to Sami Kerola

There is no reason why fallocate(1) should not be preferred instead of 'dd if=/dev/zero of=swapfile' with it's cumbersome size spec.

---
 disk-utils/mkswap.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
disk-utils/mkswap.8 +1 -1
index 219c49f..ab8a44a 100644
@@ -130,7 +130,7 @@ e.g. using a command like
 
 .nf
 .RS
-# dd if=/dev/zero of=swapfile bs=1024 count=65536
+# fallocate -l 8GB swapfile
 .RE
 .fi
 
Signature · 1 line
1.8.1.1
#20 lore raw

PATCH 18/22 tests: add isosize(1) check

In reply to Sami Kerola
---
 tests/commands.sh                 |   1 +
 tests/expected/isosize/print-size |   1 +
 tests/ts/isosize/print-size       |  25 +++++++++++++++++++++++++
 tests/ts/isosize/sample.iso.gz    | Bin 0 -> 632 bytes
 4 files changed, 27 insertions(+)
 create mode 100644 tests/expected/isosize/print-size
 create mode 100755 tests/ts/isosize/print-size
 create mode 100644 tests/ts/isosize/sample.iso.gz
tests/commands.sh +1 -0
index e502aeb..6c172ba 100644
@@ -77,3 +77,4 @@ TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
 TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
 TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
 TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
+TS_CMD_ISOSIZE=${TS_CMD_ISOSIZE-"$top_builddir/isosize"}
tests/expected/isosize/print-size new file +1 -0
new file mode 100644
index 0000000..3def437
@@ -0,0 +1 @@
+515899392
tests/ts/isosize/print-size new file +25 -0
new file mode 100755
index 0000000..399b5b1
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="print-size"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+gzip -cd $TS_SELF/sample.iso.gz > $TS_SELF/sample.iso
+$TS_CMD_ISOSIZE $TS_SELF/sample.iso >| $TS_OUTPUT 2>&1
+rm -f $TS_SELF/sample.iso
+
+ts_finalize
tests/ts/isosize/sample.iso.gz new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..17937a260e71634b68658f02fe06e5d6b2771dbd
GIT binary patch
Signature · 1 line
1.8.1.1
#22 lore raw

PATCH 19/22 tests: add whereis(1) check

In reply to Sami Kerola
---
 tests/commands.sh           |  1 +
 tests/expected/misc/whereis |  1 +
 tests/ts/misc/whereis       | 28 ++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 tests/expected/misc/whereis
 create mode 100755 tests/ts/misc/whereis
tests/commands.sh +1 -0
index 6c172ba..4792ce1 100644
@@ -78,3 +78,4 @@ TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
 TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
 TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
 TS_CMD_ISOSIZE=${TS_CMD_ISOSIZE-"$top_builddir/isosize"}
+TS_CMD_WHEREIS=${TS_CMD_WHEREIS-"$top_builddir/whereis"}
tests/expected/misc/whereis new file +1 -0
new file mode 100644
index 0000000..2e9ba47
@@ -0,0 +1 @@
+success
tests/ts/misc/whereis new file +28 -0
new file mode 100755
index 0000000..853b27a
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="whereis"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+LS_COUNT=$($TS_CMD_WHEREIS ls | wc -w)
+if [ $LS_COUNT -lt 2 ]; then
+	echo "ls binary nor manual not found?" > $TS_OUTPUT
+else
+	echo "success" > $TS_OUTPUT
+fi
+
+ts_finalize
Signature · 1 line
1.8.1.1
#23 lore raw

PATCH 20/22 dmesg: parse level when --color is used

In reply to Sami Kerola

When user runs with --color it should not need to be combined with filtering per level or facility, or decoding.

---
 sys-utils/dmesg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sys-utils/dmesg.c +1 -1
index ddab9b4..080fe7d 100644
@@ -658,7 +658,7 @@ static int get_next_syslog_record(struct dmesg_control *ctl,
 			continue;	/* error or empty line? */
 
 		if (*begin == '<') {
-			if (ctl->fltr_lev || ctl->fltr_fac || ctl->decode)
+			if (ctl->fltr_lev || ctl->fltr_fac || ctl->decode || ctl->color)
 				begin = parse_faclev(begin + 1, &rec->facility,
 						     &rec->level);
 			else
Signature · 1 line
1.8.1.1
#24 lore raw

PATCH 21/22 tests: add ipcmk(1) and ipcrm(1) checks

In reply to Sami Kerola
---
 tests/commands.sh             |  2 ++
 tests/expected/ipcs/mk-rm-msg |  2 ++
 tests/expected/ipcs/mk-rm-sem |  2 ++
 tests/expected/ipcs/mk-rm-shm |  2 ++
 tests/ts/ipcs/functions.sh    | 17 +++++++++++++++++
 tests/ts/ipcs/mk-rm-msg       | 36 ++++++++++++++++++++++++++++++++++++
 tests/ts/ipcs/mk-rm-sem       | 36 ++++++++++++++++++++++++++++++++++++
 tests/ts/ipcs/mk-rm-shm       | 36 ++++++++++++++++++++++++++++++++++++
 8 files changed, 133 insertions(+)
 create mode 100644 tests/expected/ipcs/mk-rm-msg
 create mode 100644 tests/expected/ipcs/mk-rm-sem
 create mode 100644 tests/expected/ipcs/mk-rm-shm
 create mode 100755 tests/ts/ipcs/mk-rm-msg
 create mode 100755 tests/ts/ipcs/mk-rm-sem
 create mode 100755 tests/ts/ipcs/mk-rm-shm
tests/commands.sh +2 -0
index 4792ce1..3138fbf 100644
@@ -79,3 +79,5 @@ TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
 TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
 TS_CMD_ISOSIZE=${TS_CMD_ISOSIZE-"$top_builddir/isosize"}
 TS_CMD_WHEREIS=${TS_CMD_WHEREIS-"$top_builddir/whereis"}
+TS_CMD_IPCMK=${TS_CMD_IPCMK-"$top_builddir/ipcmk"}
+TS_CMD_IPCRM=${TS_CMD_IPCRM-"$top_builddir/ipcrm"}
tests/expected/ipcs/mk-rm-msg new file +2 -0
new file mode 100644
index 0000000..8a82b94
@@ -0,0 +1,2 @@
+Message queue id: <was_number>
+Message queue id: <was_number>
tests/expected/ipcs/mk-rm-sem new file +2 -0
new file mode 100644
index 0000000..a9c3f46
@@ -0,0 +1,2 @@
+Semaphore id: <was_number>
+Semaphore id: <was_number>
tests/expected/ipcs/mk-rm-shm new file +2 -0
new file mode 100644
index 0000000..49d5867
@@ -0,0 +1,2 @@
+Shared memory id: <was_number>
+Shared memory id: <was_number>
tests/ts/ipcs/functions.sh +17 -0
index 24ea445..297d34f 100644
@@ -81,3 +81,20 @@ function ipcs_limits_check {
 	done
 }
 
+# Read 'ipcmk' output, such as 'Shared memory id: 22839299' and
+# write the message to two files: (1) something what one can
+# compare as test output, and (2) id which ipcrm later will use
+# for deletion.
+ipcmk_output_handler() {
+	awk -v text=$1 -v num=$2 '
+	function isnum(x) {
+		return(x == x + 0)
+	}
+	{
+		if (isnum($NF)) {
+			print $NF >> num
+			$NF="<was_number>"
+		}
+		print $0 >> text
+	}'
+}
tests/ts/ipcs/mk-rm-msg new file +36 -0
new file mode 100755
index 0000000..21ecb9c
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="mk-rm-msg"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+. $TS_SELF/functions.sh
+
+rm -f $TS_SELF/id-msg
+$TS_CMD_IPCMK -Q 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-msg
+$TS_CMD_IPCRM -q $(cat $TS_SELF/id-msg) >>$TS_OUTPUT 2>&1
+
+rm -f $TS_SELF/id-msg
+$TS_CMD_IPCMK -Q 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-msg
+$TS_CMD_IPCRM -Q $(
+	$TS_CMD_IPCS -q |
+	awk -v id=$(cat $TS_SELF/id-msg) '{if ($2 == id){print $1}}'
+) >>$TS_OUTPUT 2>&1
+
+rm -f $TS_SELF/id-msg
+
+ts_finalize
tests/ts/ipcs/mk-rm-sem new file +36 -0
new file mode 100755
index 0000000..754940b
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="mk-rm-sem"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+. $TS_SELF/functions.sh
+
+rm -f $TS_SELF/id-sem
+$TS_CMD_IPCMK -S 1 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-sem
+$TS_CMD_IPCRM -s $(cat $TS_SELF/id-sem) >>$TS_OUTPUT 2>&1
+
+rm -f $TS_SELF/id-sem
+$TS_CMD_IPCMK -S 1 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-sem
+$TS_CMD_IPCRM -S $(
+	$TS_CMD_IPCS -s |
+	awk -v id=$(cat $TS_SELF/id-sem) '{if ($2 == id){print $1}}'
+) >>$TS_OUTPUT 2>&1
+
+rm -f $TS_SELF/id-sem
+
+ts_finalize
tests/ts/ipcs/mk-rm-shm new file +36 -0
new file mode 100755
index 0000000..707d359
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="mk-rm-shm"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+. $TS_SELF/functions.sh
+
+rm -f $TS_SELF/id-shm
+$TS_CMD_IPCMK -M 1 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-shm
+$TS_CMD_IPCRM -m $(cat $TS_SELF/id-shm) >>$TS_OUTPUT 2>&1
+rm -f $TS_SELF/id-shm
+
+$TS_CMD_IPCMK -M 1 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_SELF/id-shm
+$TS_CMD_IPCRM -M $(
+	$TS_CMD_IPCS -m |
+	awk -v id=$(cat $TS_SELF/id-shm) '{if ($2 == id){print $1}}'
+) >>$TS_OUTPUT 2>&1
+
+rm -f $TS_SELF/id-shm
+
+ts_finalize
Signature · 1 line
1.8.1.1
#25 lore raw

PATCH 22/22 tests: sort commands strings

In reply to Sami Kerola

The list is starting to be long enough that making any order to it seems like right thing to do.

---
 tests/commands.sh | 81 ++++++++++++++++++++++++-------------------------------
 1 file changed, 35 insertions(+), 46 deletions(-)
tests/commands.sh +35 -46
index 3138fbf..787a4be 100644
@@ -26,58 +26,47 @@ TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
 # TODO: use partx
 TS_HELPER_PARTITIONS="$top_builddir/sample-partitions"
 
-# paths to commands
-TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount"}
-TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/umount"}
-
-TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$top_builddir/swapon"}
-TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$top_builddir/swapoff"}
-TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$top_builddir/losetup"}
-
-TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/mkswap"}
-TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/mkfs.cramfs"}
-TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/mkfs.minix"}
-TS_CMD_FSCKCRAMFS=${TS_CMD_FSCKCRAMFS:-"$top_builddir/test_fsck.cramfs"}
-TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/fsck.minix"}
-
-TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/ipcs"}
-
+# paths to commands (keep in a to z order)
+TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/blkid"}
+TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/cal"}
 TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/col"}
-TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/column"}
 TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/colrm"}
-TS_CMD_REV=${TS_CMD_REV:-"$top_builddir/rev"}
-
-TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
-TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/look"}
-TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/cal"}
-TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/script"}
+TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/column"}
+TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
 TS_CMD_EJECT=${TS_CMD_EJECT-"$top_builddir/eject"}
-
-
-TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock"}
-TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/lscpu"}
-
-TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/blkid"}
-TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx"}
-TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
-
+TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
 TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
-
-TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
-
-TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
+TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
+TS_CMD_FSCKCRAMFS=${TS_CMD_FSCKCRAMFS:-"$top_builddir/test_fsck.cramfs"}
+TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/fsck.minix"}
 TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
-TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
-TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
-TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
+TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
+TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock"}
 TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
-TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
+TS_CMD_IPCMK=${TS_CMD_IPCMK-"$top_builddir/ipcmk"}
+TS_CMD_IPCRM=${TS_CMD_IPCRM-"$top_builddir/ipcrm"}
+TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/ipcs"}
+TS_CMD_ISOSIZE=${TS_CMD_ISOSIZE-"$top_builddir/isosize"}
 TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"}
-TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"}
-TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
+TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/look"}
+TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$top_builddir/losetup"}
+TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/lscpu"}
+TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
+TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/mkfs.cramfs"}
+TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/mkfs.minix"}
+TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/mkswap"}
+TS_CMD_MORE=${TS_CMD_MORE-"$top_builddir/more"}
+TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount"}
+TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
+TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx"}
+TS_CMD_REV=${TS_CMD_REV:-"$top_builddir/rev"}
+TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/script"}
 TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"}
-TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"}
-TS_CMD_ISOSIZE=${TS_CMD_ISOSIZE-"$top_builddir/isosize"}
+TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"}
+TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$top_builddir/swapoff"}
+TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$top_builddir/swapon"}
+TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
+TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
+TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/umount"}
+TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
 TS_CMD_WHEREIS=${TS_CMD_WHEREIS-"$top_builddir/whereis"}
-TS_CMD_IPCMK=${TS_CMD_IPCMK-"$top_builddir/ipcmk"}
-TS_CMD_IPCRM=${TS_CMD_IPCRM-"$top_builddir/ipcrm"}
Signature · 1 line
1.8.1.1
#1 lore raw

PATCH 1/22 build-sys: add gcov files to .gitignore

In reply to Sami Kerola
---
 .gitignore | 3 +++
 1 file changed, 3 insertions(+)
.gitignore +3 -0
index e85eb07..5a62721 100644
@@ -9,6 +9,9 @@
 *.la
 *.so.*
 *.pc
+*.gcda
+*.gcno
+*.gcov
 Makefile
 aclocal.m4
 autom4te.cache
Signature · 1 line
1.8.1.1
maintainer
#10 lore raw

Re: [PATCH 09/22] more: allow non-interactive invocation of the command

In reply to Sami Kerola

text-utils/more.c void initterm(void) · line 1767

Quoted 3 lines · Sami Kerola
text-utils/more.c +2 -1
-	no_tty = tcgetattr(fileno(stdout), &otty);
+	if (non_interactive == 0)
+		no_tty = tcgetattr(fileno(stdout), &otty);

I have added #ifdef TEST_PROGRAM to enable non-interactive mode, and in the tests we use "test_more" binary. It seems less invasive than to add the -n option.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
maintainer Applied
#19 lore raw

Re: [PATCH 17/22] docs: mkswap.8: recommend fallocate(1)

In reply to Sami Kerola
Quoted 1 line · Sami Kerola

+# fallocate -l 8GB swapfile

Applied. It seems more readable to use long option in examples:

   fallocate --length 8GiB swapfile

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
maintainer
#21 lore raw

Re: [PATCH 18/22] tests: add isosize(1) check

In reply to Sami Kerola
Quoted 1 line · Sami Kerola

+gzip -cd $TS_SELF/sample.iso.gz > $TS_SELF/sample.iso

Applied, note that tests/ts ($TS_SELF) directory should be used read-only. It's better to write to $TS_OUTDIR.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com