]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool tests: re-add tests for attribute value verification using samba-tool
authorBjörn Baumbach <bb@sernet.de>
Tue, 26 Nov 2019 09:56:15 +0000 (10:56 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 29 Nov 2019 00:44:40 +0000 (00:44 +0000)
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/samba_tool/computer_edit.sh
python/samba/tests/samba_tool/contact_edit.sh
python/samba/tests/samba_tool/group_edit.sh
python/samba/tests/samba_tool/user_edit.sh

index d584b72e8b52031f8c715ec3890297fc9cfa6977..7459c396603fb6338b735caadb4a0214c73ce36a 100755 (executable)
@@ -107,6 +107,12 @@ get_attribute_base64_control() {
                -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
+get_attribute_force_no_base64() {
+       # LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here.
+       $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \
+               testmachine1 --attributes=displayName \
+               -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
+}
 
 # Test edit computer - change base64 attribute value including control character
 change_attribute_base64_control() {
@@ -164,6 +170,7 @@ testit "add_attribute_base64_control" add_attribute_base64_control || failed=`ex
 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" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1`
+testit_grep "get_attribute_force_no_base64" "^displayName: $display_name" get_attribute_force_no_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`
index c6dea3b87cba0bef0b1b83cee0a939fb9b14f9a3..ee9c40b59cee0c05d5671ca9b02f2cff436bbba5 100755 (executable)
@@ -93,6 +93,12 @@ get_attribute_base64_control() {
                -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
+get_attribute_force_no_base64() {
+       # LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here.
+       $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact show \
+               testcontact1 --attributes=displayName \
+               -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
+}
 
 # Test edit contact - change base64 attribute value including control character
 change_attribute_base64_control() {
@@ -149,6 +155,7 @@ testit "add_attribute_base64_control" add_attribute_base64_control || failed=`ex
 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" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1`
+testit_grep "get_attribute_force_no_base64" "^displayName: $display_name" get_attribute_force_no_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`
index 9789eac6cd4d14051dd26a9ae1ec95a893e6fa6d..d0428af9169b6a1c3b8631218688a1275cb5f8f5 100755 (executable)
@@ -138,6 +138,12 @@ get_attribute_base64_control() {
                -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
+get_attribute_force_no_base64() {
+       # LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here.
+       $PYTHON ${STpath}/source4/scripting/bin/samba-tool group show \
+               testgroup1 --attributes=displayName \
+               -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
+}
 
 # Test edit group - change base64 attribute value including control character
 change_attribute_base64_control() {
@@ -191,6 +197,7 @@ testit "add_attribute_base64_control" add_attribute_base64_control || failed=`ex
 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" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1`
+testit_grep "get_attribute_force_no_base64" "^displayName: $display_name" get_attribute_force_no_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`
index f8c7a3a807b91226dc6fdb1203be8406c773d941..ae0854e89f65fb45b55898880adceba933912023 100755 (executable)
@@ -106,6 +106,12 @@ get_attribute_base64_control() {
                -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
+get_attribute_force_no_base64() {
+       # LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here.
+       $PYTHON ${STpath}/source4/scripting/bin/samba-tool user show \
+               sambatool1 --attributes=displayName \
+               -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
+}
 
 # Test edit user - change base64 attribute value including control character
 change_attribute_base64_control() {
@@ -163,6 +169,7 @@ testit "add_attribute_base64_control" add_attribute_base64_control || failed=`ex
 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" "^displayName:: $display_name_b64" get_attribute_base64 || failed=`expr $failed + 1`
+testit_grep "get_attribute_force_no_base64" "^displayName: $display_name" get_attribute_force_no_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`