Merge branch 'travis-osx' of https://github.com/rudimeier/util-linux
* 'travis-osx' of https://github.com/rudimeier/util-linux: travis: add OSX build travis: switch to Ubuntu 14.04 Trusty build-sys: improve uuidd and script build conditions build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms build-sys: add missing "not found" strings build-sys: fix again UL_SCANF_TYPE_MODIFIER tests: don't use system's mount commands tests: improve skipping of old btrfs-tools tests: remove invalid argument in libmount/debug tests: skip old socat silently misc: fix icc/clang compiler warnings misc: fix printf i386 compiler warnings
This commit is contained in:
commit
785539baa3
|
@ -19,7 +19,7 @@ export TS_OPT_parsable="yes"
|
|||
|
||||
function xconfigure
|
||||
{
|
||||
./configure "$@"
|
||||
./configure "$@" $OSX_CONFOPTS
|
||||
err=$?
|
||||
if [ "$DUMP_CONFIG_LOG" = "short" ]; then
|
||||
grep -B1 -A10000 "^## Output variables" config.log | grep -v "_FALSE="
|
||||
|
@ -35,12 +35,13 @@ function check_nonroot
|
|||
|
||||
xconfigure \
|
||||
--disable-use-tty-group \
|
||||
--with-python \
|
||||
--enable-all-programs \
|
||||
--enable-gtk-doc \
|
||||
|| return
|
||||
$MAKE || return
|
||||
|
||||
osx_prepare_check
|
||||
$MAKE check TS_OPTS="$opts" || return
|
||||
|
||||
$MAKE install DESTDIR=/tmp/dest || return
|
||||
}
|
||||
|
||||
|
@ -49,12 +50,14 @@ function check_root
|
|||
local opts="$MAKE_CHECK_OPTS --parallel=1"
|
||||
|
||||
xconfigure \
|
||||
--with-python \
|
||||
--enable-all-programs \
|
||||
|| return
|
||||
$MAKE || return
|
||||
|
||||
$MAKE check TS_COMMAND="true" || return
|
||||
osx_prepare_check
|
||||
sudo -E $MAKE check TS_OPTS="$opts" || return
|
||||
|
||||
sudo $MAKE install || return
|
||||
}
|
||||
|
||||
|
@ -67,10 +70,16 @@ function check_dist
|
|||
|
||||
function travis_install_script
|
||||
{
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
osx_install_script
|
||||
return
|
||||
fi
|
||||
|
||||
# install some packages from Ubuntu's default sources
|
||||
sudo apt-get -qq update || return
|
||||
sudo apt-get install -qq >/dev/null \
|
||||
bc \
|
||||
btrfs-tools \
|
||||
dnsutils \
|
||||
libcap-ng-dev \
|
||||
libpam-dev \
|
||||
|
@ -78,14 +87,56 @@ function travis_install_script
|
|||
gtk-doc-tools \
|
||||
mdadm \
|
||||
ntp \
|
||||
|| return
|
||||
|
||||
# install/upgrade custom stuff from non-official sources
|
||||
sudo add-apt-repository -y ppa:malcscott/socat || return
|
||||
sudo apt-get -qq update || return
|
||||
sudo apt-get install -qq >/dev/null \
|
||||
socat \
|
||||
|| return
|
||||
|
||||
# install only if available (e.g. Ubuntu Trusty)
|
||||
sudo apt-get install -qq >/dev/null \
|
||||
libsystemd-daemon-dev \
|
||||
libsystemd-journal-dev \
|
||||
|| true
|
||||
}
|
||||
|
||||
function osx_install_script
|
||||
{
|
||||
brew update >/dev/null
|
||||
brew tap homebrew/dupes
|
||||
|
||||
brew install gettext ncurses socat xz
|
||||
brew link --force gettext
|
||||
brew link --force ncurses
|
||||
|
||||
OSX_CONFOPTS="
|
||||
--disable-runuser \
|
||||
--disable-su \
|
||||
--disable-login \
|
||||
--disable-last \
|
||||
--disable-utmpdump \
|
||||
--disable-agetty \
|
||||
--disable-wall \
|
||||
--disable-ipcrm \
|
||||
--disable-ipcs \
|
||||
--disable-write \
|
||||
"
|
||||
}
|
||||
|
||||
function osx_prepare_check
|
||||
{
|
||||
[ "$TRAVIS_OS_NAME" = "osx" ] || return 0
|
||||
|
||||
# these ones only need to be gnu for our test-suite
|
||||
brew install coreutils findutils gnu-tar gnu-sed
|
||||
|
||||
# symlink minimally needed gnu commands into PATH
|
||||
mkdir ~/bin
|
||||
for cmd in md5sum readlink seq truncate find xargs tar sed; do
|
||||
ln -s /usr/local/bin/g$cmd $HOME/bin/$cmd
|
||||
done
|
||||
hash -r
|
||||
|
||||
export TS_OPT_col_multibyte_known_fail=yes
|
||||
export TS_OPT_colcrt_regressions_known_fail=yes
|
||||
export TS_OPT_column_invalid_multibyte_known_fail=yes
|
||||
}
|
||||
|
||||
function travis_before_script
|
||||
|
|
14
.travis.yml
14
.travis.yml
|
@ -1,5 +1,8 @@
|
|||
language: c
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
git:
|
||||
depth: 1500
|
||||
|
||||
|
@ -12,6 +15,17 @@ env:
|
|||
- MAKE_CHECK="root"
|
||||
- MAKE_CHECK="dist"
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: precise
|
||||
compiler: gcc
|
||||
env: PRECISE="yes" MAKE_CHECK="root"
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: MAKE_CHECK="nonroot"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
|
|
@ -144,7 +144,7 @@ EXTRA_DIST += $(PATHFILES:=.in)
|
|||
|
||||
$(PATHFILES): Makefile
|
||||
@ rm -f $@ $@.tmp
|
||||
$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
|
||||
$(AM_V_at) $(MKDIR_P) $$(dirname $@)
|
||||
$(AM_V_GEN) srcdir=''; \
|
||||
test -f ./$@.in || srcdir=$(srcdir)/; \
|
||||
$(edit_cmd) $${srcdir}$@.in >$@.tmp
|
||||
|
|
21
configure.ac
21
configure.ac
|
@ -99,6 +99,7 @@ AC_SUBST([usrlib_execdir])
|
|||
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_MKDIR_P
|
||||
AC_PROG_CC_STDC
|
||||
AC_CANONICAL_HOST
|
||||
AC_C_CONST
|
||||
|
@ -243,6 +244,7 @@ AC_CHECK_HEADERS([ \
|
|||
sys/param.h \
|
||||
sys/prctl.h \
|
||||
sys/resource.h \
|
||||
sys/signalfd.h \
|
||||
sys/socket.h \
|
||||
sys/sockio.h \
|
||||
sys/stat.h \
|
||||
|
@ -288,6 +290,7 @@ have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h
|
|||
have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
|
||||
have_security_openpam_h=$ac_cv_header_security_openpam_h
|
||||
have_shadow_h=$ac_cv_header_shadow_h
|
||||
have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h
|
||||
have_utmp_h=$ac_cv_header_utmp_h
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
|
@ -539,16 +542,15 @@ AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
|
|||
int main()
|
||||
{
|
||||
int i;
|
||||
int rc = 1;
|
||||
char *s;
|
||||
i = sscanf("x", $1, &s);
|
||||
if (i == 1 && *s == 'x')
|
||||
rc = 0;
|
||||
free(s);
|
||||
if (i == 1)
|
||||
return 0;
|
||||
return 1;
|
||||
return rc;
|
||||
}])
|
||||
|
||||
ul_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-Werror ${CPPFLAGS}"
|
||||
AC_CACHE_VAL([scanf_cv_alloc_modifier],
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
|
||||
[scanf_cv_alloc_modifier=ms],
|
||||
|
@ -582,7 +584,6 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
|
|||
[scanf_cv_alloc_modifier=no])]
|
||||
)
|
||||
)
|
||||
CPPFLAGS="$ul_save_CPPFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([scanf string alloc modifiers])
|
||||
AS_CASE([$scanf_cv_alloc_modifier],
|
||||
|
@ -1021,7 +1022,7 @@ AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
|
|||
UL_BUILD_INIT([cfdisk], [check])
|
||||
UL_REQUIRES_BUILD([cfdisk], [libfdisk])
|
||||
UL_REQUIRES_BUILD([cfdisk], [libsmartcols])
|
||||
UL_REQUIRES_HAVE([cfdisk], [open_memstream])
|
||||
UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function])
|
||||
UL_REQUIRES_HAVE([cfdisk], [ncurses,slang], [ncurses or slang library])
|
||||
AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes])
|
||||
|
||||
|
@ -1080,6 +1081,8 @@ AC_ARG_ENABLE([uuidd],
|
|||
)
|
||||
UL_BUILD_INIT([uuidd])
|
||||
UL_REQUIRES_BUILD([uuidd], [libuuid])
|
||||
UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function])
|
||||
UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header])
|
||||
AS_IF([test "x$build_uuidd" = xyes], [
|
||||
AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
|
||||
])
|
||||
|
@ -1471,7 +1474,7 @@ dnl we assume reboot() to be the 1-argument variant, because even considering
|
|||
dnl widely used alternative C libraries like uclibc, dietlibc and musl,
|
||||
dnl reboot() with multiple arguments is yet only found in glibc versions
|
||||
dnl earlier than 2.x.
|
||||
UL_REQUIRES_HAVE([ctrlaltdel], [reboot])
|
||||
UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function])
|
||||
AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes])
|
||||
|
||||
UL_BUILD_INIT([fsfreeze], [check])
|
||||
|
@ -1495,7 +1498,7 @@ UL_REQUIRES_LINUX([setarch])
|
|||
AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])
|
||||
|
||||
UL_BUILD_INIT([script], [check])
|
||||
UL_REQUIRES_LINUX([script])
|
||||
UL_REQUIRES_HAVE([script], [sys_signalfd_h], [sys/signalfd.h header])
|
||||
AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])
|
||||
|
||||
UL_BUILD_INIT([scriptreplay], [yes])
|
||||
|
|
|
@ -19,7 +19,7 @@ struct menu_entry {
|
|||
but don't print it in help */
|
||||
|
||||
enum fdisk_labeltype label; /* only for this label */
|
||||
enum fdisk_labeltype exclude; /* all labels except this */
|
||||
int exclude; /* all labels except these */
|
||||
enum fdisk_labeltype parent; /* for nested PT */
|
||||
};
|
||||
|
||||
|
@ -28,7 +28,7 @@ struct menu_entry {
|
|||
|
||||
struct menu {
|
||||
enum fdisk_labeltype label; /* only for this label */
|
||||
enum fdisk_labeltype exclude; /* all labels except this */
|
||||
int exclude; /* all labels except these */
|
||||
|
||||
unsigned int nonested : 1; /* don't make this menu active in nested PT */
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ endif # BUILD_LIBBLKID_TESTS
|
|||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libblkid:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libblkid.so"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
$(MKDIR_P) $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libblkid.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libblkid.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
|
|
|
@ -111,7 +111,7 @@ endif # BUILD_LIBFDISK_TESTS
|
|||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libfdisk:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libfdisk.so"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
$(MKDIR_P) $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libfdisk.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libfdisk.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
|
|
|
@ -112,7 +112,7 @@ fdisk_sector_t fdisk_align_lba(struct fdisk_context *cxt, fdisk_sector_t lba, in
|
|||
}
|
||||
|
||||
if (lba != res)
|
||||
DBG(CXT, ul_debugobj(cxt, "LBA %ju -aligned-%s-> %ju [grain=%jus]",
|
||||
DBG(CXT, ul_debugobj(cxt, "LBA %ju -aligned-%s-> %ju [grain=%lus]",
|
||||
(uintmax_t) lba,
|
||||
direction == FDISK_ALIGN_UP ? "up" :
|
||||
direction == FDISK_ALIGN_DOWN ? "down" : "near",
|
||||
|
|
|
@ -154,7 +154,7 @@ endif # BUILD_LIBMOUNT_TESTS
|
|||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libmount:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libmount.so"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
$(MKDIR_P) $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libmount.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libmount.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
|
|
|
@ -345,7 +345,7 @@ static int userspace_event_verify(struct libmnt_monitor *mn,
|
|||
}
|
||||
} while (1);
|
||||
|
||||
DBG(MONITOR, ul_debugobj(mn, status == 1 ? " success" : " nothing"));
|
||||
DBG(MONITOR, ul_debugobj(mn, "%s", status == 1 ? " success" : " nothing"));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -1808,7 +1808,7 @@ static int test_is_mounted(struct libmnt_test *ts, int argc, char *argv[])
|
|||
struct libmnt_fs *fs;
|
||||
struct libmnt_iter *itr = NULL;
|
||||
struct libmnt_cache *mpc = NULL;
|
||||
int rc, writable = 0;
|
||||
int writable = 0;
|
||||
const char *path = NULL;
|
||||
|
||||
if (mnt_has_regular_mtab(&path, &writable) == 1 && writable == 0)
|
||||
|
@ -1846,12 +1846,11 @@ static int test_is_mounted(struct libmnt_test *ts, int argc, char *argv[])
|
|||
mnt_fs_get_target(fs));
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
done:
|
||||
mnt_unref_table(tb);
|
||||
mnt_unref_table(fstab);
|
||||
mnt_free_iter(itr);
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* returns 0 if @a and @b targets are the same */
|
||||
|
|
|
@ -48,7 +48,7 @@ EXTRA_DIST += \
|
|||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libsmartcols:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libsmartcols.so"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
$(MKDIR_P) $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libsmartcols.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libsmartcols.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
|
|
|
@ -702,7 +702,8 @@ static int print_line(struct libscols_table *tb,
|
|||
|
||||
static int print_title(struct libscols_table *tb)
|
||||
{
|
||||
int rc, align;
|
||||
int rc;
|
||||
mbs_align_t align;
|
||||
size_t len = 0, width;
|
||||
char *title = NULL, *buf = NULL;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ EXTRA_DIST += libuuid/src/libuuid.sym
|
|||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libuuid:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libuuid.so"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
$(MKDIR_P) $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libuuid.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libuuid.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
|
|
|
@ -343,7 +343,7 @@ int main(int argc, char *argv[])
|
|||
if (access(orig_file, F_OK) == 0) {
|
||||
char response[80];
|
||||
|
||||
printf((program == VIGR)
|
||||
printf("%s", (program == VIGR)
|
||||
? _("You are using shadow groups on this system.\n")
|
||||
: _("You are using shadow passwords on this system.\n"));
|
||||
/* TRANSLATORS: this program uses for y and n rpmatch(3),
|
||||
|
|
|
@ -163,7 +163,7 @@ man_MANS += $(SETARCH_MAN_LINKS)
|
|||
CLEANFILES += $(SETARCH_MAN_LINKS)
|
||||
|
||||
$(SETARCH_MAN_LINKS):
|
||||
$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
|
||||
$(AM_V_at) $(MKDIR_P) sys-utils
|
||||
$(AM_V_GEN)echo ".so man8/setarch.8" > $@
|
||||
|
||||
install-exec-hook-setarch:
|
||||
|
|
|
@ -343,7 +343,7 @@ static struct lsns_namespace *add_namespace(struct lsns *ls, int type, ino_t ino
|
|||
if (!ns)
|
||||
return NULL;
|
||||
|
||||
DBG(NS, ul_debugobj(ns, "new %s[%lu]", ns_names[type], ino));
|
||||
DBG(NS, ul_debugobj(ns, "new %s[%ju]", ns_names[type], (uintmax_t)ino));
|
||||
|
||||
INIT_LIST_HEAD(&ns->processes);
|
||||
INIT_LIST_HEAD(&ns->namespaces);
|
||||
|
@ -359,7 +359,8 @@ static int add_process_to_namespace(struct lsns *ls, struct lsns_namespace *ns,
|
|||
{
|
||||
struct list_head *p;
|
||||
|
||||
DBG(NS, ul_debugobj(ns, "add process [%p] pid=%d to %s[%lu]", proc, proc->pid, ns_names[ns->type], ns->id));
|
||||
DBG(NS, ul_debugobj(ns, "add process [%p] pid=%d to %s[%ju]",
|
||||
proc, proc->pid, ns_names[ns->type], (uintmax_t)ns->id));
|
||||
|
||||
list_for_each(p, &ls->processes) {
|
||||
struct lsns_process *xproc = list_entry(p, struct lsns_process, processes);
|
||||
|
@ -437,7 +438,7 @@ static void add_scols_line(struct lsns *ls, struct libscols_table *table,
|
|||
|
||||
switch (get_column_id(i)) {
|
||||
case COL_NS:
|
||||
xasprintf(&str, "%lu", ns->id);
|
||||
xasprintf(&str, "%ju", (uintmax_t)ns->id);
|
||||
break;
|
||||
case COL_PID:
|
||||
xasprintf(&str, "%d", (int) proc->pid);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
Create partitions
|
||||
Create filesystem
|
||||
Do tests...
|
||||
Create filesystem [btrfs]
|
||||
...done.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
Create partitions
|
||||
Create filesystem
|
||||
Do tests...
|
||||
Create filesystem [btrfs]
|
||||
...done.
|
||||
|
|
|
@ -699,22 +699,23 @@ function ts_init_socket_to_file {
|
|||
ts_check_prog "socat"
|
||||
rm -f "$socket" "$outfile"
|
||||
|
||||
# if socat is too old for these options we'll skip it below
|
||||
socat -u UNIX-LISTEN:$socket,fork,max-children=1,backlog=128 \
|
||||
STDOUT > "$outfile" &
|
||||
STDOUT > "$outfile" 2>/dev/null &
|
||||
pid=$!
|
||||
|
||||
# check for running background process
|
||||
if [ "$pid" -le "0" ] || ! kill -s 0 "$pid"; then
|
||||
if [ "$pid" -le "0" ] || ! kill -s 0 "$pid" &>/dev/null; then
|
||||
ts_skip "unable to run socat"
|
||||
fi
|
||||
# wait for the socket listener
|
||||
if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1; then
|
||||
kill -9 "$pid"
|
||||
ts_skip "timeout waiting for socket"
|
||||
if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1 &>/dev/null; then
|
||||
kill -9 "$pid" &>/dev/null
|
||||
ts_skip "timeout waiting for socat socket"
|
||||
fi
|
||||
# check socket again
|
||||
if ! socat -u /dev/null UNIX-CONNECT:$socket; then
|
||||
kill -9 "$pid"
|
||||
ts_skip "socket stopped listening"
|
||||
if ! socat -u /dev/null UNIX-CONNECT:$socket &>/dev/null; then
|
||||
kill -9 "$pid" &>/dev/null
|
||||
ts_skip "socat socket stopped listening"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ ts_init "$*"
|
|||
|
||||
ts_check_test_command "$TS_CMD_FDISK"
|
||||
ts_check_test_command "$TS_CMD_EJECT"
|
||||
ts_check_test_command "$TS_CMD_MOUNT"
|
||||
|
||||
ts_skip_nonroot
|
||||
ts_check_prog "mkfs.ext2"
|
||||
|
@ -71,7 +72,7 @@ init_device
|
|||
mkfs.ext2 -q -F $TS_DEVICE
|
||||
udevadm settle
|
||||
mkdir -p $TS_MOUNTPOINT
|
||||
mount $TS_DEVICE $TS_MOUNTPOINT
|
||||
$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT
|
||||
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
|
||||
deinit_device
|
||||
ts_finalize_subtest
|
||||
|
@ -82,8 +83,8 @@ init_device
|
|||
init_partitions $TS_DEVICE
|
||||
mkdir -p ${TS_MOUNTPOINT}1
|
||||
mkdir -p ${TS_MOUNTPOINT}2
|
||||
mount ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
|
||||
mount ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
|
||||
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
|
||||
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
|
||||
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
|
||||
deinit_device
|
||||
ts_finalize_subtest
|
||||
|
@ -102,8 +103,8 @@ init_device
|
|||
init_partitions $TS_DEVICE
|
||||
mkdir -p ${TS_MOUNTPOINT}1
|
||||
mkdir -p ${TS_MOUNTPOINT}2
|
||||
mount ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
|
||||
mount ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
|
||||
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
|
||||
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
|
||||
$TS_CMD_EJECT --force ${TS_DEVICE}1 && ts_log "Success"
|
||||
deinit_device
|
||||
ts_finalize_subtest
|
||||
|
|
|
@ -29,7 +29,7 @@ TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex"
|
|||
[ -x $TESTPROG ] || ts_skip "test not compiled"
|
||||
|
||||
ts_log "Init device"
|
||||
umount $MOUNTPOINT &> /dev/null
|
||||
$TS_CMD_UMOUNT $MOUNTPOINT &> /dev/null
|
||||
|
||||
# set global variable TS_DEVICE
|
||||
ts_scsi_debug_init dev_size_mb=100
|
||||
|
|
|
@ -31,7 +31,7 @@ TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex"
|
|||
[ -d $TS_NOEXIST ] && rmdir $TS_NOEXIST
|
||||
|
||||
ts_log "Init device"
|
||||
umount $MOUNTPOINT &> /dev/null
|
||||
$TS_CMD_UMOUNT $MOUNTPOINT &> /dev/null
|
||||
|
||||
# set global variable TS_DEVICE
|
||||
ts_scsi_debug_init dev_size_mb=100
|
||||
|
|
|
@ -10,12 +10,13 @@ ts_init "$*"
|
|||
|
||||
ts_check_test_command "$TS_CMD_FDISK"
|
||||
ts_check_test_command "$TS_CMD_FINDMNT"
|
||||
ts_check_test_command "$TS_CMD_MOUNT"
|
||||
ts_check_test_command "$TS_CMD_UMOUNT"
|
||||
ts_check_test_command "$TS_CMD_WIPEFS"
|
||||
ts_check_test_command "$TS_CMD_UUIDGEN"
|
||||
|
||||
ts_skip_nonroot
|
||||
ts_check_prog "mkfs.ext4"
|
||||
ts_check_prog "mkfs.btrfs"
|
||||
|
||||
TESTPROG="$TS_HELPER_LIBMOUNT_CONTEXT"
|
||||
LABEL=libmount-test
|
||||
|
@ -25,7 +26,7 @@ MOUNTPOINT="$TS_MOUNTPOINT"
|
|||
[ -x $TESTPROG ] || ts_skip "test not compiled"
|
||||
|
||||
# set global variable TS_DEVICE
|
||||
ts_scsi_debug_init dev_size_mb=100
|
||||
ts_scsi_debug_init dev_size_mb=257
|
||||
DEVNAME=$(basename $TS_DEVICE)
|
||||
|
||||
ts_log "Create partitions"
|
||||
|
@ -94,37 +95,39 @@ grep -q $DEVICE $LIBMOUNT_UTAB && \
|
|||
ts_finalize_subtest
|
||||
|
||||
|
||||
$TS_CMD_WIPEFS -a $DEVICE &> /dev/null
|
||||
ts_log "Create filesystem [btrfs]"
|
||||
mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null
|
||||
udevadm settle
|
||||
if type "mkfs.btrfs" &>/dev/null && mkfs.btrfs --version &>/dev/null; then
|
||||
$TS_CMD_WIPEFS -a $DEVICE &> /dev/null
|
||||
#ts_log "Create filesystem [btrfs]"
|
||||
mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null
|
||||
udevadm settle
|
||||
|
||||
mount -t btrfs $DEVICE $MOUNTPOINT &> /dev/null
|
||||
btrfs subvolume create $MOUNTPOINT/sub &> /dev/null
|
||||
umount $MOUNTPOINT &> /dev/null
|
||||
$TS_CMD_MOUNT -t btrfs $DEVICE $MOUNTPOINT &> /dev/null
|
||||
btrfs subvolume create $MOUNTPOINT/sub &> /dev/null
|
||||
$TS_CMD_UMOUNT $MOUNTPOINT &> /dev/null
|
||||
|
||||
udevadm settle
|
||||
udevadm settle
|
||||
|
||||
ts_init_subtest "mount-uhelper-subvol"
|
||||
mkdir -p $MOUNTPOINT &> /dev/null
|
||||
ts_valgrind $TESTPROG --mount -o uhelper=foo,rw,subvol=sub $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB || \
|
||||
echo "cannot find $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
ts_init_subtest "mount-uhelper-subvol"
|
||||
mkdir -p $MOUNTPOINT &> /dev/null
|
||||
ts_valgrind $TESTPROG --mount -o uhelper=foo,rw,subvol=sub $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB || \
|
||||
echo "cannot find $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
|
||||
# Don't temporary write btrfs mount options to the test output,
|
||||
# the options depend on kernel version (since 4.2 it contains
|
||||
# subvol= and subvolid=).
|
||||
#
|
||||
#ts_log "All mount options (btrfs subvolume + utab) ---"
|
||||
#$TS_CMD_FINDMNT --mtab $MOUNTPOINT -o OPTIONS -n >> $TS_OUTPUT 2>&1
|
||||
#ts_log "---"
|
||||
# Don't temporary write btrfs mount options to the test output,
|
||||
# the options depend on kernel version (since 4.2 it contains
|
||||
# subvol= and subvolid=).
|
||||
#
|
||||
#ts_log "All mount options (btrfs subvolume + utab) ---"
|
||||
#$TS_CMD_FINDMNT --mtab $MOUNTPOINT -o OPTIONS -n >> $TS_OUTPUT 2>&1
|
||||
#ts_log "---"
|
||||
|
||||
ts_init_subtest "umount-subvol"
|
||||
ts_valgrind $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB && \
|
||||
echo "umount (mountpoint) failed: found $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
ts_init_subtest "umount-subvol"
|
||||
ts_valgrind $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB && \
|
||||
echo "umount (mountpoint) failed: found $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
fi
|
||||
|
||||
ts_log "...done."
|
||||
rmmod scsi_debug
|
||||
|
|
|
@ -9,12 +9,13 @@ ts_init "$*"
|
|||
|
||||
ts_check_test_command "$TS_CMD_FDISK"
|
||||
ts_check_test_command "$TS_CMD_FINDMNT"
|
||||
ts_check_test_command "$TS_CMD_MOUNT"
|
||||
ts_check_test_command "$TS_CMD_UMOUNT"
|
||||
ts_check_test_command "$TS_CMD_WIPEFS"
|
||||
ts_check_test_command "$TS_CMD_UUIDGEN"
|
||||
|
||||
ts_skip_nonroot
|
||||
ts_check_prog "mkfs.ext4"
|
||||
ts_check_prog "mkfs.btrfs"
|
||||
|
||||
ts_init_py libmount
|
||||
|
||||
|
@ -26,7 +27,7 @@ UUID=$($TS_CMD_UUIDGEN)
|
|||
MOUNTPOINT="$TS_MOUNTPOINT"
|
||||
|
||||
# set global variable TS_DEVICE
|
||||
ts_scsi_debug_init dev_size_mb=100
|
||||
ts_scsi_debug_init dev_size_mb=257
|
||||
DEVNAME=$(basename $TS_DEVICE)
|
||||
|
||||
ts_log "Create partitions"
|
||||
|
@ -95,38 +96,39 @@ grep -q $DEVICE $LIBMOUNT_UTAB && \
|
|||
ts_finalize_subtest
|
||||
|
||||
|
||||
$TS_CMD_WIPEFS -a $DEVICE &> /dev/null
|
||||
ts_log "Create filesystem [btrfs]"
|
||||
mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null
|
||||
udevadm settle
|
||||
if type "mkfs.btrfs" &>/dev/null && mkfs.btrfs --version &>/dev/null; then
|
||||
$TS_CMD_WIPEFS -a $DEVICE &> /dev/null
|
||||
#ts_log "Create filesystem [btrfs]"
|
||||
mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null
|
||||
udevadm settle
|
||||
|
||||
mount -t btrfs $DEVICE $MOUNTPOINT &> /dev/null
|
||||
btrfs subvolume create $MOUNTPOINT/sub &> /dev/null
|
||||
umount $MOUNTPOINT &> /dev/null
|
||||
$TS_CMD_MOUNT -t btrfs $DEVICE $MOUNTPOINT &> /dev/null
|
||||
btrfs subvolume create $MOUNTPOINT/sub &> /dev/null
|
||||
$TS_CMD_UMOUNT $MOUNTPOINT &> /dev/null
|
||||
|
||||
udevadm settle
|
||||
udevadm settle
|
||||
|
||||
ts_init_subtest "mount-uhelper-subvol"
|
||||
mkdir -p $MOUNTPOINT &> /dev/null
|
||||
$PYTHON $TESTPROG --mount -o uhelper=foo,rw,subvol=sub $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB || \
|
||||
echo "cannot find $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
ts_init_subtest "mount-uhelper-subvol"
|
||||
mkdir -p $MOUNTPOINT &> /dev/null
|
||||
$PYTHON $TESTPROG --mount -o uhelper=foo,rw,subvol=sub $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB || \
|
||||
echo "cannot find $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
|
||||
# Don't temporary write btrfs mount options to the test output,
|
||||
# the options depend on kernel version (since 4.2 it contains
|
||||
# subvol= and subvolid=).
|
||||
#
|
||||
#ts_log "All mount options (btrfs subvolume + utab) ---"
|
||||
#$TS_CMD_FINDMNT --mtab $MOUNTPOINT -o OPTIONS -n >> $TS_OUTPUT 2>&1
|
||||
#ts_log "---"
|
||||
|
||||
# Don't temporary write btrfs mount options to the test output,
|
||||
# the options depend on kernel version (since 4.2 it contains
|
||||
# subvol= and subvolid=).
|
||||
#
|
||||
#ts_log "All mount options (btrfs subvolume + utab) ---"
|
||||
#$TS_CMD_FINDMNT --mtab $MOUNTPOINT -o OPTIONS -n >> $TS_OUTPUT 2>&1
|
||||
#ts_log "---"
|
||||
|
||||
ts_init_subtest "umount-subvol"
|
||||
$PYTHON $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB && \
|
||||
echo "umount (mountpoint) failed: found $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
ts_init_subtest "umount-subvol"
|
||||
$PYTHON $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
|
||||
grep -q $DEVICE $LIBMOUNT_UTAB && \
|
||||
echo "umount (mountpoint) failed: found $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
|
||||
ts_finalize_subtest
|
||||
fi
|
||||
|
||||
ts_log "...done."
|
||||
rmmod scsi_debug
|
||||
|
|
|
@ -19,12 +19,12 @@ ts_finalize_subtest
|
|||
|
||||
# CACHE | LOCKS
|
||||
ts_init_subtest "set-from-env-str"
|
||||
LIBMOUNT_DEBUG=cache,locks ts_valgrind $TESTPROG 2>&1 $TS_OUTPUT | grep -o '0x.*' &> $TS_OUTPUT
|
||||
LIBMOUNT_DEBUG=cache,locks ts_valgrind $TESTPROG 2>&1 | grep -o '0x.*' &> $TS_OUTPUT
|
||||
ts_finalize_subtest
|
||||
|
||||
# CACHE | LOCKS
|
||||
ts_init_subtest "set-from-env-int"
|
||||
LIBMOUNT_DEBUG=20 ts_valgrind $TESTPROG 2>&1 $TS_OUTPUT | grep -o '0x.*' &> $TS_OUTPUT
|
||||
LIBMOUNT_DEBUG=20 ts_valgrind $TESTPROG 2>&1 | grep -o '0x.*' &> $TS_OUTPUT
|
||||
ts_finalize_subtest
|
||||
|
||||
ts_finalize
|
||||
|
|
|
@ -30,8 +30,10 @@ ts_check_prog "mkfs.btrfs"
|
|||
ts_check_prog "btrfs"
|
||||
|
||||
# btrfs feature check
|
||||
btrfs inspect rootid bla 2>&1 | grep -q "unknown token" \
|
||||
&& ts_skip "btrfs too old"
|
||||
if ! btrfs inspect-internal --help &>/dev/null || \
|
||||
btrfs inspect-internal rootid bla 2>&1 | grep -q "unknown token"; then
|
||||
ts_skip "btrfs too old"
|
||||
fi
|
||||
|
||||
TS_MOUNTPOINT_ANY="$TS_MOUNTPOINT"
|
||||
TS_MOUNTPOINT_CREATE="$TS_MOUNTPOINT-create"
|
||||
|
@ -62,7 +64,7 @@ mkdir bind-point
|
|||
mkdir -p d1/dd1/ddd1
|
||||
cd ./d1/dd1/ddd1
|
||||
btrfs subvol create s2 >/dev/null
|
||||
DEFAULT_SUBVOLID=$(btrfs inspect rootid s2)
|
||||
DEFAULT_SUBVOLID=$(btrfs inspect-internal rootid s2)
|
||||
btrfs subvol set-default $DEFAULT_SUBVOLID . >/dev/null
|
||||
NON_DEFAULT_SUBVOLID=$(btrfs subvol list "$TS_MOUNTPOINT_CREATE" | while read dummy id rest ; do if test $id = $DEFAULT_SUBVOLID ; then continue ; fi ; echo $id ; done)
|
||||
cd ../../../..
|
||||
|
|
Loading…
Reference in New Issue