VLV: test using restrictive expressions
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 8 Apr 2016 02:00:45 +0000 (14:00 +1200)
committerGarming Sam <garming@samba.org>
Tue, 3 May 2016 06:10:10 +0000 (08:10 +0200)
This tests what happens with the VLV if the results are subject to
an expression.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/vlv.py

index 02831590335087b8e8361abee0dddbfdfec2ce45..660d5b6cdc6376964f75b8ae5a50537602af5d57 100644 (file)
@@ -415,6 +415,14 @@ class VLVTests(samba.tests.TestCase):
                         self.assertCorrectResults(results, expected_order,
                                                   offset, before, after)
 
+    def test_server_vlv_with_expression(self):
+        """What happens when we run the VLV with an expression?"""
+        expressions = ["(objectClass=*)",
+                       "(cn=%s)" % self.users[-1]['cn'],
+                       "(roomNumber=%s)" % self.users[0]['roomNumber'],
+                       ]
+        self.run_index_tests_with_expressions(expressions)
+
     def test_server_vlv_with_failing_expression(self):
         """What happens when we run the VLV on an expression that matches
         nothing?"""
@@ -471,6 +479,14 @@ class VLVTests(samba.tests.TestCase):
 
                         self.assertEquals(expected_results, results)
 
+    def test_vlv_gte_with_expression(self):
+        """What happens when we run the VLV with an expression?"""
+        expressions = ["(objectClass=*)",
+                       "(cn=%s)" % self.users[-1]['cn'],
+                       "(roomNumber=%s)" % self.users[0]['roomNumber'],
+                       ]
+        self.run_gte_tests_with_expressions(expressions)
+
     def test_vlv_gte_with_failing_expression(self):
         """What happens when we run the VLV on an expression that matches
         nothing?"""