tests/krb5: Use Python bindings for LZ77+Huffman compression
[Samba.git] / python / samba / tests / gpo_member.py
blob642eb13a639961901c662aa58c66fafce8b277d9
1 # Unix SMB/CIFS implementation. Tests for smb manipulation
2 # Copyright (C) David Mulder <dmulder@suse.com> 2018
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 import os
18 from samba import gpo, tests
19 from samba.gp.gpclass import GPOStorage
20 from samba.param import LoadParm
21 from samba.credentials import Credentials
22 from samba.gp.gp_sec_ext import gp_access_ext
23 import logging
25 class GPOTests(tests.TestCase):
26 def setUp(self):
27 super(GPOTests, self).setUp()
28 self.server = os.environ["SERVER"]
29 self.dc_account = self.server.upper() + '$'
30 self.lp = LoadParm()
31 self.lp.load_default()
32 self.creds = self.insta_creds(template=self.get_credentials())
34 def tearDown(self):
35 super(GPOTests, self).tearDown()
37 def test_sec_ext_load_on_member(self):
38 cache_dir = self.lp.get('cache directory')
39 store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb'))
40 try:
41 gp_access_ext(self.lp, self.creds,
42 self.creds.get_username(), store)
43 except Exception:
44 self.fail('Initializing gp_access_ext should not require ad-dc')