summaryrefslogtreecommitdiff
path: root/tests/lib/etl_funcs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/etl_funcs.sh')
-rw-r--r--tests/lib/etl_funcs.sh44
1 files changed, 35 insertions, 9 deletions
diff --git a/tests/lib/etl_funcs.sh b/tests/lib/etl_funcs.sh
index 7803008..e8261e0 100644
--- a/tests/lib/etl_funcs.sh
+++ b/tests/lib/etl_funcs.sh
@@ -447,6 +447,38 @@ etl_lmax_filesize()
echo $blks
}
+_etl_init_mount_opts()
+{
+ if [ -z "$ETL_MOUNT_OPTS" ]; then
+ opts=$default_mount_opts
+
+ if [ -n "$ETL_FNEK_SIG" ]; then
+ opts="$default_fne_mount_opts"
+ fi
+
+ if [ -n "$ETL_APPENDED_MOUNT_OPTS" ]; then
+ opts="${opts},${ETL_APPENDED_MOUNT_OPTS}"
+ fi
+
+ export ETL_MOUNT_OPTS=$(eval "echo $opts")
+ fi
+}
+
+etl_is_mount_opt_set()
+{
+ if [ -z "$1" ]; then
+ return 1
+ fi
+
+ _etl_init_mount_opts
+
+ if [[ ! $ETL_MOUNT_OPTS =~ (^|,)$1($|,) ]]; then
+ return 1
+ fi
+
+ return 0
+}
+
#
# etl_mount_i
#
@@ -461,15 +493,9 @@ etl_mount_i()
if [ -z "$ETL_MOUNT_SRC" ] || [ -z "$ETL_MOUNT_DST" ]; then
return 1
fi
- if [ -z "$ETL_MOUNT_OPTS" ]; then
- if [ -n "ETL_FNEK_SIG" ]; then
- export ETL_MOUNT_OPTS=$(eval \
- "echo $default_fne_mount_opts")
- else
- export ETL_MOUNT_OPTS=$(eval "echo $default_mount_opts")
- fi
- fi
-
+
+ _etl_init_mount_opts
+
mount -it ecryptfs -o "$ETL_MOUNT_OPTS" \
"$ETL_MOUNT_SRC" "$ETL_MOUNT_DST"
}