Skip to content

Commit

Permalink
tests: don't write mount hint to terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
karelzak committed Aug 23, 2023
1 parent 54fcf51 commit c89b3fd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions tests/ts/eject/umount
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ init_device
mkfs.ext2 -q -F $TS_DEVICE
udevadm settle
mkdir -p $TS_MOUNTPOINT
$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT
$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT &> /dev/null
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
Expand All @@ -94,8 +94,8 @@ init_device
init_partitions $TS_DEVICE
mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1 &> /dev/null
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2 &> /dev/null
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
Expand All @@ -115,8 +115,8 @@ init_device
init_partitions $TS_DEVICE
mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1 &> /dev/null
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2 &> /dev/null
udevadm settle
$TS_CMD_EJECT --force ${TS_DEVICE}1 && ts_log "Success"
deinit_device
Expand Down
2 changes: 1 addition & 1 deletion tests/ts/mount/fstab-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DEVICE=$TS_LODEV
[ -d "$TS_MOUNTPOINT_BIND" ] || mkdir -p "$TS_MOUNTPOINT_BIND"
mkfs.btrfs -d single -m single $DEVICE &> /dev/null || ts_die "Cannot make btrfs on $DEVICE"

$TS_CMD_MOUNT -o loop "$DEVICE" "$TS_MOUNTPOINT_CREATE"
$TS_CMD_MOUNT -o loop "$DEVICE" "$TS_MOUNTPOINT_CREATE" &> /dev/null
pushd . >/dev/null
cd "$TS_MOUNTPOINT_CREATE"
mkdir -p d0/dd0/ddd0
Expand Down
2 changes: 1 addition & 1 deletion tests/ts/mount/move
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function mount_and_check {
# last arg must be an existing or to-be-mounted mountpoint
local mountpoint="${@: -1}"

$TS_CMD_MOUNT "$@" \
$TS_CMD_MOUNT "$@" &> /dev/null \
|| ts_die "error: mount $*"

$TS_CMD_MOUNTPOINT -q "$mountpoint" \
Expand Down
9 changes: 5 additions & 4 deletions tests/ts/mount/remount
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ fi
mkfs.ext2 $DEVICE &> /dev/null || ts_die "Cannot make ext2 on $DEVICE"

# mount read-write
$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT || ts_die "Cannot mount $TS_MOUNTPOINT"
$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT &> /dev/null \
|| ts_die "Cannot mount $TS_MOUNTPOINT"

# check the mount
egrep -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
|| ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"
|| ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"

# remount
$TS_CMD_MOUNT -o remount,ro $TS_MOUNTPOINT \
|| ts_die "Cannot remount $TS_MOUNTPOINT"
$TS_CMD_MOUNT -o remount,ro $TS_MOUNTPOINT &> /dev/null \
|| ts_die "Cannot remount $TS_MOUNTPOINT"

# check the remount
$TS_CMD_FINDMNT --kernel --mountpoint "$TS_MOUNTPOINT" --options "ro" &> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion tests/ts/mount/shared-subtree
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ts_check_prog "mkfs.ext2"
[ -d $TS_MOUNTPOINT ] || mkdir -p $TS_MOUNTPOINT

# bind
$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT
$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT &> /dev/null
[ "$?" = "0" ] || ts_die "error: mount --bind"

# check the bind
Expand Down
6 changes: 3 additions & 3 deletions tests/ts/mount/umount-alltargets
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ ts_finalize_subtest
ts_init_subtest "all-targets-recursive"
multi_mount ${TS_DEVICE}1 $MOUNTPOINT
[ -d "${MOUNTPOINT}1/subA" ] || mkdir -p ${MOUNTPOINT}1/subA
$TS_CMD_MOUNT ${TS_DEVICE}2 ${MOUNTPOINT}1/subA
$TS_CMD_MOUNT ${TS_DEVICE}2 ${MOUNTPOINT}1/subA &> /dev/null
[ -d "${MOUNTPOINT}1/subA/subAB" ] || mkdir -p ${MOUNTPOINT}1/subA/subAB
$TS_CMD_MOUNT ${TS_DEVICE}3 ${MOUNTPOINT}1/subA/subAB
$TS_CMD_MOUNT ${TS_DEVICE}3 ${MOUNTPOINT}1/subA/subAB &> /dev/null
[ -d "${MOUNTPOINT}1/subB" ] || mkdir -p ${MOUNTPOINT}1/subB
$TS_CMD_MOUNT ${TS_DEVICE}4 ${MOUNTPOINT}1/subB
$TS_CMD_MOUNT ${TS_DEVICE}4 ${MOUNTPOINT}1/subB &> /dev/null
$TS_CMD_UMOUNT --recursive --all-targets ${TS_DEVICE}1 >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand Down
4 changes: 2 additions & 2 deletions tests/ts/mount/umount-recursive
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ts_log "Do tests..."

ts_log "A) Mount root"
$TS_CMD_MOUNT ${TS_DEVICE}1 $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
$TS_CMD_MOUNT --make-shared $TS_MOUNTPOINT
$TS_CMD_MOUNT --make-shared $TS_MOUNTPOINT &> /dev/null

ts_log "B) Mount child"
mkdir -p $TS_MOUNTPOINT/mntB
Expand All @@ -86,7 +86,7 @@ $TS_CMD_MOUNT ${TS_DEVICE}4 $TS_MOUNTPOINT/mntB/mntD >> $TS_OUTPUT 2>> $TS_ERRLO

ts_log "E) Mount child-bind"
mkdir -p $TS_MOUNTPOINT/bindC
$TS_CMD_MOUNT --bind $TS_MOUNTPOINT/mntB/mntC $TS_MOUNTPOINT/bindC
$TS_CMD_MOUNT --bind $TS_MOUNTPOINT/mntB/mntC $TS_MOUNTPOINT/bindC &> /dev/null

udevadm settle
$TS_CMD_UMOUNT --recursive $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
Expand Down

0 comments on commit c89b3fd

Please sign in to comment.