From aa2649fa0c7eb412e1714bb56cfdd4bbf812f613 Mon Sep 17 00:00:00 2001 From: Anuj Borah Date: May 30 2019 11:32:23 +0000 Subject: Issue: 48851 - investigate and port TET matching rules filter tests(vfilter simple) Investigate and port TET matching rules filter tests(vfilter simple) Relates: https://pagure.io/389-ds-base/issue/48851 Author: aborah Reviewed by: Simon Pichugin, Viktor Ashirov, Barbora Smejkalová --- diff --git a/dirsrvtests/tests/suites/filter/vfilter_simple_test.py b/dirsrvtests/tests/suites/filter/vfilter_simple_test.py new file mode 100644 index 0000000..9387adb --- /dev/null +++ b/dirsrvtests/tests/suites/filter/vfilter_simple_test.py @@ -0,0 +1,410 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2019 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK ---- + +""" +verify and testing Filter from a search +""" + +import os +import pytest + +from lib389._constants import DEFAULT_SUFFIX, PW_DM +from lib389.topologies import topology_st as topo +from lib389.idm.organizationalunit import OrganizationalUnits +from lib389.idm.account import Accounts +from lib389.idm.user import UserAccount, UserAccounts +from lib389.schema import Schema +from lib389.idm.role import ManagedRoles, FilterRoles + +pytestmark = pytest.mark.tier1 + +FILTER_POSTAL = "(postalCode=99999)" +FILTER_ADDRESS = "(postalAddress=345 California Av., Mountain View, CA)" +FILTER_8888 = "(postalCode:2.16.840.1.113730.3.3.2.7.1:=88888)" +FILTER_6666 = "(postalCode:2.16.840.1.113730.3.3.2.7.1.3:=66666)" +FILTER_VPE = "(emailclass=vpe*)" +FILTER_EMAIL = "(emailclass=*emai*)" +FILTER_EMAILQUATA = "(mailquota=*00)" +FILTER_QUATA = '(mailquota=*6*0)' +FILTER_ROLE = '(nsRole=*)' +FILTER_POST = '(postalAddress=*)' +FILTER_CLASS = "(emailclass:2.16.840.1.113730.3.3.2.15.1:=>AAA)" +FILTER_CLASSES = "(emailclass:es:=>AAA)" +FILTER_AAA = "(emailclass:2.16.840.1.113730.3.3.2.15.1.5:=AAA)" +FILTER_VE = "(emailclass:2.16.840.1.113730.3.3.2.15.1:=>vpemail)" +FILTER_VPEM = "(emailclass:es:=>vpemail)" +FILTER_900 = "(mailquota:2.16.840.1.113730.3.3.2.15.1.1:=900)" +FILTER_7777 = "(postalCode:de:==77777)" +FILTER_FRED = '(fred=*)' +FILTER_ECLASS = "(emailclass:2.16.840.1.113730.3.3.2.15.1.5:=vpemail)" +FILTER_ECLASS_1 = "(emailclass:2.16.840.1.113730.3.3.2.15.1:=<1)" +FILTER_ECLASS_2 = "(emailclass:es:=<1)" +FILTER_ECLASS_3 = "(emailclass:2.16.840.1.113730.3.3.2.15.1.1:=1)" +FILTER_ECLASS_4 = "(emailclass:2.16.840.1.113730.3.3.2.15.1:=