]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix libmount test
authorKarel Zak <kzak@redhat.com>
Wed, 9 Feb 2011 14:02:41 +0000 (15:02 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Feb 2011 14:02:41 +0000 (15:02 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/mount/src/context.c
tests/ts/libmount/context

index a481d9cb8a04aefe09f629c240f7b7cd9ba0074e..487859a3f9664c28a2f4f530684c21a9a69d03de 100644 (file)
@@ -18,7 +18,7 @@
  *     mnt_context_set_mflags(cxt, MS_NOATIME|MS_NOEXEC);
  *     mnt_context_set_target(cxt, "/mnt/foo");
  *
- *     if (!mnt_context_do_mount(cxt))
+ *     if (!mnt_context_mount(cxt))
  *             printf("successfully mounted\n");
  *     mnt_free_context(cxt);
  *
@@ -1416,8 +1416,7 @@ static int apply_table(struct libmnt_context *cxt, struct libmnt_table *tb,
  * mnt_context_apply_fstab:
  * @cxt: mount context
  *
- * This function is optional if mnt_context_do_mount() is used. See also
- * mnt_context_set_optsmode().
+ * This function is optional.
  *
  * Returns: 0 on success, negative number in case of error.
  */
@@ -1495,7 +1494,7 @@ int mnt_context_get_status(struct libmnt_context *cxt)
  * @status: mount(2) return code
  *
  * This function should be used if [u]mount(2) syscall was NOT called by
- * libmount (mnt_context_mount() or mnt_context_do_mount()) only.
+ * libmount (by mnt_context_mount() or mnt_context_do_mount()) only.
  *
  * Returns: 0 or negative number in case of error.
  */
@@ -1678,7 +1677,7 @@ int test_umount(struct libmnt_test *ts, int argc, char *argv[])
        if (lock)
                atexit(lock_fallback);
 
-       rc = mnt_context_do_umount(cxt);
+       rc = mnt_context_umount(cxt);
        if (rc)
                printf("failed to umount\n");
        else
index 4248f3132754427564779e809f66f77b3446dc3c..b63f8c55a606d4d3b0b79af788ec36511b828cc1 100755 (executable)
@@ -14,12 +14,15 @@ LABEL=libmount-test
 UUID=$(uuidgen)
 MOUNTPOINT="$TS_MOUNTPOINT"
 
+#set -x
+
 [ -x $TESTPROG ] || ts_skip "test not compiled"
 
 modprobe --dry-run --quiet scsi_debug
 [ "$?" == 0 ] || ts_skip "missing scsi_debug module"
 
 ts_log "Init device"
+umount $MOUNTPOINT &> /dev/null
 rmmod scsi_debug &> /dev/null
 modprobe scsi_debug dev_size_mb=100
 [ "$?" == 0 ] || ts_die "Cannot init device"
@@ -58,6 +61,7 @@ export LIBMOUNT_MTAB=$TS_OUTPUT.mtab
 ts_init_subtest "mount-by-devname"
 mkdir -p $MOUNTPOINT &>  /dev/null
 $TESTPROG --mount $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
+
 grep -q $DEVICE $LIBMOUNT_MTAB || \
        echo "(by device) cannot found $DEVICE in $LIBMOUNT_MTAB" >> $TS_OUTPUT 2>&1
 ts_finalize_subtest
@@ -68,6 +72,7 @@ grep -q $DEVICE $LIBMOUNT_MTAB &&
        echo "umount (device) failed: found $DEVICE in $LIBMOUNT_MTAB" >> $TS_OUTPUT 2>&1
 ts_finalize_subtest
 
+#exit 1
 
 ts_init_subtest "mount-by-label"
 mkdir -p $MOUNTPOINT &>  /dev/null