diff mbox series

[v2] tools/mvtests: ensure testcase is executable (755)

Message ID 20230907113501.4119112-1-ruansy.fnst@fujitsu.com (mailing list archive)
State New, archived
Headers show
Series [v2] tools/mvtests: ensure testcase is executable (755) | expand

Commit Message

Shiyang Ruan Sept. 7, 2023, 11:35 a.m. UTC
Some test cases lack executable permission ('x'). Before running each
test case, `./check` checks and grants them 'x' permission. However,
this always leads to a dirty git repo. And the absence of 'x' permission
in test cases is often overlooked during reviews.

Since maintainers use mvtest to assign new case, add this change for
convenience of maintainers.

Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
---
 tools/mvtest | 2 ++
 1 file changed, 2 insertions(+)

Comments

Zorro Lang Sept. 8, 2023, 4:59 a.m. UTC | #1
On Thu, Sep 07, 2023 at 07:35:01PM +0800, Shiyang Ruan wrote:
> Some test cases lack executable permission ('x'). Before running each
> test case, `./check` checks and grants them 'x' permission. However,
> this always leads to a dirty git repo. And the absence of 'x' permission
> in test cases is often overlooked during reviews.
> 
> Since maintainers use mvtest to assign new case, add this change for
> convenience of maintainers.
> 
> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
> ---
>  tools/mvtest | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/mvtest b/tools/mvtest
> index 99b154142..1ad775a3e 100755
> --- a/tools/mvtest
> +++ b/tools/mvtest
> @@ -34,6 +34,8 @@ did="$(basename "${dest}")"
>  
>  git mv "tests/${src}" "tests/${dest}"
>  git mv "tests/${src}.out" "tests/${dest}.out"
> +# make sure testcase is executable
> +test $(stat -c '%a' tests/${dest}) == 755 || chmod 755 "tests/${dest}"

I think `chmod 755 "tests/${dest}"` is enough at here. With this change:
Reviewed-by: Zorro Lang <zlang@redhat.com>

>  sed -e "s/^# FS[[:space:]]*QA.*Test.*[0-9]\+$/# FS QA Test No. ${did}/g" -i "tests/${dest}"
>  sed -e "s/^QA output created by ${sid}$/QA output created by ${did}/g" -i "tests/${dest}.out"
>  sed -e "s/test-${sid}/test-${did}/g" -i "tests/${dest}.out"
> -- 
> 2.42.0
>
diff mbox series

Patch

diff --git a/tools/mvtest b/tools/mvtest
index 99b154142..1ad775a3e 100755
--- a/tools/mvtest
+++ b/tools/mvtest
@@ -34,6 +34,8 @@  did="$(basename "${dest}")"
 
 git mv "tests/${src}" "tests/${dest}"
 git mv "tests/${src}.out" "tests/${dest}.out"
+# make sure testcase is executable
+test $(stat -c '%a' tests/${dest}) == 755 || chmod 755 "tests/${dest}"
 sed -e "s/^# FS[[:space:]]*QA.*Test.*[0-9]\+$/# FS QA Test No. ${did}/g" -i "tests/${dest}"
 sed -e "s/^QA output created by ${sid}$/QA output created by ${did}/g" -i "tests/${dest}.out"
 sed -e "s/test-${sid}/test-${did}/g" -i "tests/${dest}.out"