#50421 Issue: 48851 - Add more search filters to vfilter_simple test suite
Closed 4 months ago by spichugi. Opened 2 years ago by aborah.
aborah/389-ds-base final  into  master

@@ -50,36 +50,178 @@ 

  FILTER_VPE_2 = "(emailclass:2.16.840.1.113730.3.3.2.15.1.1:=vpemail)"

  FILTER_MAILQUATA_1 = "(mailquota:2.16.840.1.113730.3.3.2.15.1:=<900)"

  FILTER_MAILQUATA_2 = "(mailquota:es:=<900)"

+ FILTER_MAIL_900 = "(mailquota<=900)"

+ FILTER_MAIL_600 = "(mailquota<=600)"

+ FILTER_MAIL_100 = "(mailquota<=100)"

+ FILTER_MAIL_100_L = "(mailquota>=100)"

+ FILTER_MAIL_600_G = "(mailquota>=600)"

+ FILTER_MAIL_900_G = "(mailquota>=900)"

+ FILTER_MAIL_100_EL = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=<=100)"

+ FILTER_MAIL_FR = "(mailquota:fr:=<=100)"

+ FILTER_MAIL_100_E = "(mailquota:2.16.840.1.113730.3.3.2.18.1.2:=100)"

+ FILTER_MAIL_600_ELE = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=<=600)"

+ FILTER_MAIL_FR_600 = "(mailquota:fr:=<=600)"

+ FILTER_MAIL_E_600 = "(mailquota:2.16.840.1.113730.3.3.2.18.1.2:=600)"

+ FILTER_MAIL_ELE_900 = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=<=900)"

+ FILTER_MAIL_FR_ELE_900 = "(mailquota:fr:=<=900)"

+ FILTER_MAIL_E_900 = "(mailquota:2.16.840.1.113730.3.3.2.18.1.2:=900)"

+ FILTER_MAIL_EGE_900 = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=>=900)"

+ FILTER_MAIL_FR_EGE_900 = "(mailquota:fr:=>=900)"

+ FILTER_MAIL_E_900_2 = "(mailquota:2.16.840.1.113730.3.3.2.18.1.4:=900)"

+ FILTER_MAIL_EGE_600 = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=>=600)"

+ FILTER_MAIL_FR_EGE_600 = "(mailquota:fr:=>=600)"

+ FILTER_MAIL_E_600_2 = "(mailquota:2.16.840.1.113730.3.3.2.18.1.4:=600)"

+ FILTER_MAIL_EGE_100 = "(mailquota:2.16.840.1.113730.3.3.2.18.1:=>=100)"

+ FILTER_MAIL_FR_EGE_100 = "(mailquota:fr:=>=100)"

+ FILTER_MAIL_E_100 = "(mailquota:2.16.840.1.113730.3.3.2.18.1.4:=100)"

+ FILTER_NS_MANAGE = "(nsRole~=cn=new managed)"

+ FILTER_NS_NEW = "(nsRole~=cn=new)"

+ FILTER_ATTRIBUTE = "(Description=This is the special \\2a attribute value)"

+ FILTER_DES = "(Description=*\\2a*)"

+ FILTER_VADDER = "(nsRole=cn=new vaddr filtered role,dc=example,dc=com)"

+ FILTER_WAL = "(uid=*wal*)"

+ FILTER_ANOTHER = "(nsRole=cn=*another*)"

+ FILTER_MW = "(uid=mw*)"

+ FILTER_RN = "(roomNumber=0312)"

+ FILTER_L = "(l=Cupertino)"

+ FILTER_USER1 = "(uid=user1)"

+ FILTER_OBJECT = "(objectclass=inetorgperson)"

+ FILTER_NS_VADD = "(nsRole=cn=*vaddr*)"

+ FILTER_L_S = "(l=sunnyvale)"

+ FILTER_USER20 = "(uid=user20)"

+ FILTER_USER30 = "(uid=user30)"

+ FILTER_CN = "(nsRole=cn=another vaddr role,dc=example,dc=com)"

+ FILTER_RN_3924 = "(roomNumber=3924)"

+ FILTER_RN_4508 = "(roomNumber=4508)"

+ FILTER_USER40 = "(uid=user40)"

+ FILTER_RN_2254 = "(roomNumber=2254)"

+ FILTER_L_ALL = "(l=*)"

+ FILTER_OBJ_ALL = "(objectclass=*)"

+ FILTER_NSROLE = "(nsRole~=cn=new managed)"

+ FILTER_NSROLE_CN = "(nsRole~=cn=new)"

+ FILTER_NSROLE_VAD = "(nsRole=cn=new vaddr filtered role,dc=example,dc=com)"

+ FILTER_UID = "(uid=*wal*)"

+ FILTER_NSROLE_ANO = "(nsRole=cn=*another*)"

+ FILTER_UID_USER1 = "(uid=user1)"

+ FILTER_OBJ = "(objectclass=inetorgperson)"

+ FILTER_NSROLE_VADR = "(nsRole=cn=*vaddr*)"

+ FILTER_UID_USER20 = "(uid=user20)"

+ FILTER_UID_USER30 = "(uid=user30)"

+ FILTER_NSROLE_ANOV = "(nsRole=cn=another vaddr role,dc=example,dc=com)"

+ FILTER_UID_USER40 = "(uid=user40)"

+ FILTER_C_NS_VAD = f"(&{FILTER_NSROLE} {FILTER_NSROLE_VAD})"

+ FILTER_C_N_NS_VAD = f"(&(!{FILTER_NSROLE})(!{FILTER_NSROLE_VAD}))"

+ FILTER_C_O_N_NS_VAD = f"(&(!{FILTER_NSROLE}) {FILTER_NSROLE_VAD})"

+ FILTER_C_N_NS_O_VAD = f"(&{FILTER_NSROLE}(!{FILTER_NSROLE_VAD}))"

+ FILTER_C_UID_NS = f"(|{FILTER_UID} {FILTER_NSROLE_ANO})"

+ FILTER_C_N_UID_NS = f"(|(!{FILTER_UID})(!{FILTER_NSROLE_ANO}))"

+ FILTER_C_N_UID_NSO = f"(|(!{FILTER_UID}){FILTER_NSROLE_ANO})"

+ FILTER_C_UID_N_NSO = f"(|{FILTER_UID}(!{FILTER_NSROLE_ANO}))"

+ FILTER_C_UID_NSO_L = f"(&{FILTER_UID}(|{FILTER_NSROLE} {FILTER_L}))"

+ FILTER_C_UID_L_UID_NS = f"(|(&{FILTER_UID} {FILTER_L})(&{FILTER_UID} {FILTER_NSROLE}))"

+ FILTER_C_UID_NS_L = f"(|{FILTER_UID}(&{FILTER_NSROLE} {FILTER_L}))"

+ FILTER_C_UID_NS_UID_L = f"(&(|{FILTER_UID} {FILTER_NSROLE})(|{FILTER_UID} {FILTER_L}))"

+ FILTER_C_UID_NSVAD = f"(&{FILTER_UID} {FILTER_NSROLE_VADR})"

+ FILTER_C_NSVAD_UID = f"(&{FILTER_NSROLE_VADR} {FILTER_UID})"

+ FILTER_C_NSVADR_UID = f"(|{FILTER_NSROLE_VADR} {FILTER_UID})"

+ FILTER_C_UID_NS_V = f"(|{FILTER_UID}(&{FILTER_NSROLE} {FILTER_NSROLE_VADR}))"

+ FILTER_C_UID_NSV = f"(|{FILTER_UID} {FILTER_NSROLE_VADR})"

+ FILTER_C_NSV_L = f"(|{FILTER_NSROLE_VADR} {FILTER_L_ALL})"

+ FILTER_C_L_C = f"(&{FILTER_L} {FILTER_C_UID_NS_V})"

+ FILTER_C_L_C_UID = f"(&(!{FILTER_L})(!{FILTER_C_UID_NS_V}))"

+ FILTER_C_L_NS = f"(&(!{FILTER_L}){FILTER_C_UID_NS_V})"

+ FILTER_C_L_C_UIDNS = f"(&{FILTER_L}(!{FILTER_C_UID_NS_V}))"

+ FILTER_C_L_C_UIDNSV = f"(|{FILTER_L} {FILTER_C_UID_NS_V})"

+ FILTER_C_N_L_C_UIDNSV = f"(|(!{FILTER_L})(!{FILTER_C_UID_NS_V}))"

+ FILTER_C_L_C_N_UIDNSV = f"(|(!{FILTER_L}){FILTER_C_UID_NS_V})"

+ FILTER_C_L_N_C_UIDNSV = f"(|{FILTER_L}(!{FILTER_C_UID_NS_V}))"

+ FILTER_C_USER1 = f"(&(!{FILTER_UID_USER1}){FILTER_OBJ})"

+ FILTER_C_USER1_OBJ = f"(|(!{FILTER_UID_USER1}){FILTER_OBJ})"

+ FILTER_C_NSV_LS = f"(&(!{FILTER_NSROLE_VADR}){FILTER_L_S})"

+ FILTER_C_N_NSV_LS = f"(|(!{FILTER_NSROLE_VADR}){FILTER_L_S})"

+ FILTER_C_1_20_30 = f"(&(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})" \

+                    f"(!{FILTER_UID_USER30}){FILTER_OBJ})"

+ FILTER_C_1_20_30_OBJ = f"(|(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})" \

+                        f"(!{FILTER_UID_USER30}){FILTER_OBJ})"

+ FILTER_C_NS_3924 = f"(&(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})" \

+                    f"(!{FILTER_RN_4508}){FILTER_L_S})"

+ FILTER_C_NS_3924_4508 = f"(|(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})" \

+                         f"(!{FILTER_RN_4508}){FILTER_L_S})"

+ FILTER_C_40 = f"(&(!{FILTER_UID_USER40})(&(!{FILTER_UID_USER1})" \

+               f"(!{FILTER_UID_USER20})(!{FILTER_UID_USER30}){FILTER_OBJ}))"

+ FILTER_C_40_USER1 = f"(|(!{FILTER_UID_USER40})(&(!{FILTER_UID_USER1})" \

+                     f"(!{FILTER_UID_USER20})(!{FILTER_UID_USER30}){FILTER_OBJ}))"

+ FILTER_C_2254 = f"(&(!{FILTER_RN_2254}){FILTER_C_NS_3924})"

+ FILTER_C_2254_3924 = f"(|(!{FILTER_RN_2254}){FILTER_C_NS_3924})"

+ FILTER_C_N_1_20_30 = f"(&(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})(!{FILTER_UID_USER30}))"

+ FILTER_C_1_N_20_30 = f"(|(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})(!{FILTER_UID_USER30}))"

+ FILTER_C_ANV_3924 = f"(&(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})(!{FILTER_RN_4508}))"

+ FILTER_C_ANV_4508 = f"(|(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})(!{FILTER_RN_4508}))"

+ FILTER_C_OBJ_1_20 = f"(& {FILTER_OBJ}(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})" \

+                     f"(!{FILTER_UID_USER30}))"

+ FILTER_C_OBJ_1_20_30 = f"(| {FILTER_OBJ}(!{FILTER_UID_USER1})(!{FILTER_UID_USER20})" \

+                        f"(!{FILTER_UID_USER30}))"

+ FILTER_C_LS_ANV = f"(&{FILTER_L_S}(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})(!{FILTER_RN_4508}))"

+ FILTER_C_LS_NS = f"(|{FILTER_L_S}(!{FILTER_NSROLE_ANOV})(!{FILTER_RN_3924})(!{FILTER_RN_4508}))"

+ FILTER_C_LALL = f"(!(|(!{FILTER_L_ALL})(!{FILTER_L_S})))"

+ FILTER_C_LAL_LS = f"(|(!{FILTER_L_ALL})(!{FILTER_L_S}))"

+ FILTER_C_L_EMAIL = f"(&{FILTER_L} {FILTER_EMAIL} {FILTER_C_NSV_L})"

+ FILTER_C_L_N_EMAIL = f"(&(!{FILTER_L})(!{FILTER_EMAIL})(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_N_EMAIL_C = f"(&(!{FILTER_L})(!{FILTER_EMAIL}){FILTER_C_NSV_L})"

+ FILTER_C_L_EMAIL_C = f"(&(!{FILTER_L}){FILTER_EMAIL}(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_EMAIL_CNS = f"(&(!{FILTER_L}){FILTER_EMAIL} {FILTER_C_NSV_L})"

+ FILTER_C_L_EMAIL_CNS_L = f"(&{FILTER_L}(!{FILTER_EMAIL})(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_EMAIL_CNSV_L = f"(&{FILTER_L}(!{FILTER_EMAIL}){FILTER_C_NSV_L})"

+ FILTER_C_L_N_EMAIL_CNSV_L = f"(&{FILTER_L} {FILTER_EMAIL}(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_N_EMAIL_ALL = f"(|{FILTER_L} {FILTER_EMAIL} {FILTER_C_NSV_L})"

+ FILTER_C_L_EMAIL_N_ALL = f"(|(!{FILTER_L})(!{FILTER_EMAIL})(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_EMAIL_C_ALL = f"(|(!{FILTER_L})(!{FILTER_EMAIL}){FILTER_C_NSV_L})"

+ FILTER_C_EMAIL_C_ALL = f"(|(!{FILTER_L}){FILTER_EMAIL}(!{FILTER_C_NSV_L}))"

+ FILTER_C_L_N_EMAIL_C_ALL = f"(|(!{FILTER_L}){FILTER_EMAIL} {FILTER_C_NSV_L})"

+ FILTER_L_N_EMAIL_C_ALL = f"(|{FILTER_L}(!{FILTER_EMAIL})(!{FILTER_C_NSV_L}))"

+ FILTER_L_E_C = f"(|{FILTER_L}(!{FILTER_EMAIL}){FILTER_C_NSV_L})"

+ FILTER_L_E_N_C = f"(|{FILTER_L} {FILTER_EMAIL}(!{FILTER_C_NSV_L}))"

  

  

- VALUES = [FILTER_POSTAL,

-           FILTER_ADDRESS,

-           FILTER_8888,

-           FILTER_6666,

-           FILTER_VPE,

-           FILTER_EMAIL,

-           FILTER_EMAILQUATA,

-           FILTER_QUATA,

-           FILTER_ROLE,

-           FILTER_POST,

-           FILTER_CLASS,

-           FILTER_CLASSES,

-           FILTER_AAA,

-           FILTER_VE,

-           FILTER_VPEM,

-           FILTER_900]

+ VALUES = [FILTER_POSTAL, FILTER_ADDRESS, FILTER_8888, FILTER_6666,

+           FILTER_VPE, FILTER_EMAIL, FILTER_EMAILQUATA, FILTER_QUATA,

+           FILTER_ROLE, FILTER_POST, FILTER_CLASS, FILTER_CLASSES,

+           FILTER_AAA, FILTER_VE, FILTER_VPEM, FILTER_900, FILTER_MAIL_600,

+           FILTER_MAIL_600_G, FILTER_NS_NEW, FILTER_WAL, FILTER_MW, FILTER_RN,

+           FILTER_L, FILTER_USER1, FILTER_OBJECT, FILTER_L_S, FILTER_RN_3924, FILTER_L_ALL,

+           FILTER_OBJ_ALL, FILTER_MAIL_900, FILTER_MAIL_100_L, FILTER_MAIL_E_600, FILTER_MAIL_E_900,

+           FILTER_MAIL_EGE_900, FILTER_MAIL_FR_EGE_900, FILTER_MAIL_EGE_600, FILTER_MAIL_FR_EGE_600,

+           FILTER_MAIL_E_600_2, FILTER_MAIL_EGE_100, FILTER_MAIL_FR_EGE_100, FILTER_MAIL_E_100,

+           FILTER_C_N_NS_VAD, FILTER_C_UID_NS, FILTER_C_N_UID_NS,

+           FILTER_C_N_UID_NSO, FILTER_C_UID_N_NSO, FILTER_C_UID_NSO_L,

+           FILTER_C_UID_L_UID_NS, FILTER_C_UID_NS_L, FILTER_C_UID_NS_UID_L,

+           FILTER_C_NSVADR_UID, FILTER_C_UID_NS_V, FILTER_C_UID_NSV,

+           FILTER_C_NSV_L, FILTER_C_L_C, FILTER_C_L_C_UID, FILTER_C_L_NS,

+           FILTER_C_L_C_UIDNS, FILTER_C_L_C_UIDNSV, FILTER_C_N_L_C_UIDNSV,

+           FILTER_C_L_C_N_UIDNSV, FILTER_C_L_N_C_UIDNSV, FILTER_C_USER1,

+           FILTER_C_USER1_OBJ, FILTER_C_NSV_LS, FILTER_C_N_NSV_LS,

+           FILTER_C_1_20_30, FILTER_C_1_20_30_OBJ, FILTER_C_NS_3924,

+           FILTER_C_NS_3924_4508, FILTER_C_40, FILTER_C_40_USER1,

+           FILTER_C_2254, FILTER_C_2254_3924, FILTER_C_N_1_20_30, FILTER_C_1_N_20_30,

+           FILTER_C_ANV_3924, FILTER_C_ANV_4508, FILTER_C_OBJ_1_20,

+           FILTER_C_OBJ_1_20_30, FILTER_C_LS_ANV,

+           FILTER_C_LS_NS, FILTER_C_LALL, FILTER_C_LAL_LS, FILTER_C_L_EMAIL,

+           FILTER_C_L_N_EMAIL, FILTER_C_L_N_EMAIL_C, FILTER_C_L_EMAIL_CNS,

+           FILTER_C_L_EMAIL_CNSV_L, FILTER_C_L_N_EMAIL_ALL, FILTER_C_L_EMAIL_N_ALL,

+           FILTER_C_L_EMAIL_C_ALL, FILTER_C_EMAIL_C_ALL, FILTER_C_L_N_EMAIL_C_ALL,

+           FILTER_L_N_EMAIL_C_ALL, FILTER_L_E_C, FILTER_L_E_N_C]

  

- VALUES_NEGATIVE = [FILTER_7777,

-                    FILTER_FRED,

-                    FILTER_ECLASS,

-                    FILTER_ECLASS_1,

-                    FILTER_ECLASS_2,

-                    FILTER_ECLASS_3,

-                    FILTER_ECLASS_4,

-                    FILTER_VPE_1,

-                    FILTER_VPE_2,

-                    FILTER_MAILQUATA_1,

-                    FILTER_MAILQUATA_2]

+ VALUES_NEGATIVE = [FILTER_7777, FILTER_FRED, FILTER_ECLASS, FILTER_ECLASS_1,

+                    FILTER_ECLASS_2, FILTER_ECLASS_3, FILTER_ECLASS_4, FILTER_VPE_1,

+                    FILTER_VPE_2, FILTER_MAILQUATA_1, FILTER_MAILQUATA_2, FILTER_MAIL_100,

+                    FILTER_MAIL_900_G, FILTER_NS_MANAGE, FILTER_VADDER,

+                    FILTER_ANOTHER, FILTER_NS_VADD, FILTER_USER20, FILTER_USER30, FILTER_CN,

+                    FILTER_RN_4508, FILTER_USER40, FILTER_RN_2254, FILTER_MAIL_100_EL,

+                    FILTER_MAIL_FR, FILTER_MAIL_100_E, FILTER_MAIL_600_ELE, FILTER_MAIL_FR_600,

+                    FILTER_MAIL_ELE_900, FILTER_MAIL_FR_ELE_900, FILTER_MAIL_E_900_2,

+                    FILTER_ATTRIBUTE, FILTER_DES, FILTER_C_NS_VAD, FILTER_C_O_N_NS_VAD,

+                    FILTER_C_N_NS_O_VAD, FILTER_C_UID_NSVAD, FILTER_C_NSVAD_UID,

+                    FILTER_C_L_EMAIL_C, FILTER_C_L_EMAIL_CNS_L, FILTER_C_L_N_EMAIL_CNSV_L]

  

  

  def non_english_user(people, user, cn_cn, ou_ou, des, tele, facetele, be_be, lang):

Add more search filters to vfilter_simple test suite

Fixes: https://pagure.io/389-ds-base/issue/48851

Author: aborah

Reviewed by: ???

rebased onto 708eb1a851843082d105bb23848a09296025ccb7

2 years ago

Okay, now after you've put all of the test cases I see the pattern.
You have a lot of code repetition across vfilter_* files.

I think it makes sense to put all of the test cases into one file because the topology (non_english_user, english_named_user, user_with_postal_code, _create_test_entries) is redundant across all of the test files and it basically takes at least 50% of the test suite lines.

You can resolve the redundancy with any way you like but the topology should not be repeated...

rebased onto dc55a5d5ceb8dfde149eace7b298e744bd5f3f32

2 years ago

rebased onto faf84d2c8189adafe32e6817eb74730354e84fa7

2 years ago

rebased onto b379a3429a585b40cd22e6372b7a6cf6b7c1457b

2 years ago

@spichugi all three script has been combined

Please, change the PR name, commit message header and body according to the content.

rebased onto 5198f76c3c5d109225a9c133c5096f6c1b963d35

2 years ago

Hmm, you already have the original commit with the same name.
Probably, should be something like Add more search filters to vfilter_simple test suite.

rebased onto ad2771e4190cebe52baebe59e2c15237c88cac0f

2 years ago

@spichugi Done

It is not what I meant at all...

And the commit header is too long.

It should be something like: Issue: 48851 - Add more search filters to vfilter_simple test suite

rebased onto 34cbfcac6e3fa4326b887e614660469c0990c851

2 years ago

rebased onto 7596ca0

2 years ago

Pull-Request has been merged by spichugi

2 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3479

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

4 months ago
Metadata