]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
test-019: fix issues on unsuccessful no-container runs
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 19 Jul 2022 20:50:17 +0000 (14:50 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 19 Jul 2022 20:50:23 +0000 (14:50 -0600)
commitdfb2a82daf5d0651eee5b0a4506d57486605b8be
treef8c2104956886db4afaaef4b0d4da0061422c51f
parent9a8667b17cf0bf085942f45ae4f4f5efb8f3c9cc
test-019: fix issues on unsuccessful no-container runs

Running the test with --no-container, might cause an issue with useradd
or groupadd command if the home directory of the test user exists/test
user group exists.

The home directory of the user doesn't get removed by default on all
distros, so explicitly pass the '-r' flag to userdel to remove the
directory.  Whereas user group might exist due to unsuccessful test
runs, address it by passing '-f' flags to groupadd command, that
returns success even if the group exists, that will be removed
by the groupdel command at the exit.

This is not an issue with containers test cases, because they are
created and destroyed for every test case execution.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 59260dfeec1753540fd9ddccc0515aa0ddf2d6ed)
ftests/019-cgconfig-uidgid_dperm_fperm.py