# helpers
TS_HELPER_SYSINFO="$TS_TOPDIR/helpers/mnt_test_sysinfo"
+TS_HELPER_LIBPRELOAD_TIME="$TS_TOPDIR/helpers/.libs/libpreload-time.so"
# external commands
TS_ECMD_BLKID="@BLKID@"
TS_CMD_NAMEI=${TS_CMD_NAMEI-"$TOPDIR/misc-utils/namei"}
TS_CMD_LOOK=${TS_CMD_LOOK-"$TOPDIR/misc-utils/look"}
+TS_CMD_CAL=${TS_CMD_CAL-"$TOPDIR/misc-utils/cal"}
TS_CMD_CHECKTTY=${TS_CMD_CHECKTTY-"$TOPDIR/login-utils/checktty_test"}
TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$TOPDIR/hwclock/hwclock"}
+
+
[ "$TS_VERBOSE" == "yes" ] && echo "$1"
}
+function ts_has_option {
+ NAME="$1"
+ ALL="$2"
+ echo -n $ALL | sed 's/ //g' | gawk 'BEGIN { FS="="; RS="--" } /('$NAME'$|'$NAME'=)/ { print "yes" }'
+}
+
function ts_init {
export LANG="en_US.UTF-8":
TS_NAME=$(basename $0)
if [ ! -d $TS_DIFFDIR ]; then
mkdir -p $TS_DIFFDIR
fi
- [ "$1" == "--verbose" ] && TS_VERBOSE="yes"
+
+ TS_VERBOSE=$( ts_has_option "verbose" "$*")
TS_OUTPUT="$TS_OUTDIR/$TS_NAME"
TS_DIFF="$TS_DIFFDIR/$TS_NAME"
TS_EXPECTED="$TS_EXPECTEDDIR/$TS_NAME"
TS_COMPONENT="col"
TS_DESC="multibyte"
-ts_init "$1"
+ts_init "$*"
cat $TS_INPUT | $TS_CMD_COL > /dev/null 2> $TS_OUTPUT
TS_COMPONENT="mkfs.cramfs"
TS_DESC="mkfs"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="fstab"
TS_DESC="devname"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
LABEL="testMountD2L"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
TS_COMPONENT="fstab"
TS_DESC="devname2uuid"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
LABEL="testFstabLabel"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
DEVICE=$(ts_device_init)
[ "$?" == 0 ] || ts_die "Cannot init device"
-mkfs.ext3 -L $LABEL $DEVICE &> /dev/null
+mkfs.ext3 -L $LABEL $DEVICE &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
ts_device_has "LABEL" $LABEL $DEVICE
LABEL="testMountL2D"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
LABEL="testMountL2U"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="fstab"
TS_DESC="uuid"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
DEVICE=$(ts_device_init)
[ "$?" == 0 ] || ts_die "Cannot init device"
-mkfs.ext3 $DEVICE &> /dev/null
+mkfs.ext3 $DEVICE &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
ts_device_has_uuid $DEVICE
TS_COMPONENT="fstab"
TS_DESC="uuid2devname"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
LABEL="testMountU2L"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
NTP_SERVER="0.fedora.pool.ntp.org"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
[ -x "/usr/sbin/ntpdate" ] || ts_skip "cannot found ntpdate command"
TS_COMPONENT="ipcs"
TS_DESC="headers"
-ts_init "$1"
+ts_init "$*"
ts_log "test: shm headers"
$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT
TS_DESC="limits overflow"
if [ $UID != 0 ]; then
- ts_init "$1"
+ ts_init "$*"
ts_skip_nonroot
fi
. ts-ipcs.sh
-ts_init "$1"
+ts_init "$*"
ts_log "load original values"
for i in $IPCS_IDX; do
SHM_ORG[$i]=$(cat ${IPCS_PROCFILES[$i]})
done >> $TS_OUTPUT
-
+
ts_log "check for difference between kernel and IPC"
ipcs_limits_check >> $TS_OUTPUT
. ts-ipcs.sh
-ts_init "$1"
+ts_init "$*"
ts_log "check for difference between kernel and IPC"
ipcs_limits_check >> $TS_OUTPUT
TS_COMPONENT="login"
TS_DESC="checktty"
-ts_init "$1"
+ts_init "$*"
$TS_CMD_CHECKTTY >> $TS_OUTPUT
ts_finalize
TS_COMPONENT="look"
TS_DESC="separator"
-ts_init "$1"
+ts_init "$*"
[ -f "/usr/share/dict/words" ] || ts_skip "/usr/share/dict/words not such file"
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="mount"
TS_DESC="devname"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
DEVICE=$(ts_device_init)
[ "$?" == 0 ] || ts_die "Cannot init device"
-mkfs.ext3 $DEVICE &> /dev/null
+mkfs.ext3 $DEVICE &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
ts_device_has "TYPE" "ext3" $DEVICE
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
LABEL="testMountLabel"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
DEVICE=$(ts_device_init)
[ "$?" == 0 ] || ts_die "Cannot init device"
-mkfs.ext3 -L $LABEL $DEVICE &> /dev/null
+mkfs.ext3 -L $LABEL $DEVICE &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
ts_device_has "LABEL" $LABEL $DEVICE
TS_COMPONENT="mount"
TS_DESC="move "
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
PWD=$(pwd)
TS_COMPONENT="mount"
TS_DESC="mtablock"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
#
TS_COMPONENT="mount"
TS_DESC="basic paths"
-ts_init "$1"
+ts_init "$*"
$TS_CMD_MOUNT -n -f -v -v -v /dev/dummy /mnt &> $TS_OUTPUT
TS_COMPONENT="mount"
TS_DESC="remount"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
# mountpoint
MOUNTER="/sbin/mount.mytest"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
cat > $MOUNTER << EOF
-#!/bin/bash
+#!/bin/bash
# This util-linux-ng regression test component
# It's safe to remove me...
#
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="mount"
TS_DESC="uuid"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
DEVICE=$(ts_device_init)
[ "$?" == 0 ] || ts_die "Cannot init device"
-mkfs.ext3 $DEVICE &> /dev/null
+mkfs.ext3 $DEVICE &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
ts_device_has_uuid $DEVICE
TS_COMPONENT="namei"
TS_DESC="logic"
-ts_init "$1"
+ts_init "$*"
SANDBOX="$TS_OUTDIR/namei"
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="swapon"
TS_DESC="devname"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
LABEL="testSwapLabel"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail
#!/bin/bash
-#
+#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
+#
# This file is part of util-linux-ng.
-#
+#
# 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.
-#
+#
# 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
TS_COMPONENT="swapon"
TS_DESC="uuid"
-ts_init "$1"
+ts_init "$*"
ts_skip_nonroot
set -o pipefail