The Samba-Bugzilla – Attachment 13347 Details for
Bug 12884
There isn't an easy way to edit a users object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 2
Add-test-for-samba-tool-user-edit.patch (text/plain), 2.54 KB, created by
Rowland Penny
on 2017-07-06 14:18:50 UTC
(
hide
)
Description:
Patch 2
Filename:
MIME Type:
Creator:
Rowland Penny
Created:
2017-07-06 14:18:50 UTC
Size:
2.54 KB
patch
obsolete
>From 9841de748e5462ab264bc491b1f766de02fb1cf2 Mon Sep 17 00:00:00 2001 >From: Rowland Penny <rpenny@samba.org> >Date: Tue, 4 Jul 2017 15:04:36 +0100 >Subject: [PATCH 2/3] Add test for 'samba-tool user edit' > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12884 > >Signed-off-by: Rowland Penny <rpenny@samba.org> >Reviewed-by: Alexander Bokovoy <ab@samba.org> >(cherry picked from commit 3c03ac750f4dea00da21f21302beeaf5b12a35b8) >--- > python/samba/tests/samba_tool/edit.sh | 72 +++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) > create mode 100755 python/samba/tests/samba_tool/edit.sh > >diff --git a/python/samba/tests/samba_tool/edit.sh b/python/samba/tests/samba_tool/edit.sh >new file mode 100755 >index 0000000..c1ecfde >--- /dev/null >+++ b/python/samba/tests/samba_tool/edit.sh >@@ -0,0 +1,72 @@ >+#!/bin/sh >+# >+# Test for 'samba-tool user edit' >+ >+if [ $# -lt 3 ]; then >+cat <<EOF >+Usage: edit.sh SERVER USERNAME PASSWORD >+EOF >+exit 1; >+fi >+ >+SERVER="$1" >+USERNAME="$2" >+PASSWORD="$3" >+ >+STpath=$(pwd) >+. $STpath/testprogs/blackbox/subunit.sh >+ >+# create editor.sh >+# this has to be hard linked to /tmp or 'samba-tool user edit' cannot find it >+tmpeditor=$(mktemp --suffix .sh -p $STpath/bin samba-tool-editor-XXXXXXXX) >+ >+cat >$tmpeditor <<-'EOF' >+#!/usr/bin/env bash >+user_ldif="$1" >+SED=$(which sed) >+$SED -i -e 's/userAccountControl: 512/userAccountControl: 514/' $user_ldif >+EOF >+ >+chmod +x $tmpeditor >+ >+failed=0 >+ >+# Create a test user >+subunit_start_test "Create_User" >+output=$(${STpath}/source4/scripting/bin/samba-tool user create sambatool1 --random-password \ >+-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD") >+status=$? >+if [ "x$status" = "x0" ]; then >+ subunit_pass_test "Create_User" >+else >+ echo "$output" | subunit_fail_test "Create_User" >+ failed=$((failed + 1)) >+fi >+ >+# Edit test user >+subunit_start_test "Edit_User" >+output=$(${STpath}/source4/scripting/bin/samba-tool user edit sambatool1 --editor=$tmpeditor \ >+-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD") >+status=$? >+if [ "x$status" = "x0" ]; then >+ subunit_pass_test "Edit_User" >+else >+ echo "$output" | subunit_fail_test "Edit_User" >+ failed=$((failed + 1)) >+fi >+ >+# Delete test user >+subunit_start_test "Delete_User" >+output=$(${STpath}/source4/scripting/bin/samba-tool user delete sambatool1 \ >+-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD") >+status=$? >+if [ "x$status" = "x0" ]; then >+ subunit_pass_test "Delete_User" >+else >+ echo "$output" | subunit_fail_test "Delete_User" >+ failed=$((failed + 1)) >+fi >+ >+rm -f $tmpeditor >+ >+exit $failed >-- >2.1.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
ab
:
review+
Actions:
View
Attachments on
bug 12884
:
13346
| 13347 |
13348