summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2016-02-03 23:44:42 +0100
committerRuediger Meier2016-02-10 21:06:40 +0100
commit23d8c556848c8121e50ff77b16254f1802aa681a (patch)
treef152afefe72884606beccc95b91660d97dd79e67 /tests/functions.sh
parentMerge branch 'pylibmount_dependency' of https://github.com/filbranden/util-linux (diff)
downloadkernel-qcow2-util-linux-23d8c556848c8121e50ff77b16254f1802aa681a.tar.gz
kernel-qcow2-util-linux-23d8c556848c8121e50ff77b16254f1802aa681a.tar.xz
kernel-qcow2-util-linux-23d8c556848c8121e50ff77b16254f1802aa681a.zip
tests: minor cleanup ts_fdisk_clean()
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 1f4d51878..8f6c87724 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -610,18 +610,18 @@ function ts_fdisk_clean {
local DEVNAME=$1
# remove non comparable parts of fdisk output
- if [ x"${DEVNAME}" != x"" ]; then
- sed -i -e "s:${DEVNAME}:<removed>:g;" $TS_OUTPUT
- fi
-
- sed -i -e 's/Disk identifier:.*/Disk identifier: <removed>/g' \
- -e 's/Created a new.*/Created a new <removed>./g' \
- -e 's/^Device[[:blank:]]*Start/Device Start/g' \
- -e 's/^Device[[:blank:]]*Boot/Device Boot/g' \
- -e 's/^Device[[:blank:]]*Flag/Device Flag/g' \
- -e 's/Welcome to fdisk.*/Welcome to fdisk <removed>./g' \
- -e 's/typescript file.*/typescript file <removed>./g' \
- $TS_OUTPUT
+ if [ -n "${DEVNAME}" ]; then
+ sed -i -e "s@${DEVNAME}@<removed>@;" $TS_OUTPUT
+ fi
+
+ sed -i \
+ -e 's/Disk identifier:.*/Disk identifier: <removed>/' \
+ -e 's/Created a new.*/Created a new <removed>./' \
+ -e 's/^Device[[:blank:]]*Start/Device Start/' \
+ -e 's/^Device[[:blank:]]*Boot/Device Boot/' \
+ -e 's/Welcome to fdisk.*/Welcome to fdisk <removed>./' \
+ -e 's/typescript file.*/typescript file <removed>./' \
+ $TS_OUTPUT
}
function ts_scsi_debug_init {