summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2012-06-01 15:30:56 +0200
committerKarel Zak2012-06-26 20:50:53 +0200
commitac73480a348b659e011054248de00a637dad3421 (patch)
tree12ac2dc8552238b24e12e476e93564c87d83bef4
parentbuild-sys: move partx to disk-utils/ (diff)
downloadkernel-qcow2-util-linux-ac73480a348b659e011054248de00a637dad3421.tar.gz
kernel-qcow2-util-linux-ac73480a348b659e011054248de00a637dad3421.tar.xz
kernel-qcow2-util-linux-ac73480a348b659e011054248de00a637dad3421.zip
build-sys: convert tests/ to module
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac2
-rw-r--r--tests/Makefile.am12
-rw-r--r--tests/Makemodule.am13
-rw-r--r--tests/commands.sh.in108
-rw-r--r--tests/expected/mount/mtablock1
-rw-r--r--tests/helpers/Makefile.am9
-rw-r--r--tests/helpers/Makemodule.am12
-rwxr-xr-xtests/ts/mount/mtablock54
9 files changed, 82 insertions, 137 deletions
diff --git a/Makefile.am b/Makefile.am
index 98f7a3866..56a7a6506 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,7 @@ systemdsystemunit_DATA =
INSTALL_EXEC_HOOKS =
UNINSTALL_HOOKS =
INSTALL_DATA_HOOKS =
+CLEAN_LOCALS =
EXTRA_DIST =
CLEANFILES =
@@ -28,8 +29,7 @@ MAN_DIRS = man/ru
SUBDIRS = \
$(MAN_DIRS) \
fdisk \
- po \
- tests
+ po
RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
@@ -59,6 +59,9 @@ include sys-utils/Makemodule.am
include misc-utils/Makemodule.am
include disk-utils/Makemodule.am
+include tests/Makemodule.am
+
+
# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
dist-hook:
@@ -120,3 +123,4 @@ uninstall-hook: $(UNINSTALL_HOOKS)
install-data-hook: $(INSTALL_DATA_HOOKS)
+clean-local: $(CLEAN_LOCALS)
diff --git a/configure.ac b/configure.ac
index 2f3e196b5..6e6399f36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1303,9 +1303,7 @@ libuuid/uuid.pc
man/ru/Makefile
misc-utils/uuidd.service
po/Makefile.in
-tests/Makefile
tests/commands.sh
-tests/helpers/Makefile
])
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index c22f30e58..000000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-include $(top_srcdir)/config/include-Makefile.am
-
-SUBDIRS = helpers
-
-EXTRA_DIST = \
- expected \
- functions.sh \
- run.sh \
- ts
-
-clean-local:
- rm -rf output diff
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
new file mode 100644
index 000000000..e25f71391
--- /dev/null
+++ b/tests/Makemodule.am
@@ -0,0 +1,13 @@
+
+include tests/helpers/Makemodule.am
+
+EXTRA_DIST += \
+ tests/expected \
+ tests/functions.sh \
+ tests/run.sh \
+ tests/ts
+
+clean-local-tests:
+ rm -rf output diff
+
+CLEAN_LOCALS += clean-local-tests
diff --git a/tests/commands.sh.in b/tests/commands.sh.in
index 2b2a5771e..002c2c01e 100644
--- a/tests/commands.sh.in
+++ b/tests/commands.sh.in
@@ -6,69 +6,63 @@ top_srcdir=@abs_top_srcdir@
TS_TESTUSER=${TS_TESTUSER:-"test"}
# helpers
-TS_HELPER_SYSINFO="$top_builddir/tests/helpers/test_sysinfo"
-TS_HELPER_PATHS="$top_builddir/tests/helpers/test_pathnames"
-TS_HELPER_BYTESWAP="$top_builddir/tests/helpers/test_byteswap"
-TS_HELPER_MD5="$top_builddir/tests/helpers/test_md5"
+TS_HELPER_SYSINFO="$top_builddir/test_sysinfo"
+TS_HELPER_PATHS="$top_builddir/test_pathnames"
+TS_HELPER_BYTESWAP="$top_builddir/test_byteswap"
+TS_HELPER_MD5="$top_builddir/test_md5"
-TS_HELPER_ISMOUNTED="$top_builddir/lib/test_ismounted"
-TS_HELPER_STRUTILS="$top_builddir/lib/test_strutils"
-TS_HELPER_CPUSET="$top_builddir/lib/test_cpuset"
+TS_HELPER_ISMOUNTED="$top_builddir/test_ismounted"
+TS_HELPER_STRUTILS="$top_builddir/test_strutils"
+TS_HELPER_CPUSET="$top_builddir/test_cpuset"
# libmount
-TS_HELPER_LIBMOUNT_OPTSTR="$top_builddir/libmount/src/test_optstr"
-TS_HELPER_LIBMOUNT_TAB="$top_builddir/libmount/src/test_tab"
-TS_HELPER_LIBMOUNT_UTILS="$top_builddir/libmount/src/test_utils"
-TS_HELPER_LIBMOUNT_LOCK="$top_builddir/libmount/src/test_lock"
-TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/libmount/src/test_tab_update"
-TS_HELPER_LIBMOUNT_CONTEXT="$top_builddir/libmount/src/test_context"
-TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/libmount/src/test_tab_diff"
+TS_HELPER_LIBMOUNT_OPTSTR="$top_builddir/test_optstr"
+TS_HELPER_LIBMOUNT_TAB="$top_builddir/test_tab"
+TS_HELPER_LIBMOUNT_UTILS="$top_builddir/test_utils"
+TS_HELPER_LIBMOUNT_LOCK="$top_builddir/test_lock"
+TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/test_tab_update"
+TS_HELPER_LIBMOUNT_CONTEXT="$top_builddir/test_context"
+TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_tab_diff"
-TS_HELPER_ISLOCAL="$top_builddir/login-utils/test_islocal"
-TS_HELPER_LOGINDEFS="$top_builddir/login-utils/test_logindefs"
+TS_HELPER_ISLOCAL="$top_builddir/test_islocal"
+TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
# TODO: use partx
-TS_HELPER_PARTITIONS="$top_builddir/libblkid/samples/partitions"
+TS_HELPER_PARTITIONS="$top_builddir/samples-partitions"
# paths to commands
-if [ -x "$top_builddir/sys-utils/mount" ]; then
- TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/sys-utils/mount"}
- TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/sys-utils/umount"}
-else
- TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount/mount"}
- TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/mount/umount"}
- TS_CMD_MTABLOCK=${TS_CMD_MTABLOCK:-"$top_builddir/mount/mtab_lock_test"}
-fi
-
-TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$top_builddir/sys-utils/swapon"}
-TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$top_builddir/sys-utils/swapoff"}
-TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$top_builddir/sys-utils/losetup"}
-
-TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/disk-utils/mkswap"}
-TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/disk-utils/mkfs.cramfs"}
-TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/disk-utils/mkfs.minix"}
-TS_CMD_FSCKCRAMFS=${TS_CMD_FSCKCRAMFS:-"$top_builddir/disk-utils/fsck.cramfs"}
-TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/disk-utils/fsck.minix"}
-
-TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/sys-utils/ipcs"}
-
-TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/text-utils/col"}
-TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/text-utils/column"}
-TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/text-utils/colrm"}
-
-TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/misc-utils/namei"}
-TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/misc-utils/look"}
-TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/misc-utils/cal"}
-TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/term-utils/script"}
-TS_CMD_EJECT=${TS_CMD_EJECT-"$top_builddir/sys-utils/eject"}
-
-
-TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock/hwclock"}
-TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/sys-utils/lscpu"}
-
-TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/misc-utils/blkid"}
-TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx/partx"}
-TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/misc-utils/findmnt"}
-
-TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk/fdisk"}
+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/fsck.cramfs"}
+TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/fsck.minix"}
+
+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_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_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_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
diff --git a/tests/expected/mount/mtablock b/tests/expected/mount/mtablock
deleted file mode 100644
index d7e318d98..000000000
--- a/tests/expected/mount/mtablock
+++ /dev/null
@@ -1 +0,0 @@
-50000 \ No newline at end of file
diff --git a/tests/helpers/Makefile.am b/tests/helpers/Makefile.am
deleted file mode 100644
index fa95b9efa..000000000
--- a/tests/helpers/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(top_srcdir)/config/include-Makefile.am
-
-noinst_PROGRAMS = \
- test_byteswap \
- test_md5 \
- test_pathnames \
- test_sysinfo
-
-test_md5_SOURCES = test_md5.c $(top_srcdir)/lib/md5.c
diff --git a/tests/helpers/Makemodule.am b/tests/helpers/Makemodule.am
new file mode 100644
index 000000000..0228cb327
--- /dev/null
+++ b/tests/helpers/Makemodule.am
@@ -0,0 +1,12 @@
+
+noinst_PROGRAMS += test_byteswap
+test_byteswap_SOURCES = tests/helpers/test_byteswap.c
+
+noinst_PROGRAMS += test_md5
+test_md5_SOURCES = tests/helpers/test_md5.c lib/md5.c
+
+noinst_PROGRAMS += test_pathnames
+test_pathnames_SOURCES = tests/helpers/test_pathnames.c
+
+noinst_PROGRAMS += test_sysinfo
+test_sysinfo_SOURCES = tests/helpers/test_sysinfo.c
diff --git a/tests/ts/mount/mtablock b/tests/ts/mount/mtablock
deleted file mode 100755
index 445e893e3..000000000
--- a/tests/ts/mount/mtablock
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# 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="mtab lock"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-ts_skip_nonroot
-
-if [ ! -x "$TS_CMD_MTABLOCK" ]; then
- ts_skip "not compiled"
-fi
-
-#
-# Be careful with number of processes. Don't forget that there is time limit
-# when the mount waits on the mtab lock. If you define too much processes some
-# of them will fail with timeout.
-#
-# Note: the original version (< 2.13) of util-linux is completely useless for
-# this test (maximum for this old version is NLOOPS=10 and NPROCESSES=5 (2-way
-# 2GHz machine)). It has terrible performance due a bad timeouts implemntation
-# in lock_mtab().
-#
-NLOOPS=1000
-NPROCESSES=50
-
-
-> $TS_OUTPUT.debug
-echo 0 > $TS_OUTPUT
-SYNCTIME=$(( $(date +%s) + 10 ))
-
-for id in $(seq 0 $(( $NPROCESSES - 1 ))); do
- $TS_CMD_MTABLOCK $id $SYNCTIME $TS_OUTPUT $NLOOPS >> $TS_OUTPUT.debug 2>&1 &
-done
-
-wait
-
-ts_finalize
-