summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-10-01 06:50:02 +0200
committerVijay Bellur <vbellur@redhat.com>2014-10-30 01:32:12 -0700
commit92c4650ac809ee227c6591397a64269850f3217e (patch)
treeee523f5107e35d1944ca05d6bbdb7bd7eadaf6ea
parent96e1c33b681b34124bdc78174a21865623c9795b (diff)
Regression test portability: useradd/userdell
Adjust useradd/userdel flags for NetBSD. Similar work will have to be done for other non Linux systems BUG: 1129939 Change-Id: I2a30819a4915d04473f0ef0c0c063de6015212a1 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8895 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--tests/include.rc20
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'