[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Various tests give illusory results
From: |
Jim Meyering |
Subject: |
Re: Various tests give illusory results |
Date: |
Wed, 15 Aug 2012 18:37:22 +0200 |
Ondrej Oprala wrote:
> here's the new patch...I hope it's all alright now.
> And sorry about not mentioning Bernhard in the first place,
> it just didn't occur to me.
...
> Subject: [PATCH] tests: Add error checking for root-only tests running
> setuidgid
>
> * NEWS: Mention the test improvement.
> * tests/init.cfg: Modify the require_root_ function to check
> for setuidgid calls and proper permissions.
>
> Improved-by: Bernhard Voelker
...
> +** Improved tests
> +
> + root-only tests now properly check for permissions of dummy
> + user $NON_ROOT_USERNAME before trying to run binaries from the
> + src dir.
...
> +setuidgid_has_perm_()
> +{
> + local rm_version=$(
> + setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version |
> + sed -n 'ls/.* //p'
> + )
> + case "_${rm_version}_" in
> + _${PACKAGE_VERSION}_) ;;
> + *) return 1;;
> + esac
> +}
Thanks.
I've squashed in two minor changes, and will push the result in a few hours.
The latter switches from use of "_" to ":" to avoid the need for braces.
diff --git a/NEWS b/NEWS
index 10addb4..d327b02 100644
--- a/NEWS
+++ b/NEWS
@@ -20,7 +20,7 @@ GNU coreutils NEWS -*-
outline -*-
root-only tests now properly check for permissions of dummy
user $NON_ROOT_USERNAME before trying to run binaries from the
- src dir.
+ build dir.
* Noteworthy changes in release 8.18 (2012-08-12) [stable]
diff --git a/tests/init.cfg b/tests/init.cfg
index 5863450..76baf4f 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -347,8 +347,8 @@ setuidgid_has_perm_()
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version |
sed -n 'ls/.* //p'
)
- case "_${rm_version}_" in
- _${PACKAGE_VERSION}_) ;;
+ case ":$rm_version:" in
+ :$PACKAGE_VERSION:) ;;
*) return 1;;
esac
}