From: Björn Baumbach Date: Tue, 26 Nov 2019 09:41:29 +0000 (+0100) Subject: samba-tool tests: prepare tests for new samba-tool functionality X-Git-Tag: ldb-2.1.0~498 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b04d9f2ec85f10dac8cd8723deea3a18925deea;p=thirdparty%2Fsamba.git samba-tool tests: prepare tests for new samba-tool functionality Use ldbsearch instead of "samba-tool user show" to get base64 encoded attribute. Used to verify that the attribute value has been changed successfully. Signed-off-by: Björn Baumbach Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/samba_tool/computer_edit.sh b/python/samba/tests/samba_tool/computer_edit.sh index 974c9deaeb5..d584b72e8b5 100755 --- a/python/samba/tests/samba_tool/computer_edit.sh +++ b/python/samba/tests/samba_tool/computer_edit.sh @@ -66,8 +66,7 @@ EOF } get_attribute_base64() { - $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \ - testmachine1 --attributes=displayName \ + ${STpath}/bin/ldbsearch '(sAMAccountName=testmachine1$)' displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } @@ -164,7 +163,7 @@ testit "delete_attribute" delete_attribute || failed=`expr $failed + 1` testit "add_attribute_base64_control" add_attribute_base64_control || failed=`expr $failed + 1` testit_grep "get_attribute_base64_control" "^displayName:: $display_name_con_b64" get_attribute_base64_control || failed=`expr $failed + 1` testit "change_attribute_base64_control" change_attribute_base64_control || failed=`expr $failed + 1` -testit_grep "get_attribute_base64_control" "^displayName:: $display_name_b64" get_attribute_base64_control || failed=`expr $failed + 1` +testit_grep "get_attribute_base64" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1` testit "change_attribute_force_no_base64" change_attribute_force_no_base64 || failed=`expr $failed + 1` testit_grep "get_changed_attribute_force_no_base64" "^displayName: $display_name_new" get_changed_attribute_force_no_base64 || failed=`expr $failed + 1` testit "delete_computer" delete_computer || failed=`expr $failed + 1` diff --git a/python/samba/tests/samba_tool/contact_edit.sh b/python/samba/tests/samba_tool/contact_edit.sh index cc3445e57e7..c6dea3b87cb 100755 --- a/python/samba/tests/samba_tool/contact_edit.sh +++ b/python/samba/tests/samba_tool/contact_edit.sh @@ -51,8 +51,8 @@ EOF } get_attribute_base64() { - $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact show \ - testcontact1 --attributes=displayName \ + ${STpath}/bin/ldbsearch '(&(objectClass=contact)(name=testcontact1))' \ + displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } @@ -148,7 +148,7 @@ testit "delete_attribute" delete_attribute || failed=`expr $failed + 1` testit "add_attribute_base64_control" add_attribute_base64_control || failed=`expr $failed + 1` testit_grep "get_attribute_base64_control" "^displayName:: $display_name_con_b64" get_attribute_base64_control || failed=`expr $failed + 1` testit "change_attribute_base64_control" change_attribute_base64_control || failed=`expr $failed + 1` -testit_grep "get_attribute_base64_control" "^displayName:: $display_name_b64" get_attribute_base64_control || failed=`expr $failed + 1` +testit_grep "get_attribute_base64" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1` testit "change_attribute_force_no_base64" change_attribute_force_no_base64 || failed=`expr $failed + 1` testit_grep "get_changed_attribute_force_no_base64" "^displayName: $display_name_new" get_changed_attribute_force_no_base64 || failed=`expr $failed + 1` testit "delete_contact" delete_contact || failed=`expr $failed + 1` diff --git a/python/samba/tests/samba_tool/group_edit.sh b/python/samba/tests/samba_tool/group_edit.sh index fe807c7029e..9789eac6cd4 100755 --- a/python/samba/tests/samba_tool/group_edit.sh +++ b/python/samba/tests/samba_tool/group_edit.sh @@ -97,8 +97,7 @@ EOF } get_attribute_base64() { - $PYTHON ${STpath}/source4/scripting/bin/samba-tool group show \ - testgroup1 --attributes=displayName \ + ${STpath}/bin/ldbsearch '(sAMAccountName=testgroup1)' displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } @@ -191,7 +190,7 @@ testit "delete_attribute" delete_attribute || failed=`expr $failed + 1` testit "add_attribute_base64_control" add_attribute_base64_control || failed=`expr $failed + 1` testit_grep "get_attribute_base64_control" "^displayName:: $display_name_con_b64" get_attribute_base64_control || failed=`expr $failed + 1` testit "change_attribute_base64_control" change_attribute_base64_control || failed=`expr $failed + 1` -testit_grep "get_attribute_base64_control" "^displayName:: $display_name_b64" get_attribute_base64_control || failed=`expr $failed + 1` +testit_grep "get_attribute_base64" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1` testit "change_attribute_force_no_base64" change_attribute_force_no_base64 || failed=`expr $failed + 1` testit_grep "get_changed_attribute_force_no_base64" "^displayName: $display_name_new" get_changed_attribute_force_no_base64 || failed=`expr $failed + 1` testit "delete_test_group" delete_test_group || failed=`expr $failed + 1` diff --git a/python/samba/tests/samba_tool/user_edit.sh b/python/samba/tests/samba_tool/user_edit.sh index 17e11db5fd2..f8c7a3a807b 100755 --- a/python/samba/tests/samba_tool/user_edit.sh +++ b/python/samba/tests/samba_tool/user_edit.sh @@ -65,8 +65,7 @@ EOF } get_attribute_base64() { - $PYTHON ${STpath}/source4/scripting/bin/samba-tool user show \ - sambatool1 --attributes=displayName \ + ${STpath}/bin/ldbsearch '(sAMAccountName=sambatool1)' displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } @@ -163,7 +162,7 @@ testit "delete_attribute" delete_attribute || failed=`expr $failed + 1` testit "add_attribute_base64_control" add_attribute_base64_control || failed=`expr $failed + 1` testit_grep "get_attribute_base64_control" "^displayName:: $display_name_con_b64" get_attribute_base64_control || failed=`expr $failed + 1` testit "change_attribute_base64_control" change_attribute_base64_control || failed=`expr $failed + 1` -testit_grep "get_attribute_base64_control" "^displayName:: $display_name_b64" get_attribute_base64_control || failed=`expr $failed + 1` +testit_grep "get_attribute_base64" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1` testit "change_attribute_force_no_base64" change_attribute_force_no_base64 || failed=`expr $failed + 1` testit_grep "get_changed_attribute_force_no_base64" "^displayName: $display_name_new" get_changed_attribute_force_no_base64 || failed=`expr $failed + 1` testit "delete_user" delete_user || failed=`expr $failed + 1`