diff options
author | Karel Zak | 2014-03-28 11:10:09 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-28 11:10:09 +0100 |
commit | b430d630d3653c4b116d912ecfbfeac449a13d85 (patch) | |
tree | d2be1d016b4b714158937a86089e4ffc5893ae28 /tests/ts | |
parent | Merge branch 'fix-ipcs-q-fallback' of https://github.com/rudimeier/util-linux (diff) | |
parent | tests: fix last for bigendian (diff) | |
download | kernel-qcow2-util-linux-b430d630d3653c4b116d912ecfbfeac449a13d85.tar.gz kernel-qcow2-util-linux-b430d630d3653c4b116d912ecfbfeac449a13d85.tar.xz kernel-qcow2-util-linux-b430d630d3653c4b116d912ecfbfeac449a13d85.zip |
Merge branch 'fix-ppc-tests' of https://github.com/rudimeier/util-linux
* 'fix-ppc-tests' of https://github.com/rudimeier/util-linux:
tests: fix last for bigendian
tests: fix utmpdump/ipv6tobin for bigendian
tests: fix utmpdump/to-binary for bigendian
tests: fix utmpdump/ipv6totxt for bigendian
tests: fix utmpdump/to-text for bigendian
tests: swaplabel needs to respect pagesize
Diffstat (limited to 'tests/ts')
-rwxr-xr-x | tests/ts/last/ipv6 | 17 | ||||
-rw-r--r-- | tests/ts/last/ipv6-input.BE | bin | 0 -> 768 bytes | |||
-rw-r--r-- | tests/ts/last/ipv6-input.LE (renamed from tests/ts/last/ipv6-input) | bin | 768 -> 768 bytes | |||
-rwxr-xr-x | tests/ts/last/last | 31 | ||||
-rw-r--r-- | tests/ts/last/wtmp.BE | bin | 0 -> 7296 bytes | |||
-rw-r--r-- | tests/ts/last/wtmp.LE (renamed from tests/ts/last/wtmp) | bin | 7296 -> 7296 bytes | |||
-rwxr-xr-x | tests/ts/misc/swaplabel | 18 | ||||
-rw-r--r-- | tests/ts/utmpdump/binary.BE | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | tests/ts/utmpdump/binary.LE (renamed from tests/ts/utmpdump/binary) | bin | 3840 -> 3840 bytes | |||
-rw-r--r-- | tests/ts/utmpdump/ipv6bin.BE | bin | 0 -> 768 bytes | |||
-rw-r--r-- | tests/ts/utmpdump/ipv6bin.LE (renamed from tests/ts/utmpdump/ipv6bin) | bin | 768 -> 768 bytes | |||
-rwxr-xr-x | tests/ts/utmpdump/ipv6tobin | 8 | ||||
-rwxr-xr-x | tests/ts/utmpdump/ipv6totxt | 4 | ||||
-rwxr-xr-x | tests/ts/utmpdump/to-binary | 8 | ||||
-rwxr-xr-x | tests/ts/utmpdump/to-text | 4 |
15 files changed, 64 insertions, 26 deletions
diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6 index b9b4de4dd..63a786753 100755 --- a/tests/ts/last/ipv6 +++ b/tests/ts/last/ipv6 @@ -20,24 +20,31 @@ ts_init "$*" ts_check_test_command "$TS_CMD_LAST" +WTMP_FILE=${TS_OUTDIR}/ipv6-input +rm -f $WTMP_FILE +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) +ln -s ${TS_SELF}/ipv6-input.${BYTE_ORDER} $WTMP_FILE + export LANG=C export TZ=GMT >| $TS_OUTPUT ts_log "~~~ dns short ~~~" -$TS_CMD_LAST -f $TS_SELF/ipv6-input -d >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -d >> $TS_OUTPUT 2>/dev/null ts_log "~~~ dns long ~~~" -$TS_CMD_LAST -f $TS_SELF/ipv6-input -d -w >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -d -w >> $TS_OUTPUT 2>/dev/null ts_log "~~~ dns host last ~~~" -$TS_CMD_LAST -f $TS_SELF/ipv6-input -d -a >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -d -a >> $TS_OUTPUT 2>/dev/null ts_log "~~~ show ip ~~~" -$TS_CMD_LAST -f $TS_SELF/ipv6-input -i >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -i >> $TS_OUTPUT 2>/dev/null ts_log "~~~ show ip last ~~~" -$TS_CMD_LAST -f $TS_SELF/ipv6-input -i -a >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -i -a >> $TS_OUTPUT 2>/dev/null + +rm -f $WTMP_FILE ts_finalize diff --git a/tests/ts/last/ipv6-input.BE b/tests/ts/last/ipv6-input.BE Binary files differnew file mode 100644 index 000000000..8cf7d3965 --- /dev/null +++ b/tests/ts/last/ipv6-input.BE diff --git a/tests/ts/last/ipv6-input b/tests/ts/last/ipv6-input.LE Binary files differindex 342553bb9..342553bb9 100644 --- a/tests/ts/last/ipv6-input +++ b/tests/ts/last/ipv6-input.LE diff --git a/tests/ts/last/last b/tests/ts/last/last index b6308fca1..8e4202fe9 100755 --- a/tests/ts/last/last +++ b/tests/ts/last/last @@ -20,45 +20,52 @@ ts_init "$*" ts_check_test_command "$TS_CMD_LAST" +WTMP_FILE=${TS_OUTDIR}/wtmp +rm -f $WTMP_FILE +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) +ln -s ${TS_SELF}/wtmp.${BYTE_ORDER} $WTMP_FILE + export LANG=C export TZ=GMT >| $TS_OUTPUT ts_log "~~~ basic output ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE >> $TS_OUTPUT 2>/dev/null ts_log "~~~ include system ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -x >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -x >> $TS_OUTPUT 2>/dev/null ts_log "~~~ dns short ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -d root >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -d root >> $TS_OUTPUT 2>/dev/null ts_log "~~~ dns long ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -w -d root >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -w -d root >> $TS_OUTPUT 2>/dev/null ts_log "~~~ dns host last ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -a -d root >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -a -d root >> $TS_OUTPUT 2>/dev/null ts_log "~~~ show ip ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -i torvalds >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -i torvalds >> $TS_OUTPUT 2>/dev/null ts_log "~~~ no host ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -R torvalds >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -R torvalds >> $TS_OUTPUT 2>/dev/null ts_log "~~~ full times ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -F >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -F >> $TS_OUTPUT 2>/dev/null ts_log "~~~ no time ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp --time-format=notime >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE --time-format=notime >> $TS_OUTPUT 2>/dev/null ts_log "~~~ iso-8601 time ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp --time-format=iso -w >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE --time-format=iso -w >> $TS_OUTPUT 2>/dev/null ts_log "~~~ since and until ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -s "2013-08-28 02:20" -t "2013-08-28 08:20" >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -s "2013-08-28 02:20" -t "2013-08-28 08:20" >> $TS_OUTPUT 2>/dev/null ts_log "~~~ present ~~~" -$TS_CMD_LAST -f $TS_SELF/wtmp -p "2013-08-28 11:20" >> $TS_OUTPUT 2>/dev/null +$TS_CMD_LAST -f $WTMP_FILE -p "2013-08-28 11:20" >> $TS_OUTPUT 2>/dev/null + +rm -f $WTMP_FILE ts_finalize diff --git a/tests/ts/last/wtmp.BE b/tests/ts/last/wtmp.BE Binary files differnew file mode 100644 index 000000000..5015f8eb1 --- /dev/null +++ b/tests/ts/last/wtmp.BE diff --git a/tests/ts/last/wtmp b/tests/ts/last/wtmp.LE Binary files differindex f66bb20a1..f66bb20a1 100644 --- a/tests/ts/last/wtmp +++ b/tests/ts/last/wtmp.LE diff --git a/tests/ts/misc/swaplabel b/tests/ts/misc/swaplabel index ef0f0ff0b..052ee18fb 100755 --- a/tests/ts/misc/swaplabel +++ b/tests/ts/misc/swaplabel @@ -31,20 +31,28 @@ function fallocate_or_skip() IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file -rm -f $IMAGE +PAGE_SIZE=$($TS_HELPER_SYSINFO pagesize) +PAGE_SIZE_KB=$(( $PAGE_SIZE / 1024 )) +MIN_SWAP_SIZE=$(( 10 * $PAGE_SIZE )) +MIN_SWAP_SIZE_KB=$(( MIN_SWAP_SIZE / 1024 )) -fallocate_or_skip 40959 $IMAGE +rm -f $IMAGE +fallocate_or_skip $(( $MIN_SWAP_SIZE - 1 )) $IMAGE $TS_CMD_MKSWAP \ --label 1234567890abcdef \ --uuid 12345678-abcd-abcd-abcd-1234567890ab \ - $IMAGE >> $TS_OUTPUT 2>&1 + $IMAGE 2>&1 |\ + sed "s/ $MIN_SWAP_SIZE_KB KiB/ 10 pages/" \ + >> $TS_OUTPUT 2>&1 rm -f $IMAGE -fallocate_or_skip 40960 $IMAGE +fallocate_or_skip $MIN_SWAP_SIZE $IMAGE $TS_CMD_MKSWAP \ --label 1234567890abcdef \ --uuid 12345678-abcd-abcd-abcd-1234567890ab \ - $IMAGE >> $TS_OUTPUT 2>&1 + $IMAGE 2>&1 |\ + sed "s/ $(( $MIN_SWAP_SIZE_KB - $PAGE_SIZE_KB )) KiB/ 9 pages/" \ + >> $TS_OUTPUT 2>&1 $TS_CMD_SWAPLABEL $IMAGE >> $TS_OUTPUT 2>&1 #rm -f $IMAGE diff --git a/tests/ts/utmpdump/binary.BE b/tests/ts/utmpdump/binary.BE Binary files differnew file mode 100644 index 000000000..fb09a0c71 --- /dev/null +++ b/tests/ts/utmpdump/binary.BE diff --git a/tests/ts/utmpdump/binary b/tests/ts/utmpdump/binary.LE Binary files differindex 45d35bbb0..45d35bbb0 100644 --- a/tests/ts/utmpdump/binary +++ b/tests/ts/utmpdump/binary.LE diff --git a/tests/ts/utmpdump/ipv6bin.BE b/tests/ts/utmpdump/ipv6bin.BE Binary files differnew file mode 100644 index 000000000..8cf7d3965 --- /dev/null +++ b/tests/ts/utmpdump/ipv6bin.BE diff --git a/tests/ts/utmpdump/ipv6bin b/tests/ts/utmpdump/ipv6bin.LE Binary files differindex 342553bb9..342553bb9 100644 --- a/tests/ts/utmpdump/ipv6bin +++ b/tests/ts/utmpdump/ipv6bin.LE diff --git a/tests/ts/utmpdump/ipv6tobin b/tests/ts/utmpdump/ipv6tobin index fac6fb9a4..c7b354a0c 100755 --- a/tests/ts/utmpdump/ipv6tobin +++ b/tests/ts/utmpdump/ipv6tobin @@ -20,8 +20,14 @@ ts_init "$*" ts_check_test_command "$TS_CMD_UTMPDUMP" +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) + export LANG=C export TZ=GMT -$TS_CMD_UTMPDUMP -r $TS_SELF/ipv6txt >| $TS_OUTPUT 2>/dev/null +OUTFILE=${TS_OUTDIR}/${TS_TESTNAME}.file +$TS_CMD_UTMPDUMP -r $TS_SELF/ipv6txt >| $OUTFILE 2>/dev/null +if diff -q $TS_SELF/ipv6bin.$BYTE_ORDER $OUTFILE; then + echo "no diff" +fi > $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/utmpdump/ipv6totxt b/tests/ts/utmpdump/ipv6totxt index b9da8abd7..e329b1318 100755 --- a/tests/ts/utmpdump/ipv6totxt +++ b/tests/ts/utmpdump/ipv6totxt @@ -20,8 +20,10 @@ ts_init "$*" ts_check_test_command "$TS_CMD_UTMPDUMP" +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) + export LANG=C export TZ=GMT -$TS_CMD_UTMPDUMP $TS_SELF/ipv6bin >| $TS_OUTPUT 2>/dev/null +$TS_CMD_UTMPDUMP $TS_SELF/ipv6bin.$BYTE_ORDER >| $TS_OUTPUT 2>/dev/null ts_finalize diff --git a/tests/ts/utmpdump/to-binary b/tests/ts/utmpdump/to-binary index e774915e7..ecda0cca0 100755 --- a/tests/ts/utmpdump/to-binary +++ b/tests/ts/utmpdump/to-binary @@ -20,8 +20,14 @@ ts_init "$*" ts_check_test_command "$TS_CMD_UTMPDUMP" +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) + export LANG=C export TZ=GMT -$TS_CMD_UTMPDUMP -r $TS_SELF/text >| $TS_OUTPUT 2>/dev/null +OUTFILE=${TS_OUTDIR}/${TS_TESTNAME}.file +$TS_CMD_UTMPDUMP -r $TS_SELF/text >| $OUTFILE 2>/dev/null +if diff -q $TS_SELF/binary.$BYTE_ORDER $OUTFILE; then + echo "no diff" +fi > $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/utmpdump/to-text b/tests/ts/utmpdump/to-text index e98215067..e36d325fb 100755 --- a/tests/ts/utmpdump/to-text +++ b/tests/ts/utmpdump/to-text @@ -20,8 +20,10 @@ ts_init "$*" ts_check_test_command "$TS_CMD_UTMPDUMP" +BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order) + export LANG=C export TZ=GMT -$TS_CMD_UTMPDUMP $TS_SELF/binary >| $TS_OUTPUT 2>/dev/null +$TS_CMD_UTMPDUMP $TS_SELF/binary.$BYTE_ORDER >| $TS_OUTPUT 2>/dev/null ts_finalize |