summaryrefslogtreecommitdiffstats
path: root/tests/ts
diff options
context:
space:
mode:
authorKarel Zak2014-03-28 11:10:09 +0100
committerKarel Zak2014-03-28 11:10:09 +0100
commitb430d630d3653c4b116d912ecfbfeac449a13d85 (patch)
treed2be1d016b4b714158937a86089e4ffc5893ae28 /tests/ts
parentMerge branch 'fix-ipcs-q-fallback' of https://github.com/rudimeier/util-linux (diff)
parenttests: fix last for bigendian (diff)
downloadkernel-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-xtests/ts/last/ipv617
-rw-r--r--tests/ts/last/ipv6-input.BEbin0 -> 768 bytes
-rw-r--r--tests/ts/last/ipv6-input.LE (renamed from tests/ts/last/ipv6-input)bin768 -> 768 bytes
-rwxr-xr-xtests/ts/last/last31
-rw-r--r--tests/ts/last/wtmp.BEbin0 -> 7296 bytes
-rw-r--r--tests/ts/last/wtmp.LE (renamed from tests/ts/last/wtmp)bin7296 -> 7296 bytes
-rwxr-xr-xtests/ts/misc/swaplabel18
-rw-r--r--tests/ts/utmpdump/binary.BEbin0 -> 3840 bytes
-rw-r--r--tests/ts/utmpdump/binary.LE (renamed from tests/ts/utmpdump/binary)bin3840 -> 3840 bytes
-rw-r--r--tests/ts/utmpdump/ipv6bin.BEbin0 -> 768 bytes
-rw-r--r--tests/ts/utmpdump/ipv6bin.LE (renamed from tests/ts/utmpdump/ipv6bin)bin768 -> 768 bytes
-rwxr-xr-xtests/ts/utmpdump/ipv6tobin8
-rwxr-xr-xtests/ts/utmpdump/ipv6totxt4
-rwxr-xr-xtests/ts/utmpdump/to-binary8
-rwxr-xr-xtests/ts/utmpdump/to-text4
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
new file mode 100644
index 000000000..8cf7d3965
--- /dev/null
+++ b/tests/ts/last/ipv6-input.BE
Binary files differ
diff --git a/tests/ts/last/ipv6-input b/tests/ts/last/ipv6-input.LE
index 342553bb9..342553bb9 100644
--- a/tests/ts/last/ipv6-input
+++ b/tests/ts/last/ipv6-input.LE
Binary files differ
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
new file mode 100644
index 000000000..5015f8eb1
--- /dev/null
+++ b/tests/ts/last/wtmp.BE
Binary files differ
diff --git a/tests/ts/last/wtmp b/tests/ts/last/wtmp.LE
index f66bb20a1..f66bb20a1 100644
--- a/tests/ts/last/wtmp
+++ b/tests/ts/last/wtmp.LE
Binary files differ
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
new file mode 100644
index 000000000..fb09a0c71
--- /dev/null
+++ b/tests/ts/utmpdump/binary.BE
Binary files differ
diff --git a/tests/ts/utmpdump/binary b/tests/ts/utmpdump/binary.LE
index 45d35bbb0..45d35bbb0 100644
--- a/tests/ts/utmpdump/binary
+++ b/tests/ts/utmpdump/binary.LE
Binary files differ
diff --git a/tests/ts/utmpdump/ipv6bin.BE b/tests/ts/utmpdump/ipv6bin.BE
new file mode 100644
index 000000000..8cf7d3965
--- /dev/null
+++ b/tests/ts/utmpdump/ipv6bin.BE
Binary files differ
diff --git a/tests/ts/utmpdump/ipv6bin b/tests/ts/utmpdump/ipv6bin.LE
index 342553bb9..342553bb9 100644
--- a/tests/ts/utmpdump/ipv6bin
+++ b/tests/ts/utmpdump/ipv6bin.LE
Binary files differ
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