From 378c18e5f024ac5a8aef4cb40d7c9aa9633d144c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:30:35 +0200 Subject: Adding upstream version 2.38.1. Signed-off-by: Daniel Baumann --- tests/ts/eject/umount | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 tests/ts/eject/umount (limited to 'tests/ts/eject') diff --git a/tests/ts/eject/umount b/tests/ts/eject/umount new file mode 100755 index 0000000..a6d1f25 --- /dev/null +++ b/tests/ts/eject/umount @@ -0,0 +1,127 @@ +#!/bin/bash + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="umount" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +ts_skip_nonroot + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_EJECT" +ts_check_test_command "$TS_CMD_KILL" +ts_check_test_command "$TS_CMD_MOUNT" + +ts_check_prog "mkfs.ext2" + +# scsi_debug could not eject for kernel >=3.19 and <4.4 +if x=$(echo "3.19" && uname -r && echo "4.4") \ + && test "$x" = "$(echo "$x" | sort --version-sort)" +then + ts_skip "3.19 <= $(uname -sr) < 4.4" +fi + +# +# Note that eject --force is required because scsi_debug is +# not removable device. +# + +# set global variable TS_DEVICE +function init_device { + ts_scsi_debug_init dev_size_mb=100 +} + +function init_partitions { + local dev=$1 + + ts_log "Create partitions" + $TS_CMD_FDISK --noauto-pt $dev >> /dev/null 2>&1 <