cat $TS_INPUT | $TS_CMD_COL > /dev/null 2> $TS_OUTPUT
-
-
-
ts_finalize
set -o pipefail
-touch $TS_OUTPUT
-
IMAGE="$TS_OUTDIR/cramfs-loop.img"
IMAGE_DATA="$TS_OUTDIR/cramfs-data"
IMAGE_RE=$( echo $IMAGE | sed 's:/:\\/:g' )
MOUNTPOINT="$TS_OUTDIR/cramfs-mnt"
echo "create mountpoint dir" >> $TS_OUTPUT
-if [ ! -d "$MOUNTPOINT" ]; then
- mkdir -p $MOUNTPOINT
-fi
+[ -d "$MOUNTPOINT" ] || mkdir -p $MOUNTPOINT
echo "generate data" >> $TS_OUTPUT
if [ ! -d "$IMAGE_DATA" ]; then
ts_init
ts_skip_nonroot
-if [ -x "ntpdate" ]; then
- ts_skip "cannot found ntpdate command"
-fi
+[ -x "/usr/sbin/ntpdate" ] || ts_skip "cannot found ntpdate command"
set -o pipefail
# sync with server
(ntpdate $NTP_SERVER | sed "s/^.*offset \([0-9.]*\) sec/\1/g") &> /dev/null
-
-if [ "$?" == "1" ]; then
- ts_skip "cannot sync with $NTP_SERVER"
-fi
+[ "$?" == "1" ] && ts_skip "cannot sync with $NTP_SERVER"
# sync again and check difference
OFFSET=$( ntpdate $NTP_SERVER 2> /dev/null | sed "s/^.*offset [\-]*\([0-9.]*\) sec/\1/g" )
-if [ "$?" == "1" ]; then
- ts_skip "cannot sync with $NTP_SERVER (2nd attempt)"
-fi
+[ "$?" == "1" ] && ts_skip "cannot sync with $NTP_SERVER (2nd attempt)"
DIFF=$( echo "$OFFSET > 1" | bc )
-if [ "$DIFF" == "1" ]; then
- ts_skip "diff between systime and NTP is greated than 1 second"
-fi
+[ "$DIFF" == "1" ] && ts_skip "diff between systime and NTP is greated than 1 second"
# call hwclock
for i in `seq 0 10`; do
# sync with NTP and check new difference
OFFSET=$( ntpdate $NTP_SERVER 2> /dev/null | sed "s/^.*offset [\-]*\([0-9.]*\) sec/\1/g" )
-if [ "$?" == "1" ]; then
- ts_skip "cannot sync with $NTP_SERVER (3rd attempt)"
-fi
+[ "$?" == "1" ] && ts_skip "cannot sync with $NTP_SERVER (3rd attempt)"
DIFF=$( echo "$OFFSET > 1" | bc )
-if [ "$DIFF" == "1" ]; then
- ts_failed "offset is $OFFSET"
-fi
+[ "$DIFF" == "1" ] && ts_failed "offset is $OFFSET"
ts_ok "offset is $OFFSET"
ts_init
-touch $TS_OUTPUT
-
echo "test: shm headers" >> $TS_OUTPUT
$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT
$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT
TS_DESC="checktty"
ts_init
-
-touch $TS_OUTPUT
-
$TS_CMD_CHECKTTY >> $TS_OUTPUT
-
ts_finalize
ts_init
-if [ ! -f "/usr/share/dict/words" ]; then
- ts_skip "/usr/share/dict/words not such file"
-fi
-
-touch $TS_OUTPUT
+[ -f "/usr/share/dict/words" ] || ts_skip "/usr/share/dict/words not such file"
$TS_CMD_LOOK apple-pie >> $TS_OUTPUT
-
ts_finalize
ts_init
ts_skip_nonroot
-touch $TS_OUTPUT
-
PWD=$(pwd)
DIR_SRC="$PWD/$TS_OUTDIR/mnt-move-src"
DIR_A="$PWD/$TS_OUTDIR/mnt-move-A"
DIR_B="$PWD/$TS_OUTDIR/mnt-move-B"
-mkdir $DIR_SRC $DIR_A $DIR_B
+[ -d $DIR_SRC ] || mkdir $DIR_SRC
+[ -d $DIR_A ] || mkdir $DIR_A
+[ -d $DIR_B ] || mkdir $DIR_B
# bind
$TS_CMD_MOUNT --bind $DIR_SRC $DIR_A
# check the bind
egrep -q "^$DIR_SRC $DIR_A" /etc/mtab
-
-if [ "$?" != "0" ]; then
- echo "Cannot found binded $DIR_SRC in /etc/mtab" >> $TS_OUTPUT
- rmdir $DIR_SRC $DIR_A $DIR_B
- ts_finalize
-fi
+[ "$?" == "0" ] || ts_die "Cannot found binded $DIR_SRC in /etc/mtab"
# move
$TS_CMD_MOUNT --move $DIR_A $DIR_B
# check the move
egrep -q "^$DIR_SRC $DIR_B" /etc/mtab
-
if [ "$?" != "0" ]; then
- echo "Cannot found moved $DIR_SRC in /etc/mtab" >> $TS_OUTPUT
$TS_CMD_UMOUNT $DIR_SRC
- rmdir $DIR_SRC $DIR_A $DIR_B
- ts_finalize
+ ts_die "Cannot found moved $DIR_SRC in /etc/mtab"
fi
# clean up
rmdir $DIR_SRC $DIR_A $DIR_B
echo "Success" >> $TS_OUTPUT
-
ts_finalize
ts_init
ts_skip_nonroot
-touch $TS_OUTPUT
-
cat > $MOUNTER << EOF
#!/bin/bash
# This util-linux-ng regression test component