* 'misc-build-sys' of https://github.com/rudimeier/util-linux:
  tests: fix python tests for dist and out-of-tree builds
  build-sys: fix update-potfiles script
  build-sys: restore make distcheck's configure flags
  build-sys: use automake's PYTHON primary for __init__.py
  tests: ignore deprecated last
  tests: remove deprecated mount tests

Conflicts:
	Makefile.am
This commit is contained in:
Karel Zak 2014-06-04 14:16:22 +02:00
commit ee7f60034b
17 changed files with 65 additions and 114 deletions

1
.gitignore vendored
View File

@ -33,6 +33,7 @@ config.rpath
config.status
config.sub
config/ltmain.sh
config/py-compile
config/test-driver
configure
cscope.out

View File

@ -46,6 +46,7 @@ dist_usrbin_exec_SCRIPTS =
systemdsystemunit_DATA =
dist_bashcompletion_DATA =
check_PROGRAMS =
dist_check_SCRIPTS =
TESTS =
PATHFILES =
@ -161,12 +162,15 @@ checkxalloc:
checkdecl:
@ $(top_srcdir)/tools/checkdecl.sh
ENABLE_ALL = --enable-static-programs --enable-all-programs
DISTCHECK_CONFIGURE_FLAGS = --disable-use-tty-group \
--disable-silent-rules $(ENABLE_ALL) \
--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
DISTCHECK_CONFIGURE_FLAGS = \
--disable-use-tty-group \
--disable-silent-rules \
--enable-all-programs \
--enable-static-programs \
--enable-gtk-doc \
--with-python \
--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
BUILT_SOURCES = .version
.version:

View File

@ -1,5 +1,3 @@
EXTRA_DIST += libmount/python/__init__.py
if BUILD_PYLIBMOUNT
pylibmountexecdir = $(pyexecdir)/libmount
@ -8,7 +6,7 @@ pylibmountexecdir = $(pyexecdir)/libmount
# directory for binary stuff as well as for the scripts otherwise it's
# not possible to install 32-bit and 64-bit version on the same system.
pylibmountexec_LTLIBRARIES = pylibmount.la
pylibmountexec_SCRIPTS = libmount/python/__init__.py
pylibmountexec_PYTHON = libmount/python/__init__.py
pylibmount_la_SOURCES = \
libmount/python/pylibmount.c \
@ -28,6 +26,10 @@ pylibmount_la_CFLAGS = \
pylibmount_la_LDFLAGS = \
-avoid-version -module -shared -export-dynamic
dist_check_SCRIPTS += libmount/python/test_mount_context.py
dist_check_SCRIPTS += libmount/python/test_mount_tab.py
dist_check_SCRIPTS += libmount/python/test_mount_tab_update.py
CLEANFILES += *.img
endif # BUILD_PYLIBMOUNT

View File

@ -3,16 +3,38 @@
# Copyright (C) 2009 Karel Zak <kzak@redhat.com>
#
# find all *.c files,
# find all git-tracked and existing *.c and *.h files
# exclude some (sub)directories
# sort the list
# exclude /samples/ subdirectories
# exclude ./tests/ from the list
# and remove "./" prefix
[ ! -f "po/Makevars" ] && \
echo "You must run this script in the top-level directory"
if [ ! -f "po/Makevars" ]; then
echo "error: update-potfiles must run in the top-level directory" >&2
exit 1
fi
find -name "*.c" -or -name "*.h" | \
sort | \
sed '/samples/d; /config\.h/d; /util-linux-.*/d; /\.\/tests/d; s/^\.\///' \
> po/POTFILES.in
# find all git-tracked files
source_files=$(git ls-files . 2>/dev/null)
if [ $? -ne 0 ] || [ -z "$source_files" ]; then
echo "$0: warning: update-potfiles requires git" >&2
# we still go through the rest of this script to provide at least an empty
# list or remove non-existing (deleted) files
source_files=$(cat po/POTFILES.in 2>/dev/null)
fi
# apply include/exclude patterns
source_files=$(
echo "$source_files" \
| sed \
-e '/\(\.h\|\.c\)$/!d' \
-e '/^tests\//d' \
-e '/\/samples\//d' \
)
# throw away non-existing files (dirty git repo)
echo "$source_files" \
| xargs -r find 2>/dev/null \
| sort \
> po/POTFILES.in
# if this script is broken then we have probably an empty list
[ -s po/POTFILES.in ] || echo "$0: warning: po/POTFILES.in is empty" >&2

View File

@ -13,9 +13,9 @@ TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_mount_tab_diff"
TS_HELPER_LIBMOUNT_TAB="$top_builddir/test_mount_tab"
TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/test_mount_tab_update"
TS_HELPER_LIBMOUNT_UTILS="$top_builddir/test_mount_utils"
TS_HELPER_PYLIBMOUNT_CONTEXT="$top_builddir/libmount/python/test_mount_context.py"
TS_HELPER_PYLIBMOUNT_TAB="$top_builddir/libmount/python/test_mount_tab.py"
TS_HELPER_PYLIBMOUNT_UPDATE="$top_builddir/libmount/python/test_mount_tab_update.py"
TS_HELPER_PYLIBMOUNT_CONTEXT="$top_srcdir/libmount/python/test_mount_context.py"
TS_HELPER_PYLIBMOUNT_TAB="$top_srcdir/libmount/python/test_mount_tab.py"
TS_HELPER_PYLIBMOUNT_UPDATE="$top_srcdir/libmount/python/test_mount_tab_update.py"
TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
TS_HELPER_MD5="$top_builddir/test_md5"
TS_HELPER_MORE=${TS_HELPER_MORE-"$top_builddir/test_more"}

View File

@ -1,2 +0,0 @@
mount: spec: "//etc"
mount: spec: "/etc"

View File

@ -1,11 +0,0 @@
mount: fstab path: "/etc/fstab"
mount: mtab path: "/etc/mtab"
mount: lock path: "/etc/mtab~"
mount: temp path: "/etc/mtab.tmp"
mount: UID: 0
mount: eUID: 0
mount: spec: "/dev/dummy"
mount: node: "/mnt"
mount: types: "(null)"
mount: opts: "(null)"
/dev/dummy on /mnt type unknown (rw)

View File

@ -316,10 +316,10 @@ function ts_init_suid {
function ts_init_py {
LIBNAME="$1"
[ -f "$TS_TOPDIR/../py${LIBNAME}.la" ] || ts_skip "py${LIBNAME} not compiled"
[ -f "$top_builddir/py${LIBNAME}.la" ] || ts_skip "py${LIBNAME} not compiled"
export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs"
export PYTHONPATH="$TS_TOPDIR/../$LIBNAME/python:$TS_TOPDIR/../.libs"
export LD_LIBRARY_PATH="$top_builddir/.libs"
export PYTHONPATH="$top_builddir/$LIBNAME/python:$top_builddir/.libs"
export PYTHON_VERSION=$(awk '/^PYTHON_VERSION/ { print $3 }' $top_builddir/Makefile)
export PYTHON_MAJOR_VERSION=$(echo $PYTHON_VERSION | sed 's/\..*//')

View File

@ -19,6 +19,8 @@ TS_DESC="last ipv6"
ts_init "$*"
ts_check_test_command "$TS_CMD_LAST"
$TS_CMD_LAST --version 2>&1 | grep -q "invalid option" \
&& ts_skip "deprecated last"
WTMP_FILE=${TS_OUTDIR}/ipv6-input
rm -f $WTMP_FILE

View File

@ -19,6 +19,8 @@ TS_DESC="last"
ts_init "$*"
ts_check_test_command "$TS_CMD_LAST"
$TS_CMD_LAST --version 2>&1 | grep -q "invalid option" \
&& ts_skip "deprecated last"
WTMP_FILE=${TS_OUTDIR}/wtmp
rm -f $WTMP_FILE

View File

@ -20,6 +20,7 @@ ts_init_py libmount
ts_skip_nonroot
TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT"
[ -x $TESTPROG ] || ts_die "test script missing"
PYDBG="$PYTHON -m pdb"
LABEL=libmount-test

View File

@ -18,6 +18,8 @@ ts_skip_nonroot
TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT"
[ -x $TESTPROG ] || ts_die "test script missing"
LABEL=libmount-test
UUID=$($TS_CMD_UUIDGEN)
MOUNTPOINT="$TS_MOUNTPOINT"

View File

@ -11,6 +11,7 @@ ts_init_py libmount
PYDBG="$PYTHON -m pdb"
TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB"
[ -x $TESTPROG ] || ts_die "test script missing"
ts_init_subtest "parse-fstab"
$PYTHON $TESTPROG --parse "$TS_SELF/files/fstab" &> $TS_OUTPUT

View File

@ -9,6 +9,8 @@ ts_init_py libmount
ts_skip_nonroot
TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB"
[ -x $TESTPROG ] || ts_die "test script missing"
ts_check_prog "mkfs.ext3"
PYDBG="$PYTHON -m pdb"

View File

@ -11,8 +11,7 @@ ts_init_py libmount
ts_skip_nonroot
TESTPROG="$TS_HELPER_PYLIBMOUNT_UPDATE"
[ -x $TESTPROG ] || ts_skip "test not compiled"
[ -x $TESTPROG ] || ts_die "test script missing"
#
# fstab - replace

View File

@ -1,40 +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="${0%/*}/../.."
TS_DESC="non canonical path"
. $TS_TOPDIR/functions.sh
ts_init "$*"
ts_check_test_command "$TS_CMD_MOUNT"
ts_skip_nonroot
[ ! -e "/etc" ] && ts_skip "/etc not such file of directory"
$TS_CMD_MOUNT -V | grep -q "libmount"
[ $? -eq 0 ] && ts_skip "libmount version"
# Don't canonicalize SPEC for cifs, nfs, smbfs, ...
$TS_CMD_MOUNT -v -v -v -f -i -n -t cifs //etc /foo | grep "spec:" >> $TS_OUTPUT 2>&1
# Canonicalize when FS type undefined and the SPEC exists
$TS_CMD_MOUNT -v -v -v -f -i -n //etc /foo | grep "spec:" >> $TS_OUTPUT 2>&1
ts_finalize

View File

@ -1,34 +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="${0%/*}/../.."
TS_DESC="basic paths"
. $TS_TOPDIR/functions.sh
ts_init "$*"
ts_check_test_command "$TS_CMD_MOUNT"
ts_skip_nonroot
$TS_CMD_MOUNT -V | grep -q "libmount"
[ $? -eq 0 ] && ts_skip "libmount version"
$TS_CMD_MOUNT -n -f -v -v -v /dev/dummy /mnt &> $TS_OUTPUT
ts_finalize