Changeset 745 for trunk/server/source4/torture/ldb
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/torture/ldb/ldb.c
r414 r745 22 22 #include "includes.h" 23 23 #include "lib/events/events.h" 24 #include "lib/ldb/include/ldb.h"25 #include "lib/ldb/include/ldb_errors.h"24 #include <ldb.h> 25 #include <ldb_errors.h> 26 26 #include "lib/ldb-samba/ldif_handlers.h" 27 27 #include "ldb_wrap.h" … … 32 32 33 33 static const char *sid = "S-1-5-21-4177067393-1453636373-93818737"; 34 static const char *hex_sid = "01040000000000051500000081 FDF8F815BBA456718F9705";34 static const char *hex_sid = "01040000000000051500000081fdf8f815bba456718f9705"; 35 35 static const char *guid = "975ac5fa-35d9-431d-b86a-845bcd34fff9"; 36 36 static const char *guid2 = "{975ac5fa-35d9-431d-b86a-845bcd34fff9}"; 37 static const char *hex_guid = " FAC55A97D9351D43B86A845BCD34FFF9";37 static const char *hex_guid = "fac55a97d9351d43b86a845bcd34fff9"; 38 38 39 39 static const char *prefix_map_newline = "2:1.2.840.113556.1.2\n5:2.16.840.1.101.2.2.3"; … … 58 58 59 59 torture_assert_int_equal(torture, 60 ldb_register_samba_handlers(ldb), 0,60 ldb_register_samba_handlers(ldb), LDB_SUCCESS, 61 61 "Failed to register Samba handlers"); 62 62 … … 217 217 218 218 torture_assert_int_equal(torture, 219 ldb_register_samba_handlers(ldb), 0,219 ldb_register_samba_handlers(ldb), LDB_SUCCESS, 220 220 "Failed to register Samba handlers"); 221 221 … … 335 335 336 336 torture_assert_int_equal(torture, 337 ldb_register_samba_handlers(ldb), 0,337 ldb_register_samba_handlers(ldb), LDB_SUCCESS, 338 338 "Failed to register Samba handlers"); 339 339 … … 588 588 struct ldb_dn *child_dn; 589 589 struct ldb_dn *typo_dn; 590 struct ldb_dn *special_dn; 590 591 struct ldb_val val; 591 592 … … 595 596 596 597 torture_assert_int_equal(torture, 597 ldb_register_samba_handlers(ldb), 0,598 ldb_register_samba_handlers(ldb), LDB_SUCCESS, 598 599 "Failed to register Samba handlers"); 599 600 … … 656 657 ldb_dn_compare_base(dn, typo_dn) != 0, 657 658 "Base Comparison on dc=samba,dc=org and c=samba,dc=org should != 0"); 659 660 /* Check comparisons with a special DN */ 661 torture_assert(torture, 662 special_dn = ldb_dn_new(mem_ctx, ldb, "@special_dn"), 663 "Failed to create 'special' DN"); 664 665 torture_assert(torture, 666 ldb_dn_compare(dn, special_dn) != 0, 667 "Comparison on dc=samba,dc=org and @special_dn should != 0"); 668 669 torture_assert(torture, 670 ldb_dn_compare_base(special_dn, dn) > 0, 671 "Base Comparison of @special_dn and dc=samba,dc=org should > 0"); 672 673 torture_assert(torture, 674 ldb_dn_compare_base(dn, special_dn) < 0, 675 "Base Comparison on dc=samba,dc=org and @special_dn should < 0"); 658 676 659 677 /* Check DN based on MS-ADTS:3.1.1.5.1.2 Naming Constraints*/ … … 662 680 "Failed to create a DN with 0xA in it"); 663 681 682 /* this is a warning until we work out how the DEL: CNs work */ 683 if (ldb_dn_validate(dn) != false) { 684 torture_warning(torture, 685 "should have failed to validate a DN with 0xA in it"); 686 } 687 688 /* Escaped comma */ 664 689 torture_assert(torture, 665 ldb_dn_validate(dn) == false,666 " should have failed to validate a DN with 0xAin it");667 668 val.data = "CN=Zer\0,DC=SAMBA,DC=org"; 669 val .length = 23;690 dn = ldb_dn_new(mem_ctx, ldb, "CN=A\\,comma,DC=SAMBA,DC=org"), 691 "Failed to create a DN with an escaped comma in it"); 692 693 694 val = data_blob_const("CN=Zer\0,DC=SAMBA,DC=org", 23); 670 695 torture_assert(torture, 671 696 NULL == ldb_dn_from_ldb_val(mem_ctx, ldb, &val), 672 697 "should fail to create a DN with 0x0 in it"); 673 674 torture_assert(torture,675 dn = ldb_dn_new(mem_ctx, ldb, "CN=loooooooooooooooooooooooooooo"676 "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"677 "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"678 "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"679 "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"680 "ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongdn,DC=SAMBA,DC=org"),681 "Failed to create a DN with size more than 255 characters");682 683 torture_assert(torture,684 ldb_dn_validate(dn) == false,685 "should have failed to validate DN with size more than 255 characters");686 698 687 699 talloc_free(mem_ctx); … … 702 714 703 715 torture_assert_int_equal(torture, 704 ldb_register_samba_handlers(ldb), 0,716 ldb_register_samba_handlers(ldb), LDB_SUCCESS, 705 717 "Failed to register Samba handlers"); 706 718 … … 784 796 struct torture_suite *torture_ldb(TALLOC_CTX *mem_ctx) 785 797 { 786 struct torture_suite *suite = torture_suite_create(mem_ctx, " LDB");798 struct torture_suite *suite = torture_suite_create(mem_ctx, "ldb"); 787 799 788 800 if (suite == NULL) { … … 790 802 } 791 803 792 torture_suite_add_simple_test(suite, " ATTRS", torture_ldb_attrs);793 torture_suite_add_simple_test(suite, " DN-ATTRS", torture_ldb_dn_attrs);794 torture_suite_add_simple_test(suite, " DN-EXTENDED", torture_ldb_dn_extended);795 torture_suite_add_simple_test(suite, " DN-INVALID-EXTENDED", torture_ldb_dn_invalid_extended);796 torture_suite_add_simple_test(suite, " DN", torture_ldb_dn);804 torture_suite_add_simple_test(suite, "attrs", torture_ldb_attrs); 805 torture_suite_add_simple_test(suite, "dn-attrs", torture_ldb_dn_attrs); 806 torture_suite_add_simple_test(suite, "dn-extended", torture_ldb_dn_extended); 807 torture_suite_add_simple_test(suite, "dn-invalid-extended", torture_ldb_dn_invalid_extended); 808 torture_suite_add_simple_test(suite, "dn", torture_ldb_dn); 797 809 798 810 suite->description = talloc_strdup(suite, "LDB (samba-specific behaviour) tests");
Note:
See TracChangeset
for help on using the changeset viewer.