diff --git a/shared/templates/mount_option/oval.template b/shared/templates/mount_option/oval.template index b660b230955..9a8665b4191 100644 --- a/shared/templates/mount_option/oval.template +++ b/shared/templates/mount_option/oval.template @@ -38,7 +38,7 @@ /etc/fstab - ^[\s]*[\S]+[\s]+{{{ POINTREGEX }}}[\s]+[\S]+[\s]+([\S]+) + ^[\s]*(?!#)[\S]+[\s]+{{{ POINTREGEX }}}[\s]+[\S]+[\s]+([\S]+) 1 diff --git a/shared/templates/mount_option/tests/fstab_comment.pass.sh b/shared/templates/mount_option/tests/fstab_comment.pass.sh new file mode 100644 index 00000000000..7c8bdaa6bbb --- /dev/null +++ b/shared/templates/mount_option/tests/fstab_comment.pass.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# platform = multi_platform_all +. $SHARED/partition.sh + +clean_up_partition {{{ MOUNTPOINT }}} + +create_partition + +make_fstab_given_partition_line {{{ MOUNTPOINT }}} ext2 defaults +# comment last line added above to be ignored +sed -Ei '${s/^/#/}' /etc/fstab + +make_fstab_given_partition_line {{{ MOUNTPOINT }}} ext2 {{{ MOUNTOPTION }}} + +mount_partition {{{ MOUNTPOINT }}} || true