diff options
-rw-r--r-- | tests/include.rc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc index 56366eda083..3af4764b1e4 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -615,6 +615,26 @@ which sha1sum > /dev/null || { } } +userdel --help 2>/dev/null | grep -q -- '--force' || { + userdel() { + if [ "x$1" = "x--force" ]; then + user=$2 + else + user=$1 + fi + eval "$( which userdel ) $user" + } +} + +useradd --help 2>/dev/null | grep -q -- '--no-create-home' || { + useradd() { + # Just remove -M (do not create home) which is the default + # other options are identical + args=`echo $*|sed 's/-M//'` + eval "$( which useradd ) $args" + } +} + alias EXPECT='_EXPECT $LINENO' alias EXPECT_NOT='_EXPECT_NOT $LINENO' alias TEST='_TEST $LINENO' |