예제 #1
0
    def test_search_extended_dn_ad(self):
        if test_server_type == 'AD':
            self.delete_at_teardown.append(
                add_user(self.connection,
                         testcase_id,
                         'sea-1',
                         attributes={'givenName': 'sea-1'}))

            result = self.connection.search(
                search_base=test_base,
                search_filter='(' + test_name_attr + '=' + testcase_id +
                'sea-1)',
                attributes=[test_name_attr],
                controls=[extended_dn_control(),
                          show_deleted_control()])
            if not self.connection.strategy.sync:
                response, result = self.connection.get_response(result)
            else:
                response = self.connection.response
                result = self.connection.result

            self.assertEqual(result['description'], 'success')
            self.assertTrue('<GUID=' in response[0]['dn'])
            self.assertTrue('SID=' in response[0]['dn'])
            self.assertTrue('>;' in response[0]['dn'])
예제 #2
0
    def test_search_extended_dn_ad(self):
        if test_server_type == "AD":
            result = self.connection.search(
                search_base=test_base,
                search_filter="(" + test_name_attr + "=" + testcase_id + "search-1)",
                attributes=[test_name_attr],
                controls=[extended_dn_control(), show_deleted_control()],
            )
            if not self.connection.strategy.sync:
                response, result = self.connection.get_response(result)
            else:
                response = self.connection.response
                result = self.connection.result

            self.assertEqual(result["description"], "success")
            self.assertTrue("<GUID=" in response[0]["dn"])
            self.assertTrue("SID=" in response[0]["dn"])
            self.assertTrue(">;" in response[0]["dn"])
예제 #3
0
    def test_search_extended_dn_ad(self):
        if test_server_type == 'AD':
            result = self.connection.search(search_base=test_base, search_filter='(' + test_name_attr + '=' + testcase_id + 'search-1)', attributes=[test_name_attr], controls=[extended_dn_control(), show_deleted_control()])
            if not self.connection.strategy.sync:
                response, result = self.connection.get_response(result)
            else:
                response = self.connection.response
                result = self.connection.result

            self.assertEqual(result['description'], 'success')
            self.assertTrue('<GUID=' in response[0]['dn'])
            self.assertTrue('SID=' in response[0]['dn'])
            self.assertTrue('>;' in response[0]['dn'])