linux-unionfs mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Zorro Lang <zlang@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH] overlay: add test for lowerdir mount option parsing
Date: Tue, 17 Oct 2023 13:11:45 +0300	[thread overview]
Message-ID: <20231017101145.2348571-1-amir73il@gmail.com> (raw)

Check parsing and display of spaces and escaped colons and commans in
lowerdir mount option.

This is a regression test for two bugs introduced in v6.5 with the
conversion to new mount api.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Zorro,

This is a test for two regressions in kernel v6.5.
The two fixes were merged in 6.6-rc6 and have been picked for
the upcoming LTS 6.5.y release.

Thanks,
Amir.

 tests/overlay/083     | 54 +++++++++++++++++++++++++++++++++++++++++++
 tests/overlay/083.out |  2 ++
 2 files changed, 56 insertions(+)
 create mode 100755 tests/overlay/083
 create mode 100644 tests/overlay/083.out

diff --git a/tests/overlay/083 b/tests/overlay/083
new file mode 100755
index 00000000..071b4b84
--- /dev/null
+++ b/tests/overlay/083
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2023 CTERA Networks. All Rights Reserved.
+#
+# FS QA Test 083
+#
+# Test regressions in parsing and display of special chars in mount options.
+#
+# The following kernel commits from v6.5 introduced regressions:
+#  b36a5780cb44 ("ovl: modify layer parameter parsing")
+#  1784fbc2ed9c ("ovl: port to new mount api")
+#
+
+. ./common/preamble
+_begin_fstest auto quick mount
+
+# Import common functions.
+. ./common/filter
+
+# real QA test starts here
+_supported_fs overlay
+_fixed_by_kernel_commit 32db51070850 \
+	"ovl: fix regression in showing lowerdir mount option"
+_fixed_by_kernel_commit c34706acf40b \
+	"ovl: fix regression in parsing of mount options with escaped comma"
+
+# _overlay_check_* helpers do not handle special chars well
+_require_scratch_nocheck
+
+# Remove all files from previous tests
+_scratch_mkfs
+
+# Create lowerdirs with special characters
+lowerdir1="$OVL_BASE_SCRATCH_MNT/lower1 with  spaces"
+lowerdir2="$OVL_BASE_SCRATCH_MNT/lower2:with::colons"
+lowerdir3="$OVL_BASE_SCRATCH_MNT/lower3,with,,commas"
+lowerdir2_esc="$OVL_BASE_SCRATCH_MNT/lower2\:with\:\:colons"
+lowerdir3_esc="$OVL_BASE_SCRATCH_MNT/lower3\,with\,\,commas"
+upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
+workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
+mkdir -p "$lowerdir1" "$lowerdir2" "$lowerdir3"
+
+# _overlay_mount_* helpers do not handle special chars well, so execute mount directly.
+# if escaped colons and commas are not parsed correctly, mount will fail.
+$MOUNT_PROG -t overlay ovl_esc_test $SCRATCH_MNT \
+	-o"upperdir=$upperdir,workdir=$workdir,lowerdir=$lowerdir3_esc:$lowerdir2_esc:$lowerdir1"
+
+# if spaces are not escaped when showing mount options,
+# mount command will not show the word 'spaces' after the spaces
+$MOUNT_PROG -t overlay | grep ovl_esc_test  | tee -a $seqres.full | grep -v spaces
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/overlay/083.out b/tests/overlay/083.out
new file mode 100644
index 00000000..0beba309
--- /dev/null
+++ b/tests/overlay/083.out
@@ -0,0 +1,2 @@
+QA output created by 083
+Silence is golden
-- 
2.34.1


             reply	other threads:[~2023-10-17 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 10:11 Amir Goldstein [this message]
2023-10-19 17:50 ` [PATCH] overlay: add test for lowerdir mount option parsing Zorro Lang
2023-10-20 16:18   ` Amir Goldstein
2023-10-21 12:30     ` Zorro Lang
     [not found]       ` <CAOQ4uxgHZxcf-OdJHwKn0PUonK4sQz90av+=rurjURW=gw1g3Q@mail.gmail.com>
     [not found]         ` <20231022062634.cdqoy77oe7ibt5vo@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
2023-10-22  7:09           ` Amir Goldstein
2023-10-22 14:34             ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231017101145.2348571-1-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).