* [PATCH 00/22] tests: lots of tests
@ 2013-01-19 0:08 Sami Kerola
2013-01-19 0:08 ` [PATCH 01/22] build-sys: add gcov files to .gitignore Sami Kerola
` (22 more replies)
0 siblings, 23 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
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
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 01/22] build-sys: add gcov files to .gitignore
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 02/22] tests: add rev(1) check Sami Kerola
` (21 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index e85eb07..5a62721 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,9 @@
*.la
*.so.*
*.pc
+*.gcda
+*.gcno
+*.gcov
Makefile
aclocal.m4
autom4te.cache
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 02/22] tests: add rev(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
2013-01-19 0:08 ` [PATCH 01/22] build-sys: add gcov files to .gitignore Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 03/22] tests: add utmpdump(1) check Sami Kerola
` (20 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Fairly lenghty input line tries to ensure realloc segment in code is hit
at least once.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 3672095..f1643a6 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/rev b/tests/expected/misc/rev
new file mode 100644
index 0000000..77ceb56
--- /dev/null
+++ b/tests/expected/misc/rev
@@ -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
diff --git a/tests/ts/misc/rev b/tests/ts/misc/rev
new file mode 100755
index 0000000..d1fba16
--- /dev/null
+++ b/tests/ts/misc/rev
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 03/22] tests: add utmpdump(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
2013-01-19 0:08 ` [PATCH 01/22] build-sys: add gcov files to .gitignore Sami Kerola
2013-01-19 0:08 ` [PATCH 02/22] tests: add rev(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 04/22] tests: add getopt(1) check Sami Kerola
` (19 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index f1643a6..73725c9 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/utmpdump/to-binary b/tests/expected/utmpdump/to-binary
new file mode 100644
index 0000000000000000000000000000000000000000..45d35bbb0ba5f1c3db170f18b1a4da1c7f92cf61
GIT binary patch
literal 3840
zcmZQ)U|?9}#K2HcQmk(XWa9!L>Fm^^{G7z%L|kgD4D<|e$&Dm&PwVdi#QK*Vs4yrD
z68=VbGy%ikXf*us1Q3!`tqp169}G;<p!9EyWCl7DBt07b=%Iq0@A{Vb@aF&;L9Ot|
z?wXM&I+29%2bDid%SY2cHB-s)AEc#!YK1>F{V<fx+Wnuj@TXS&JCwtWnr^>AV)#?5
r{Ygzf3}v%O34c)eZ&^Ls{-<Vq2gdv$sr?_2KidAMX82FeAU^y7&E#d^
literal 0
HcmV?d00001
diff --git a/tests/expected/utmpdump/to-text b/tests/expected/utmpdump/to-text
new file mode 100644
index 0000000..02fb22d
--- /dev/null
+++ b/tests/expected/utmpdump/to-text
@@ -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]
diff --git a/tests/ts/utmpdump/binary b/tests/ts/utmpdump/binary
new file mode 100644
index 0000000000000000000000000000000000000000..45d35bbb0ba5f1c3db170f18b1a4da1c7f92cf61
GIT binary patch
literal 3840
zcmZQ)U|?9}#K2HcQmk(XWa9!L>Fm^^{G7z%L|kgD4D<|e$&Dm&PwVdi#QK*Vs4yrD
z68=VbGy%ikXf*us1Q3!`tqp169}G;<p!9EyWCl7DBt07b=%Iq0@A{Vb@aF&;L9Ot|
z?wXM&I+29%2bDid%SY2cHB-s)AEc#!YK1>F{V<fx+Wnuj@TXS&JCwtWnr^>AV)#?5
r{Ygzf3}v%O34c)eZ&^Ls{-<Vq2gdv$sr?_2KidAMX82FeAU^y7&E#d^
literal 0
HcmV?d00001
diff --git a/tests/ts/utmpdump/text b/tests/ts/utmpdump/text
new file mode 100644
index 0000000..02fb22d
--- /dev/null
+++ b/tests/ts/utmpdump/text
@@ -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]
diff --git a/tests/ts/utmpdump/to-binary b/tests/ts/utmpdump/to-binary
new file mode 100755
index 0000000..25acbf6
--- /dev/null
+++ b/tests/ts/utmpdump/to-binary
@@ -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
diff --git a/tests/ts/utmpdump/to-text b/tests/ts/utmpdump/to-text
new file mode 100755
index 0000000..f454e5f
--- /dev/null
+++ b/tests/ts/utmpdump/to-text
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 04/22] tests: add getopt(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (2 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 03/22] tests: add utmpdump(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 05/22] tests: add mcookie(1) check Sami Kerola
` (18 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 73725c9..cb2f444 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/getopt b/tests/expected/misc/getopt
new file mode 100644
index 0000000..c2c90ae
--- /dev/null
+++ b/tests/expected/misc/getopt
@@ -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'
diff --git a/tests/ts/misc/getopt b/tests/ts/misc/getopt
new file mode 100755
index 0000000..a6b91cb
--- /dev/null
+++ b/tests/ts/misc/getopt
@@ -0,0 +1,46 @@
+#!/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.
+
+# This test script is modified version of 'getopt-parse.bash' example
+# file in misc/ directory.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="getopt"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+TEMP=$($TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.bash' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar)
+
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+
+eval set -- "$TEMP"
+
+while true ; do
+ case "$1" in
+ -a|--a-long) echo "Option a" >> $TS_OUTPUT 2>&1; shift ;;
+ -b|--b-long) echo "Option b, argument \`$2'" >> $TS_OUTPUT 2>&1; shift 2 ;;
+ -c|--c-long)
+ case "$2" in
+ "") echo "Option c, no argument" >> $TS_OUTPUT 2>&1; shift 2 ;;
+ *) echo "Option c, argument \`$2'" >> $TS_OUTPUT 2>&1; shift 2 ;;
+ esac ;;
+ --) shift ; break ;;
+ *) echo "Internal error!" >> $TS_OUTPUT 2>&1; exit 1 ;;
+ esac
+done
+echo "Remaining arguments:" >> $TS_OUTPUT 2>&1
+for arg do echo '--> '"\`$arg'" >> $TS_OUTPUT 2>&1; done
+
+ts_finalize
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 05/22] tests: add mcookie(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (3 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 04/22] tests: add getopt(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 06/22] tests: add tailf(1) check Sami Kerola
` (17 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index cb2f444..3465d41 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/mcookie b/tests/expected/misc/mcookie
new file mode 100644
index 0000000..d1c0351
--- /dev/null
+++ b/tests/expected/misc/mcookie
@@ -0,0 +1 @@
+the string meets expecations
diff --git a/tests/ts/misc/mcookie b/tests/ts/misc/mcookie
new file mode 100755
index 0000000..9e650b2
--- /dev/null
+++ b/tests/ts/misc/mcookie
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 06/22] tests: add tailf(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (4 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 05/22] tests: add mcookie(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 07/22] tests: add ul(1) check Sami Kerola
` (16 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 3465d41..2718640 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/tailf/simple b/tests/expected/tailf/simple
new file mode 100644
index 0000000..ddf72de
--- /dev/null
+++ b/tests/expected/tailf/simple
@@ -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
diff --git a/tests/ts/tailf/simple b/tests/ts/tailf/simple
new file mode 100755
index 0000000..ad00b25
--- /dev/null
+++ b/tests/ts/tailf/simple
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 07/22] tests: add ul(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (5 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 06/22] tests: add tailf(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 08/22] tests: add ionice(1) check Sami Kerola
` (15 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 2718640..fe79cf4 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/ul b/tests/expected/misc/ul
new file mode 100644
index 0000000..f3aecd1
--- /dev/null
+++ b/tests/expected/misc/ul
@@ -0,0 +1,3 @@
+^[[1ma^[(B^[[mb^[[4mc^[[24m
+ tab
+\f
\ No newline at end of file
diff --git a/tests/ts/misc/ul b/tests/ts/misc/ul
new file mode 100755
index 0000000..bc0ecf7
--- /dev/null
+++ b/tests/ts/misc/ul
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 08/22] tests: add ionice(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (6 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 07/22] tests: add ul(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:08 ` [PATCH 09/22] more: allow non-interactive invocation of the command Sami Kerola
` (14 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index fe79cf4..c5f7140 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/ionice b/tests/expected/misc/ionice
new file mode 100644
index 0000000..39cfb60
--- /dev/null
+++ b/tests/expected/misc/ionice
@@ -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
diff --git a/tests/ts/misc/ionice b/tests/ts/misc/ionice
new file mode 100755
index 0000000..d0cca8e
--- /dev/null
+++ b/tests/ts/misc/ionice
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 09/22] more: allow non-interactive invocation of the command
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (7 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 08/22] tests: add ionice(1) check Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-24 18:33 ` Karel Zak
2013-01-19 0:08 ` [PATCH 10/22] tests: add more(1) check Sami Kerola
` (13 subsequent siblings)
22 siblings, 1 reply; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Needed for testing.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
text-utils/more.1 | 5 +++++
text-utils/more.c | 17 +++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/text-utils/more.1 b/text-utils/more.1
index 479f037..b50fdfc 100644
--- a/text-utils/more.1
+++ b/text-utils/more.1
@@ -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
diff --git a/text-utils/more.c b/text-utils/more.c
index 41caeb1..b115539 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -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);
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 10/22] tests: add more(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (8 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 09/22] more: allow non-interactive invocation of the command Sami Kerola
@ 2013-01-19 0:08 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 11/22] tests: add line(1) check Sami Kerola
` (12 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:08 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index c5f7140..dad7010 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/more/regexp b/tests/expected/more/regexp
new file mode 100644
index 0000000..e88c99b
--- /dev/null
+++ b/tests/expected/more/regexp
@@ -0,0 +1,4 @@
+
+...skipping
+foo
+xyzzy
diff --git a/tests/expected/more/squeeze b/tests/expected/more/squeeze
new file mode 100644
index 0000000..a1a53b5
--- /dev/null
+++ b/tests/expected/more/squeeze
@@ -0,0 +1,3 @@
+a
+
+b
diff --git a/tests/ts/more/regexp b/tests/ts/more/regexp
new file mode 100755
index 0000000..af2ccc7
--- /dev/null
+++ b/tests/ts/more/regexp
@@ -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
diff --git a/tests/ts/more/squeeze b/tests/ts/more/squeeze
new file mode 100755
index 0000000..2aeb053
--- /dev/null
+++ b/tests/ts/more/squeeze
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 11/22] tests: add line(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (9 preceding siblings ...)
2013-01-19 0:08 ` [PATCH 10/22] tests: add more(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 12/22] tests: add dmesg(1) check Sami Kerola
` (11 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index dad7010..f1e20ed 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/line b/tests/expected/misc/line
new file mode 100644
index 0000000..7898192
--- /dev/null
+++ b/tests/expected/misc/line
@@ -0,0 +1 @@
+a
diff --git a/tests/ts/misc/line b/tests/ts/misc/line
new file mode 100755
index 0000000..41a95fe
--- /dev/null
+++ b/tests/ts/misc/line
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 12/22] tests: add dmesg(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (10 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 11/22] tests: add line(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 13/22] dmesg: add boundary check to facility & level array usage Sami Kerola
` (10 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index f1e20ed..d4f30a3 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/dmesg/console-levels b/tests/expected/dmesg/console-levels
new file mode 100644
index 0000000..48b0a1d
--- /dev/null
+++ b/tests/expected/dmesg/console-levels
@@ -0,0 +1,104 @@
+[ 0.000000] example[0]
+[ 512.000000] example[8]
+[ 4096.000000] example[16]
+[13824.000000] example[24]
+[32768.000000] example[32]
+[64000.000000] example[40]
+[110592.000000] example[48]
+[175616.000000] example[56]
+[262144.000000] example[64]
+[373248.000000] example[72]
+[512000.000000] example[80]
+[681472.000000] example[88]
+[884736.000000] example[96]
+[ 1.000000] example[1]
+[ 729.000000] example[9]
+[ 4913.000000] example[17]
+[15625.000000] example[25]
+[35937.000000] example[33]
+[68921.000000] example[41]
+[117649.000000] example[49]
+[185193.000000] example[57]
+[274625.000000] example[65]
+[389017.000000] example[73]
+[531441.000000] example[81]
+[704969.000000] example[89]
+[912673.000000] example[97]
+[ 8.000000] example[2]
+[ 1000.000000] example[10]
+[ 5832.000000] example[18]
+[17576.000000] example[26]
+[39304.000000] example[34]
+[74088.000000] example[42]
+[125000.000000] example[50]
+[195112.000000] example[58]
+[287496.000000] example[66]
+[405224.000000] example[74]
+[551368.000000] example[82]
+[729000.000000] example[90]
+[941192.000000] example[98]
+[ 27.000000] example[3]
+[ 1331.000000] example[11]
+[ 6859.000000] example[19]
+[19683.000000] example[27]
+[42875.000000] example[35]
+[79507.000000] example[43]
+[132651.000000] example[51]
+[205379.000000] example[59]
+[300763.000000] example[67]
+[421875.000000] example[75]
+[571787.000000] example[83]
+[753571.000000] example[91]
+[970299.000000] example[99]
+[ 64.000000] example[4]
+[ 1728.000000] example[12]
+[ 8000.000000] example[20]
+[21952.000000] example[28]
+[46656.000000] example[36]
+[85184.000000] example[44]
+[140608.000000] example[52]
+[216000.000000] example[60]
+[314432.000000] example[68]
+[438976.000000] example[76]
+[592704.000000] example[84]
+[778688.000000] example[92]
+[1000000.000000] example[100]
+[ 125.000000] example[5]
+[ 2197.000000] example[13]
+[ 9261.000000] example[21]
+[24389.000000] example[29]
+[50653.000000] example[37]
+[91125.000000] example[45]
+[148877.000000] example[53]
+[226981.000000] example[61]
+[328509.000000] example[69]
+[456533.000000] example[77]
+[614125.000000] example[85]
+[804357.000000] example[93]
+[1030301.000000] example[101]
+[ 216.000000] example[6]
+[ 2744.000000] example[14]
+[10648.000000] example[22]
+[27000.000000] example[30]
+[54872.000000] example[38]
+[97336.000000] example[46]
+[157464.000000] example[54]
+[238328.000000] example[62]
+[343000.000000] example[70]
+[474552.000000] example[78]
+[636056.000000] example[86]
+[830584.000000] example[94]
+[1061208.000000] example[102]
+[ 343.000000] example[7]
+[ 3375.000000] example[15]
+[12167.000000] example[23]
+[29791.000000] example[31]
+[59319.000000] example[39]
+[103823.000000] example[47]
+[166375.000000] example[55]
+[250047.000000] example[63]
+[357911.000000] example[71]
+[493039.000000] example[79]
+[658503.000000] example[87]
+[857375.000000] example[95]
+[1092727.000000] example[103]
diff --git a/tests/expected/dmesg/decode b/tests/expected/dmesg/decode
new file mode 100644
index 0000000..f3541a6
--- /dev/null
+++ b/tests/expected/dmesg/decode
@@ -0,0 +1,105 @@
+kern :emerg : [ 0.000000] example[0]
+kern :alert : [ 1.000000] example[1]
+kern :crit : [ 8.000000] example[2]
+kern :err : [ 27.000000] example[3]
+kern :warn : [ 64.000000] example[4]
+kern :notice: [ 125.000000] example[5]
+kern :info : [ 216.000000] example[6]
+kern :debug : [ 343.000000] example[7]
+user :emerg : [ 512.000000] example[8]
+user :alert : [ 729.000000] example[9]
+user :crit : [ 1000.000000] example[10]
+user :err : [ 1331.000000] example[11]
+user :warn : [ 1728.000000] example[12]
+user :notice: [ 2197.000000] example[13]
+user :info : [ 2744.000000] example[14]
+user :debug : [ 3375.000000] example[15]
+mail :emerg : [ 4096.000000] example[16]
+mail :alert : [ 4913.000000] example[17]
+mail :crit : [ 5832.000000] example[18]
+mail :err : [ 6859.000000] example[19]
+mail :warn : [ 8000.000000] example[20]
+mail :notice: [ 9261.000000] example[21]
+mail :info : [10648.000000] example[22]
+mail :debug : [12167.000000] example[23]
+daemon:emerg : [13824.000000] example[24]
+daemon:alert : [15625.000000] example[25]
+daemon:crit : [17576.000000] example[26]
+daemon:err : [19683.000000] example[27]
+daemon:warn : [21952.000000] example[28]
+daemon:notice: [24389.000000] example[29]
+daemon:info : [27000.000000] example[30]
+daemon:debug : [29791.000000] example[31]
+auth :emerg : [32768.000000] example[32]
+auth :alert : [35937.000000] example[33]
+auth :crit : [39304.000000] example[34]
+auth :err : [42875.000000] example[35]
+auth :warn : [46656.000000] example[36]
+auth :notice: [50653.000000] example[37]
+auth :info : [54872.000000] example[38]
+auth :debug : [59319.000000] example[39]
+syslog:emerg : [64000.000000] example[40]
+syslog:alert : [68921.000000] example[41]
+syslog:crit : [74088.000000] example[42]
+syslog:err : [79507.000000] example[43]
+syslog:warn : [85184.000000] example[44]
+syslog:notice: [91125.000000] example[45]
+syslog:info : [97336.000000] example[46]
+syslog:debug : [103823.000000] example[47]
+lpr :emerg : [110592.000000] example[48]
+lpr :alert : [117649.000000] example[49]
+lpr :crit : [125000.000000] example[50]
+lpr :err : [132651.000000] example[51]
+lpr :warn : [140608.000000] example[52]
+lpr :notice: [148877.000000] example[53]
+lpr :info : [157464.000000] example[54]
+lpr :debug : [166375.000000] example[55]
+news :emerg : [175616.000000] example[56]
+news :alert : [185193.000000] example[57]
+news :crit : [195112.000000] example[58]
+news :err : [205379.000000] example[59]
+news :warn : [216000.000000] example[60]
+news :notice: [226981.000000] example[61]
+news :info : [238328.000000] example[62]
+news :debug : [250047.000000] example[63]
+uucp :emerg : [262144.000000] example[64]
+uucp :alert : [274625.000000] example[65]
+uucp :crit : [287496.000000] example[66]
+uucp :err : [300763.000000] example[67]
+uucp :warn : [314432.000000] example[68]
+uucp :notice: [328509.000000] example[69]
+uucp :info : [343000.000000] example[70]
+uucp :debug : [357911.000000] example[71]
+cron :emerg : [373248.000000] example[72]
+cron :alert : [389017.000000] example[73]
+cron :crit : [405224.000000] example[74]
+cron :err : [421875.000000] example[75]
+cron :warn : [438976.000000] example[76]
+cron :notice: [456533.000000] example[77]
+cron :info : [474552.000000] example[78]
+cron :debug : [493039.000000] example[79]
+authpriv:emerg : [512000.000000] example[80]
+authpriv:alert : [531441.000000] example[81]
+authpriv:crit : [551368.000000] example[82]
+authpriv:err : [571787.000000] example[83]
+authpriv:warn : [592704.000000] example[84]
+authpriv:notice: [614125.000000] example[85]
+authpriv:info : [636056.000000] example[86]
+authpriv:debug : [658503.000000] example[87]
+ftp :emerg : [681472.000000] example[88]
+ftp :alert : [704969.000000] example[89]
+ftp :crit : [729000.000000] example[90]
+ftp :err : [753571.000000] example[91]
+ftp :warn : [778688.000000] example[92]
+ftp :notice: [804357.000000] example[93]
+ftp :info : [830584.000000] example[94]
+ftp :debug : [857375.000000] example[95]
+[884736.000000] example[96]
+[912673.000000] example[97]
+[941192.000000] example[98]
+[970299.000000] example[99]
+[1000000.000000] example[100]
+[1030301.000000] example[101]
+[1061208.000000] example[102]
+[1092727.000000] example[103]
+[1124864.000000] example[104]
diff --git a/tests/expected/dmesg/delta b/tests/expected/dmesg/delta
new file mode 100644
index 0000000..01dfec3
--- /dev/null
+++ b/tests/expected/dmesg/delta
@@ -0,0 +1,105 @@
+[ 0.000000 < 0.000000>] example[0]
+[ 1.000000 < 0.000000>] example[1]
+[ 8.000000 < 7.000000>] example[2]
+[ 27.000000 < 19.000000>] example[3]
+[ 64.000000 < 37.000000>] example[4]
+[ 125.000000 < 61.000000>] example[5]
+[ 216.000000 < 91.000000>] example[6]
+[ 343.000000 < 127.000000>] example[7]
+[ 512.000000 < 169.000000>] example[8]
+[ 729.000000 < 217.000000>] example[9]
+[ 1000.000000 < 271.000000>] example[10]
+[ 1331.000000 < 331.000000>] example[11]
+[ 1728.000000 < 397.000000>] example[12]
+[ 2197.000000 < 469.000000>] example[13]
+[ 2744.000000 < 547.000000>] example[14]
+[ 3375.000000 < 631.000000>] example[15]
+[ 4096.000000 < 721.000000>] example[16]
+[ 4913.000000 < 817.000000>] example[17]
+[ 5832.000000 < 919.000000>] example[18]
+[ 6859.000000 < 1027.000000>] example[19]
+[ 8000.000000 < 1141.000000>] example[20]
+[ 9261.000000 < 1261.000000>] example[21]
+[10648.000000 < 1387.000000>] example[22]
+[12167.000000 < 1519.000000>] example[23]
+[13824.000000 < 1657.000000>] example[24]
+[15625.000000 < 1801.000000>] example[25]
+[17576.000000 < 1951.000000>] example[26]
+[19683.000000 < 2107.000000>] example[27]
+[21952.000000 < 2269.000000>] example[28]
+[24389.000000 < 2437.000000>] example[29]
+[27000.000000 < 2611.000000>] example[30]
+[29791.000000 < 2791.000000>] example[31]
+[32768.000000 < 2977.000000>] example[32]
+[35937.000000 < 3169.000000>] example[33]
+[39304.000000 < 3367.000000>] example[34]
+[42875.000000 < 3571.000000>] example[35]
+[46656.000000 < 3781.000000>] example[36]
+[50653.000000 < 3997.000000>] example[37]
+[54872.000000 < 4219.000000>] example[38]
+[59319.000000 < 4447.000000>] example[39]
+[64000.000000 < 4681.000000>] example[40]
+[68921.000000 < 4921.000000>] example[41]
+[74088.000000 < 5167.000000>] example[42]
+[79507.000000 < 5419.000000>] example[43]
+[85184.000000 < 5677.000000>] example[44]
+[91125.000000 < 5941.000000>] example[45]
+[97336.000000 < 6211.000000>] example[46]
+[103823.000000 < 6487.000000>] example[47]
+[110592.000000 < 6769.000000>] example[48]
+[117649.000000 < 7057.000000>] example[49]
+[125000.000000 < 7351.000000>] example[50]
+[132651.000000 < 7651.000000>] example[51]
+[140608.000000 < 7957.000000>] example[52]
+[148877.000000 < 8269.000000>] example[53]
+[157464.000000 < 8587.000000>] example[54]
+[166375.000000 < 8911.000000>] example[55]
+[175616.000000 < 9241.000000>] example[56]
+[185193.000000 < 9577.000000>] example[57]
+[195112.000000 < 9919.000000>] example[58]
+[205379.000000 <10267.000000>] example[59]
+[216000.000000 <10621.000000>] example[60]
+[226981.000000 <10981.000000>] example[61]
+[238328.000000 <11347.000000>] example[62]
+[250047.000000 <11719.000000>] example[63]
+[262144.000000 <12097.000000>] example[64]
+[274625.000000 <12481.000000>] example[65]
+[287496.000000 <12871.000000>] example[66]
+[300763.000000 <13267.000000>] example[67]
+[314432.000000 <13669.000000>] example[68]
+[328509.000000 <14077.000000>] example[69]
+[343000.000000 <14491.000000>] example[70]
+[357911.000000 <14911.000000>] example[71]
+[373248.000000 <15337.000000>] example[72]
+[389017.000000 <15769.000000>] example[73]
+[405224.000000 <16207.000000>] example[74]
+[421875.000000 <16651.000000>] example[75]
+[438976.000000 <17101.000000>] example[76]
+[456533.000000 <17557.000000>] example[77]
+[474552.000000 <18019.000000>] example[78]
+[493039.000000 <18487.000000>] example[79]
+[512000.000000 <18961.000000>] example[80]
+[531441.000000 <19441.000000>] example[81]
+[551368.000000 <19927.000000>] example[82]
+[571787.000000 <20419.000000>] example[83]
+[592704.000000 <20917.000000>] example[84]
+[614125.000000 <21421.000000>] example[85]
+[636056.000000 <21931.000000>] example[86]
+[658503.000000 <22447.000000>] example[87]
+[681472.000000 <22969.000000>] example[88]
+[704969.000000 <23497.000000>] example[89]
+[729000.000000 <24031.000000>] example[90]
+[753571.000000 <24571.000000>] example[91]
+[778688.000000 <25117.000000>] example[92]
+[804357.000000 <25669.000000>] example[93]
+[830584.000000 <26227.000000>] example[94]
+[857375.000000 <26791.000000>] example[95]
+[884736.000000 <27361.000000>] example[96]
+[912673.000000 <27937.000000>] example[97]
+[941192.000000 <28519.000000>] example[98]
+[970299.000000 <29107.000000>] example[99]
+[1000000.000000 <29701.000000>] example[100]
+[1030301.000000 <30301.000000>] example[101]
+[1061208.000000 <30907.000000>] example[102]
+[1092727.000000 <31519.000000>] example[103]
+[1124864.000000 <32137.000000>] example[104]
diff --git a/tests/expected/dmesg/facilities b/tests/expected/dmesg/facilities
new file mode 100644
index 0000000..9733e56
--- /dev/null
+++ b/tests/expected/dmesg/facilities
@@ -0,0 +1,96 @@
+[ 0.000000] example[0]
+[ 1.000000] example[1]
+[ 8.000000] example[2]
+[ 27.000000] example[3]
+[ 64.000000] example[4]
+[ 125.000000] example[5]
+[ 216.000000] example[6]
+[ 343.000000] example[7]
+[ 512.000000] example[8]
+[ 729.000000] example[9]
+[ 1000.000000] example[10]
+[ 1331.000000] example[11]
+[ 1728.000000] example[12]
+[ 2197.000000] example[13]
+[ 2744.000000] example[14]
+[ 3375.000000] example[15]
+[ 4096.000000] example[16]
+[ 4913.000000] example[17]
+[ 5832.000000] example[18]
+[ 6859.000000] example[19]
+[ 8000.000000] example[20]
+[ 9261.000000] example[21]
+[10648.000000] example[22]
+[12167.000000] example[23]
+[13824.000000] example[24]
+[15625.000000] example[25]
+[17576.000000] example[26]
+[19683.000000] example[27]
+[21952.000000] example[28]
+[24389.000000] example[29]
+[27000.000000] example[30]
+[29791.000000] example[31]
+[32768.000000] example[32]
+[35937.000000] example[33]
+[39304.000000] example[34]
+[42875.000000] example[35]
+[46656.000000] example[36]
+[50653.000000] example[37]
+[54872.000000] example[38]
+[59319.000000] example[39]
+[64000.000000] example[40]
+[68921.000000] example[41]
+[74088.000000] example[42]
+[79507.000000] example[43]
+[85184.000000] example[44]
+[91125.000000] example[45]
+[97336.000000] example[46]
+[103823.000000] example[47]
+[110592.000000] example[48]
+[117649.000000] example[49]
+[125000.000000] example[50]
+[132651.000000] example[51]
+[140608.000000] example[52]
+[148877.000000] example[53]
+[157464.000000] example[54]
+[166375.000000] example[55]
+[175616.000000] example[56]
+[185193.000000] example[57]
+[195112.000000] example[58]
+[205379.000000] example[59]
+[216000.000000] example[60]
+[226981.000000] example[61]
+[238328.000000] example[62]
+[250047.000000] example[63]
+[262144.000000] example[64]
+[274625.000000] example[65]
+[287496.000000] example[66]
+[300763.000000] example[67]
+[314432.000000] example[68]
+[328509.000000] example[69]
+[343000.000000] example[70]
+[357911.000000] example[71]
+[373248.000000] example[72]
+[389017.000000] example[73]
+[405224.000000] example[74]
+[421875.000000] example[75]
+[438976.000000] example[76]
+[456533.000000] example[77]
+[474552.000000] example[78]
+[493039.000000] example[79]
+[512000.000000] example[80]
+[531441.000000] example[81]
+[551368.000000] example[82]
+[571787.000000] example[83]
+[592704.000000] example[84]
+[614125.000000] example[85]
+[636056.000000] example[86]
+[658503.000000] example[87]
+[681472.000000] example[88]
+[704969.000000] example[89]
+[729000.000000] example[90]
+[753571.000000] example[91]
+[778688.000000] example[92]
+[804357.000000] example[93]
+[830584.000000] example[94]
+[857375.000000] example[95]
diff --git a/tests/ts/dmesg/console-levels b/tests/ts/dmesg/console-levels
new file mode 100755
index 0000000..b87d3fd
--- /dev/null
+++ b/tests/ts/dmesg/console-levels
@@ -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
diff --git a/tests/ts/dmesg/decode b/tests/ts/dmesg/decode
new file mode 100755
index 0000000..a1afa6f
--- /dev/null
+++ b/tests/ts/dmesg/decode
@@ -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
diff --git a/tests/ts/dmesg/delta b/tests/ts/dmesg/delta
new file mode 100755
index 0000000..774ffb1
--- /dev/null
+++ b/tests/ts/dmesg/delta
@@ -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
diff --git a/tests/ts/dmesg/facilities b/tests/ts/dmesg/facilities
new file mode 100755
index 0000000..1b7b0d4
--- /dev/null
+++ b/tests/ts/dmesg/facilities
@@ -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
diff --git a/tests/ts/dmesg/input b/tests/ts/dmesg/input
new file mode 100644
index 0000000..98307df
--- /dev/null
+++ b/tests/ts/dmesg/input
@@ -0,0 +1,105 @@
+<0>[ 0.000000] example[0]
+<1>[ 1.000000] example[1]
+<2>[ 8.000000] example[2]
+<3>[ 27.000000] example[3]
+<4>[ 64.000000] example[4]
+<5>[ 125.000000] example[5]
+<6>[ 216.000000] example[6]
+<7>[ 343.000000] example[7]
+<8>[ 512.000000] example[8]
+<9>[ 729.000000] example[9]
+<10>[ 1000.000000] example[10]
+<11>[ 1331.000000] example[11]
+<12>[ 1728.000000] example[12]
+<13>[ 2197.000000] example[13]
+<14>[ 2744.000000] example[14]
+<15>[ 3375.000000] example[15]
+<16>[ 4096.000000] example[16]
+<17>[ 4913.000000] example[17]
+<18>[ 5832.000000] example[18]
+<19>[ 6859.000000] example[19]
+<20>[ 8000.000000] example[20]
+<21>[ 9261.000000] example[21]
+<22>[10648.000000] example[22]
+<23>[12167.000000] example[23]
+<24>[13824.000000] example[24]
+<25>[15625.000000] example[25]
+<26>[17576.000000] example[26]
+<27>[19683.000000] example[27]
+<28>[21952.000000] example[28]
+<29>[24389.000000] example[29]
+<30>[27000.000000] example[30]
+<31>[29791.000000] example[31]
+<32>[32768.000000] example[32]
+<33>[35937.000000] example[33]
+<34>[39304.000000] example[34]
+<35>[42875.000000] example[35]
+<36>[46656.000000] example[36]
+<37>[50653.000000] example[37]
+<38>[54872.000000] example[38]
+<39>[59319.000000] example[39]
+<40>[64000.000000] example[40]
+<41>[68921.000000] example[41]
+<42>[74088.000000] example[42]
+<43>[79507.000000] example[43]
+<44>[85184.000000] example[44]
+<45>[91125.000000] example[45]
+<46>[97336.000000] example[46]
+<47>[103823.000000] example[47]
+<48>[110592.000000] example[48]
+<49>[117649.000000] example[49]
+<50>[125000.000000] example[50]
+<51>[132651.000000] example[51]
+<52>[140608.000000] example[52]
+<53>[148877.000000] example[53]
+<54>[157464.000000] example[54]
+<55>[166375.000000] example[55]
+<56>[175616.000000] example[56]
+<57>[185193.000000] example[57]
+<58>[195112.000000] example[58]
+<59>[205379.000000] example[59]
+<60>[216000.000000] example[60]
+<61>[226981.000000] example[61]
+<62>[238328.000000] example[62]
+<63>[250047.000000] example[63]
+<64>[262144.000000] example[64]
+<65>[274625.000000] example[65]
+<66>[287496.000000] example[66]
+<67>[300763.000000] example[67]
+<68>[314432.000000] example[68]
+<69>[328509.000000] example[69]
+<70>[343000.000000] example[70]
+<71>[357911.000000] example[71]
+<72>[373248.000000] example[72]
+<73>[389017.000000] example[73]
+<74>[405224.000000] example[74]
+<75>[421875.000000] example[75]
+<76>[438976.000000] example[76]
+<77>[456533.000000] example[77]
+<78>[474552.000000] example[78]
+<79>[493039.000000] example[79]
+<80>[512000.000000] example[80]
+<81>[531441.000000] example[81]
+<82>[551368.000000] example[82]
+<83>[571787.000000] example[83]
+<84>[592704.000000] example[84]
+<85>[614125.000000] example[85]
+<86>[636056.000000] example[86]
+<87>[658503.000000] example[87]
+<88>[681472.000000] example[88]
+<89>[704969.000000] example[89]
+<90>[729000.000000] example[90]
+<91>[753571.000000] example[91]
+<92>[778688.000000] example[92]
+<93>[804357.000000] example[93]
+<94>[830584.000000] example[94]
+<95>[857375.000000] example[95]
+<96>[884736.000000] example[96]
+<97>[912673.000000] example[97]
+<98>[941192.000000] example[98]
+<99>[970299.000000] example[99]
+<100>[1000000.000000] example[100]
+<101>[1030301.000000] example[101]
+<102>[1061208.000000] example[102]
+<103>[1092727.000000] example[103]
+<104>[1124864.000000] example[104]
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 13/22] dmesg: add boundary check to facility & level array usage
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (11 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 12/22] tests: add dmesg(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 14/22] tests: add setsid(1) check Sami Kerola
` (9 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
The dmesg should not crash while --decode'ing message facilities and
levels to readable string even if the values are out of bounds.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/dmesg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index f95db40..ddab9b4 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -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);
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 14/22] tests: add setsid(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (12 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 13/22] dmesg: add boundary check to facility & level array usage Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 15/22] tests: add setarch(8) check Sami Kerola
` (8 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index d4f30a3..548f95f 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/setsid b/tests/expected/misc/setsid
new file mode 100644
index 0000000..2e9ba47
--- /dev/null
+++ b/tests/expected/misc/setsid
@@ -0,0 +1 @@
+success
diff --git a/tests/ts/misc/setsid b/tests/ts/misc/setsid
new file mode 100755
index 0000000..43a76f9
--- /dev/null
+++ b/tests/ts/misc/setsid
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 15/22] tests: add setarch(8) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (13 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 14/22] tests: add setsid(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 16/22] tests: add fallocate(1) check Sami Kerola
` (7 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 548f95f..401342f 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/setarch b/tests/expected/misc/setarch
new file mode 100644
index 0000000..2e9ba47
--- /dev/null
+++ b/tests/expected/misc/setarch
@@ -0,0 +1 @@
+success
diff --git a/tests/ts/misc/setarch b/tests/ts/misc/setarch
new file mode 100755
index 0000000..8050556
--- /dev/null
+++ b/tests/ts/misc/setarch
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 16/22] tests: add fallocate(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (14 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 15/22] tests: add setarch(8) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 17/22] docs: mkswap.8: recommend fallocate(1) Sami Kerola
` (6 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 401342f..e502aeb 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/fallocate b/tests/expected/misc/fallocate
new file mode 100644
index 0000000..e45b99e
--- /dev/null
+++ b/tests/expected/misc/fallocate
@@ -0,0 +1 @@
+384
diff --git a/tests/ts/misc/fallocate b/tests/ts/misc/fallocate
new file mode 100755
index 0000000..4b9db70
--- /dev/null
+++ b/tests/ts/misc/fallocate
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 17/22] docs: mkswap.8: recommend fallocate(1)
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (15 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 16/22] tests: add fallocate(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-25 9:17 ` Karel Zak
2013-01-19 0:09 ` [PATCH 18/22] tests: add isosize(1) check Sami Kerola
` (5 subsequent siblings)
22 siblings, 1 reply; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
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.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
disk-utils/mkswap.8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/mkswap.8 b/disk-utils/mkswap.8
index 219c49f..ab8a44a 100644
--- a/disk-utils/mkswap.8
+++ b/disk-utils/mkswap.8
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 18/22] tests: add isosize(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (16 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 17/22] docs: mkswap.8: recommend fallocate(1) Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-25 9:25 ` Karel Zak
2013-01-19 0:09 ` [PATCH 19/22] tests: add whereis(1) check Sami Kerola
` (4 subsequent siblings)
22 siblings, 1 reply; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index e502aeb..6c172ba 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/isosize/print-size b/tests/expected/isosize/print-size
new file mode 100644
index 0000000..3def437
--- /dev/null
+++ b/tests/expected/isosize/print-size
@@ -0,0 +1 @@
+515899392
diff --git a/tests/ts/isosize/print-size b/tests/ts/isosize/print-size
new file mode 100755
index 0000000..399b5b1
--- /dev/null
+++ b/tests/ts/isosize/print-size
@@ -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
diff --git a/tests/ts/isosize/sample.iso.gz b/tests/ts/isosize/sample.iso.gz
new file mode 100644
index 0000000000000000000000000000000000000000..17937a260e71634b68658f02fe06e5d6b2771dbd
GIT binary patch
literal 632
zcmb2|=HSSe{u#i;T+HzHQmjXCqRjD+&tJ^&)@;4_N{jEV2+QX)+q(ry^ORjrS3Zl<
z56F6V#AWW>+=LwQS>|dg7elwlmMF)v^m<GYI<&nzR)oc=WMhYf9<%P2n#MVccWG?W
zt5V!2f6kKs`S%Zh{@d{TzkKvnUMn_6y3$NB>9zE%w>#5jU$%+be9`<<Qi@ltMpA!E
zp^wM=Jbe?1)_}*~J_fGO^^5#D!{GI_#?tp0OEL^JTe-JLKAvP4H~ZdfvGiGwm$g(H
zMAmNG`QcwlZ?);mz`Ku?%+dsIt=(Ozxm;t<CH*b4{>_{-{q!w|P~V)|P3z4!W#>Nf
zEjcJDtYoUev@jujf%>KNT>dX7?luN!Tqq9Yd-bVx!8-S<!`JTqj9Q&mz3Qoyy^HDQ
zROMAGXWf4Ba*9>=x_#Hew1Y053_rH;$%QMuQ@gfbT$mYr>7T<X$!$9B!q2j0U88P4
zzQTC%%IoX556wKa@btnB`=j4+Z7V%d7t8-Dn)lq@&i9h*vdr(C_7(|!<~~j6_x<JO
zN97APD_FD5%lXy%LVVJV@Vm3_^+j>l@0?X0!ay3>=E=8w(G3;F_XpNly*f8tV_VSC
zZ+Cy{vpz3wJu&zG&iB_QSGJy1N!xt!&BFDU+l}WpADZ*mm^(PlpwoNO!6XZ%BD?j|
z|8F|8@<i`f^*zg<oZ2-_?EA$>N%POApFMJW<yKGIu&>g;cZW{Dy>8c>qPLkpE1Z|*
z?p^-!{hR$8|1DV^QCcYzH~me)ssBsg{0%?l<u&EgrXp9t`z(*r_5SUDBHTY?M;b#5
G0|Nlecr*C`
literal 0
HcmV?d00001
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 19/22] tests: add whereis(1) check
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (17 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 18/22] tests: add isosize(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 20/22] dmesg: parse level when --color is used Sami Kerola
` (3 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 6c172ba..4792ce1 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/misc/whereis b/tests/expected/misc/whereis
new file mode 100644
index 0000000..2e9ba47
--- /dev/null
+++ b/tests/expected/misc/whereis
@@ -0,0 +1 @@
+success
diff --git a/tests/ts/misc/whereis b/tests/ts/misc/whereis
new file mode 100755
index 0000000..853b27a
--- /dev/null
+++ b/tests/ts/misc/whereis
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 20/22] dmesg: parse level when --color is used
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (18 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 19/22] tests: add whereis(1) check Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 21/22] tests: add ipcmk(1) and ipcrm(1) checks Sami Kerola
` (2 subsequent siblings)
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
When user runs with --color it should not need to be combined with
filtering per level or facility, or decoding.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/dmesg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index ddab9b4..080fe7d 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 21/22] tests: add ipcmk(1) and ipcrm(1) checks
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (19 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 20/22] dmesg: parse level when --color is used Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-19 0:09 ` [PATCH 22/22] tests: sort commands strings Sami Kerola
2013-01-25 10:09 ` [PATCH 00/22] tests: lots of tests Karel Zak
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
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
diff --git a/tests/commands.sh b/tests/commands.sh
index 4792ce1..3138fbf 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
diff --git a/tests/expected/ipcs/mk-rm-msg b/tests/expected/ipcs/mk-rm-msg
new file mode 100644
index 0000000..8a82b94
--- /dev/null
+++ b/tests/expected/ipcs/mk-rm-msg
@@ -0,0 +1,2 @@
+Message queue id: <was_number>
+Message queue id: <was_number>
diff --git a/tests/expected/ipcs/mk-rm-sem b/tests/expected/ipcs/mk-rm-sem
new file mode 100644
index 0000000..a9c3f46
--- /dev/null
+++ b/tests/expected/ipcs/mk-rm-sem
@@ -0,0 +1,2 @@
+Semaphore id: <was_number>
+Semaphore id: <was_number>
diff --git a/tests/expected/ipcs/mk-rm-shm b/tests/expected/ipcs/mk-rm-shm
new file mode 100644
index 0000000..49d5867
--- /dev/null
+++ b/tests/expected/ipcs/mk-rm-shm
@@ -0,0 +1,2 @@
+Shared memory id: <was_number>
+Shared memory id: <was_number>
diff --git a/tests/ts/ipcs/functions.sh b/tests/ts/ipcs/functions.sh
index 24ea445..297d34f 100644
--- a/tests/ts/ipcs/functions.sh
+++ b/tests/ts/ipcs/functions.sh
@@ -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
+ }'
+}
diff --git a/tests/ts/ipcs/mk-rm-msg b/tests/ts/ipcs/mk-rm-msg
new file mode 100755
index 0000000..21ecb9c
--- /dev/null
+++ b/tests/ts/ipcs/mk-rm-msg
@@ -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
diff --git a/tests/ts/ipcs/mk-rm-sem b/tests/ts/ipcs/mk-rm-sem
new file mode 100755
index 0000000..754940b
--- /dev/null
+++ b/tests/ts/ipcs/mk-rm-sem
@@ -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
diff --git a/tests/ts/ipcs/mk-rm-shm b/tests/ts/ipcs/mk-rm-shm
new file mode 100755
index 0000000..707d359
--- /dev/null
+++ b/tests/ts/ipcs/mk-rm-shm
@@ -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
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 22/22] tests: sort commands strings
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (20 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 21/22] tests: add ipcmk(1) and ipcrm(1) checks Sami Kerola
@ 2013-01-19 0:09 ` Sami Kerola
2013-01-25 10:09 ` [PATCH 00/22] tests: lots of tests Karel Zak
22 siblings, 0 replies; 27+ messages in thread
From: Sami Kerola @ 2013-01-19 0:09 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
The list is starting to be long enough that making any order to it seems
like right thing to do.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tests/commands.sh | 81 ++++++++++++++++++++++++-------------------------------
1 file changed, 35 insertions(+), 46 deletions(-)
diff --git a/tests/commands.sh b/tests/commands.sh
index 3138fbf..787a4be 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -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"}
--
1.8.1.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 09/22] more: allow non-interactive invocation of the command
2013-01-19 0:08 ` [PATCH 09/22] more: allow non-interactive invocation of the command Sami Kerola
@ 2013-01-24 18:33 ` Karel Zak
0 siblings, 0 replies; 27+ messages in thread
From: Karel Zak @ 2013-01-24 18:33 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sat, Jan 19, 2013 at 12:08:58AM +0000, Sami Kerola wrote:
> - 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
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 17/22] docs: mkswap.8: recommend fallocate(1)
2013-01-19 0:09 ` [PATCH 17/22] docs: mkswap.8: recommend fallocate(1) Sami Kerola
@ 2013-01-25 9:17 ` Karel Zak
0 siblings, 0 replies; 27+ messages in thread
From: Karel Zak @ 2013-01-25 9:17 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sat, Jan 19, 2013 at 12:09:06AM +0000, Sami Kerola wrote:
> +# fallocate -l 8GB swapfile
Applied. It seems more readable to use long option in examples:
fallocate --length 8GiB swapfile
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 18/22] tests: add isosize(1) check
2013-01-19 0:09 ` [PATCH 18/22] tests: add isosize(1) check Sami Kerola
@ 2013-01-25 9:25 ` Karel Zak
0 siblings, 0 replies; 27+ messages in thread
From: Karel Zak @ 2013-01-25 9:25 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sat, Jan 19, 2013 at 12:09:07AM +0000, Sami Kerola wrote:
> +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
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 00/22] tests: lots of tests
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
` (21 preceding siblings ...)
2013-01-19 0:09 ` [PATCH 22/22] tests: sort commands strings Sami Kerola
@ 2013-01-25 10:09 ` Karel Zak
22 siblings, 0 replies; 27+ messages in thread
From: Karel Zak @ 2013-01-25 10:09 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sat, Jan 19, 2013 at 12:08:49AM +0000, Sami Kerola wrote:
> While back I where politely asked to write regression tests...
All applied, THANKS!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2013-01-25 10:09 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-19 0:08 [PATCH 00/22] tests: lots of tests Sami Kerola
2013-01-19 0:08 ` [PATCH 01/22] build-sys: add gcov files to .gitignore Sami Kerola
2013-01-19 0:08 ` [PATCH 02/22] tests: add rev(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 03/22] tests: add utmpdump(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 04/22] tests: add getopt(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 05/22] tests: add mcookie(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 06/22] tests: add tailf(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 07/22] tests: add ul(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 08/22] tests: add ionice(1) check Sami Kerola
2013-01-19 0:08 ` [PATCH 09/22] more: allow non-interactive invocation of the command Sami Kerola
2013-01-24 18:33 ` Karel Zak
2013-01-19 0:08 ` [PATCH 10/22] tests: add more(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 11/22] tests: add line(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 12/22] tests: add dmesg(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 13/22] dmesg: add boundary check to facility & level array usage Sami Kerola
2013-01-19 0:09 ` [PATCH 14/22] tests: add setsid(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 15/22] tests: add setarch(8) check Sami Kerola
2013-01-19 0:09 ` [PATCH 16/22] tests: add fallocate(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 17/22] docs: mkswap.8: recommend fallocate(1) Sami Kerola
2013-01-25 9:17 ` Karel Zak
2013-01-19 0:09 ` [PATCH 18/22] tests: add isosize(1) check Sami Kerola
2013-01-25 9:25 ` Karel Zak
2013-01-19 0:09 ` [PATCH 19/22] tests: add whereis(1) check Sami Kerola
2013-01-19 0:09 ` [PATCH 20/22] dmesg: parse level when --color is used Sami Kerola
2013-01-19 0:09 ` [PATCH 21/22] tests: add ipcmk(1) and ipcrm(1) checks Sami Kerola
2013-01-19 0:09 ` [PATCH 22/22] tests: sort commands strings Sami Kerola
2013-01-25 10:09 ` [PATCH 00/22] tests: lots of tests Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox