From fcac2a821c9b382ee265b9f1ed8a251f47c6892f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 25 Jun 2019 14:01:07 -0700 Subject: Make chgrp and chown tests work on Android. There's no /etc/passwd and /etc/group, but there are enough users and groups that we can test with. ("bin" and "daemon" were added for LTP; "shell" is what you get with `adb shell`.) --- tests/chgrp.test | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/chgrp.test') diff --git a/tests/chgrp.test b/tests/chgrp.test index 65820361..5c7e4258 100755 --- a/tests/chgrp.test +++ b/tests/chgrp.test @@ -9,9 +9,13 @@ then exit fi -# We chgrp between "root" and the last group in /etc/group. - -GRP="$(sed -n '$s/:.*//p' /etc/group)" +if [ -f /etc/group ]; then + # We chgrp between "root" and the last group in /etc/group. + GRP="$(sed -n '$s/:.*//p' /etc/group)" +else + # Or assume we're on Android and pick a well-known group. + GRP=shell +fi # Set up a little testing hierarchy -- cgit v1.2.3