Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/tmpfs Remove ugly workaround to skip this if unpriv...



details:   https://anonhg.NetBSD.org/src/rev/8656d4f0e10c
branches:  trunk
changeset: 758577:8656d4f0e10c
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Tue Nov 09 13:01:33 2010 +0000

description:
Remove ugly workaround to skip this if unprivileged-user=_atf and just use
'su -m' as pooka@ did in t_mkdir.sh.  As he says this may still fail if
root's shell is csh; we need a better solution.

diffstat:

 tests/fs/tmpfs/t_create.sh |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (29 lines):

diff -r 8ae17d5505dc -r 8656d4f0e10c tests/fs/tmpfs/t_create.sh
--- a/tests/fs/tmpfs/t_create.sh        Tue Nov 09 12:24:47 2010 +0000
+++ b/tests/fs/tmpfs/t_create.sh        Tue Nov 09 13:01:33 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_create.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
+# $NetBSD: t_create.sh,v 1.7 2010/11/09 13:01:33 jmmv Exp $
 #
 # Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -84,17 +84,12 @@
        [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
        [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
 
-       if [ ${user} = _atf ]; then
-               atf_expect_fail "We can't 'su ${user}' to run a test command" \
-                   "because it doesn't have a login shell"
-       fi
-
-       atf_check -s eq:0 -o empty -e empty su ${user} -c 'touch b/a'
+       atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch b/a'
        eval $(stat -s b/a)
        [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
        [ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
 
-       atf_check -s eq:0 -o empty -e empty su ${user} -c 'touch c/a'
+       atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch c/a'
        eval $(stat -s c/a)
        [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
        [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"



Home | Main Index | Thread Index | Old Index