public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH ltp] fs/acls/acl_test01: delete test user in do_setup() before create it
@ 2018-05-03 18:21 Yixin Zhang
  2018-07-24  9:54 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Yixin Zhang @ 2018-05-03 18:21 UTC (permalink / raw)
  To: ltp

If $TEST_USER1 exist on the system (e.g. test existed abnomarlly),
do_setup() will always failed and it will never go to do_cleanup().
So delete user in do_setup if it exists before create it.

Signed-off-by: Yixin Zhang <yixin.zhang@intel.com>
---
 testcases/kernel/fs/acls/acl_test01 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/fs/acls/acl_test01 b/testcases/kernel/fs/acls/acl_test01
index c91eb5686..9d8247630 100755
--- a/testcases/kernel/fs/acls/acl_test01
+++ b/testcases/kernel/fs/acls/acl_test01
@@ -111,6 +111,7 @@ do_setup()
 		setenforce 0
 	fi
 
+	userdel $TEST_USER1 > /dev/null 2>&1
 	useradd -d $TEST_USER1_HOMEDIR -m -g $TEST_USER1_GROUP $TEST_USER1 -s /bin/sh
 	if [ $? -ne 0 ]; then
 		tst_brkm TBROK "Could not add test user $TEST_USER1."
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-24  9:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 18:21 [LTP] [PATCH ltp] fs/acls/acl_test01: delete test user in do_setup() before create it Yixin Zhang
2018-07-24  9:54 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox