File: info3cache.py

package info (click to toggle)
samba 3.0.24-6etch10
  • links: PTS
  • area: main
  • in suites: etch
  • size: 49,836 kB
  • ctags: 44,390
  • sloc: ansic: 335,711; sh: 8,133; perl: 7,045; makefile: 3,107; python: 2,370; exp: 1,147; yacc: 881; awk: 486; csh: 58; sed: 45
file content (54 lines) | stat: -rwxr-xr-x 1,673 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python
#
# Upon a winbindd authentication, test that an info3 record is cached in
# netsamlogon_cache.tdb and cache records are removed from winbindd_cache.tdb
#

import comfychair, stf
from samba import tdb, winbind

#
# We want to implement the following test on a win2k native mode domain.
#
# 1. trash netsamlogon_cache.tdb
# 2. wbinfo -r DOMAIN\Administrator                    [FAIL]
# 3. wbinfo --auth-crap DOMAIN\Administrator%password  [PASS]
# 4. wbinfo -r DOMAIN\Administrator                    [PASS]
#
# Also for step 3 we want to try 'wbinfo --auth-smbd' and
# 'wbinfo --auth-plaintext'
#

#
# TODO: To implement this test we need to be able to
#
#  - pass username%password combination for an invidivual winbindd request
#    (so we can get the administrator SID so we can clear the info3 cache)
#
#  - start/restart winbindd (to trash the winbind cache)
#
#  - from samba import dynconfig (to find location of info3 cache)
#
#  - be able to modify the winbindd cache (to set/reset individual winbind
#    cache entries)
#
#  - have --auth-crap present in HEAD
#

class WinbindAuthCrap(comfychair.TestCase):
    def runtest(self):
        raise comfychair.NotRunError, "not implemented"
        
class WinbindAuthSmbd(comfychair.TestCase):
    def runtest(self):
        # Grr - winbindd in HEAD doesn't contain the auth_smbd function
        raise comfychair.NotRunError, "no auth_smbd in HEAD"

class WinbindAuthPlaintext(comfychair.TestCase):
    def runtest(self):
        raise comfychair.NotRunError, "not implemented"

tests = [WinbindAuthCrap, WinbindAuthSmbd, WinbindAuthPlaintext]

if __name__ == "__main__":
    comfychair.main(tests)