Re: [PATCH] tools/mvtest: ensure testcase is executable (755)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Wed, Sep 06, 2023 at 03:13:49PM +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@xxxxxxxxxxx>
> ---
>  tools/mvtest | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/mvtest b/tools/mvtest
> index 99b154142..e839f0256 100755
> --- a/tools/mvtest
> +++ b/tools/mvtest
> @@ -28,6 +28,8 @@ append() {
>  test "${src}" != "${dest}" || die "Test \"${src}\" is the same as dest."
>  test -e "tests/${src}" || die "Test \"${src}\" does not exist."
>  test ! -e "tests/${dest}" || die "Test \"${src}\" already exists."
> +# make sure testcase is executable
> +test `stat -c '%a' tests/${src}` == 755 || chmod 755 "tests/${src}"

(Weird, I thought I've replied this patch, but I can't find my reply anywhere.)

I said we can check and set the permission on the ${dest} file, after the
move operation is done. Due to we actually want to get a 755 ${dest} file
by running the mvtest.

Thanks,
Zorro

>  
>  sid="$(basename "${src}")"
>  did="$(basename "${dest}")"
> -- 
> 2.42.0
> 




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux