From 12b3f26eee88ac810d08197d64019f5c4cfa2a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= Date: Tue, 26 Nov 2019 10:56:15 +0100 Subject: [PATCH] samba-tool tests: re-add tests for attribute value verification using samba-tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Baumbach Reviewed-by: Andrew Bartlett --- python/samba/tests/samba_tool/computer_edit.sh | 7 +++++++ python/samba/tests/samba_tool/contact_edit.sh | 7 +++++++ python/samba/tests/samba_tool/group_edit.sh | 7 +++++++ python/samba/tests/samba_tool/user_edit.sh | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/python/samba/tests/samba_tool/computer_edit.sh b/python/samba/tests/samba_tool/computer_edit.sh index d584b72e8b5..7459c396603 100755 --- a/python/samba/tests/samba_tool/computer_edit.sh +++ b/python/samba/tests/samba_tool/computer_edit.sh @@ -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` diff --git a/python/samba/tests/samba_tool/contact_edit.sh b/python/samba/tests/samba_tool/contact_edit.sh index c6dea3b87cb..ee9c40b59ce 100755 --- a/python/samba/tests/samba_tool/contact_edit.sh +++ b/python/samba/tests/samba_tool/contact_edit.sh @@ -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` diff --git a/python/samba/tests/samba_tool/group_edit.sh b/python/samba/tests/samba_tool/group_edit.sh index 9789eac6cd4..d0428af9169 100755 --- a/python/samba/tests/samba_tool/group_edit.sh +++ b/python/samba/tests/samba_tool/group_edit.sh @@ -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` diff --git a/python/samba/tests/samba_tool/user_edit.sh b/python/samba/tests/samba_tool/user_edit.sh index f8c7a3a807b..ae0854e89f6 100755 --- a/python/samba/tests/samba_tool/user_edit.sh +++ b/python/samba/tests/samba_tool/user_edit.sh @@ -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`