pykd

Форк
0
/
basetest.py 
139 строк · 6.8 Кб
1
#
2
#
3
#
4

5
import unittest
6
import target
7
import pykd
8

9
class BaseTest( unittest.TestCase ):
10
      
11
    def testOldSupportedRoutines( self ):
12
        """ Branch test: old API 0.0.x what must be available """
13
    
14
        self.assertTrue( hasattr(pykd, 'addSynSymbol') )
15
        self.assertTrue( hasattr(pykd, 'attachKernel') )
16
        self.assertTrue( hasattr(pykd, 'attachProcess') )
17
        self.assertTrue( hasattr(pykd, 'addr64') )
18
        self.assertTrue( hasattr(pykd, 'breakin') )
19
        self.assertTrue( hasattr(pykd, 'compareMemory') )
20
        self.assertTrue( hasattr(pykd, 'containingRecord') )
21
        self.assertTrue( hasattr(pykd, 'dbgCommand') )
22
        self.assertTrue( hasattr(pykd, 'dprint') )
23
        self.assertTrue( hasattr(pykd, 'dprintln') )
24
        self.assertTrue( hasattr(pykd, 'debuggerPath') )
25
        self.assertTrue( hasattr(pykd, 'delAllSynSymbols') )
26
        self.assertTrue( hasattr(pykd, 'delSynSymbol') )
27
        self.assertTrue( hasattr(pykd, 'delSynSymbolsMask') )
28
        self.assertTrue( hasattr(pykd, 'expr') )
29
        self.assertTrue( hasattr(pykd, 'findSymbol') )
30
        self.assertTrue( hasattr(pykd, 'getCurrentProcess') )
31
        self.assertTrue( hasattr(pykd, 'getCurrentStack') )
32
        self.assertTrue( hasattr(pykd, 'getImplicitThread') )
33
        self.assertTrue( hasattr(pykd, 'getOffset') )
34
        self.assertTrue( hasattr(pykd, 'getPdbFile') )
35
        self.assertTrue( hasattr(pykd, 'getProcessorMode') )
36
        self.assertTrue( hasattr(pykd, 'getProcessorType') )
37
        self.assertTrue( hasattr(pykd, 'getThreadList') )
38
        self.assertTrue( hasattr(pykd, 'go') )
39
        self.assertTrue( hasattr(pykd, 'is64bitSystem') )
40
        self.assertTrue( hasattr(pykd, 'isDumpAnalyzing') )
41
        self.assertTrue( hasattr(pykd, 'isKernelDebugging') )
42
        self.assertTrue( hasattr(pykd, 'isValid') )
43
        self.assertTrue( hasattr(pykd, 'isWindbgExt') )
44
        self.assertTrue( hasattr(pykd, 'loadAnsiString') )
45
        self.assertTrue( hasattr(pykd, 'loadBytes') )
46
        self.assertTrue( hasattr(pykd, 'loadCStr') )
47
        self.assertTrue( hasattr(pykd, 'loadChars') )
48
        self.assertTrue( hasattr(pykd, 'loadDWords') )
49
        self.assertTrue( hasattr(pykd, 'loadDump') )
50
        self.assertTrue( hasattr(pykd, 'loadModule') )
51
        self.assertTrue( hasattr(pykd, 'loadQWords') )
52
        self.assertTrue( hasattr(pykd, 'loadPtrs') )
53
        self.assertTrue( hasattr(pykd, 'loadSignBytes') )
54
        self.assertTrue( hasattr(pykd, 'loadSignDWords') )
55
        self.assertTrue( hasattr(pykd, 'loadSignQWords') )
56
        self.assertTrue( hasattr(pykd, 'loadSignWords') )
57
        self.assertTrue( hasattr(pykd, 'loadUnicodeString') )
58
        self.assertTrue( hasattr(pykd, 'loadWChars') )
59
        self.assertTrue( hasattr(pykd, 'loadWStr') )
60
        self.assertTrue( hasattr(pykd, 'loadWords') )
61
        self.assertTrue( hasattr(pykd, 'ptrByte') )
62
        self.assertTrue( hasattr(pykd, 'ptrDWord') )
63
        self.assertTrue( hasattr(pykd, 'ptrMWord') )
64
        self.assertTrue( hasattr(pykd, 'ptrPtr') )
65
        self.assertTrue( hasattr(pykd, 'ptrQWord') )
66
        self.assertTrue( hasattr(pykd, 'ptrSignByte') )
67
        self.assertTrue( hasattr(pykd, 'ptrSignDWord') )
68
        self.assertTrue( hasattr(pykd, 'ptrSignMWord') )
69
        self.assertTrue( hasattr(pykd, 'ptrSignQWord') )
70
        self.assertTrue( hasattr(pykd, 'ptrSignWord') )
71
        self.assertTrue( hasattr(pykd, 'ptrSize') )
72
        self.assertTrue( hasattr(pykd, 'ptrWord') )
73
        self.assertTrue( hasattr(pykd, 'rdmsr') )
74
        self.assertTrue( hasattr(pykd, 'reg') )
75
        self.assertTrue( hasattr(pykd, 'setCurrentProcess') )
76
        self.assertTrue( hasattr(pykd, 'setImplicitThread') )
77
        self.assertTrue( hasattr(pykd, 'setProcessorMode') )
78
        self.assertTrue( hasattr(pykd, 'sizeof') )   
79
        self.assertTrue( hasattr(pykd, 'startProcess') )
80
        self.assertTrue( hasattr(pykd, 'step') )
81
        self.assertTrue( hasattr(pykd, 'symbolsPath') )
82
        self.assertTrue( hasattr(pykd, 'typedVarArray') )
83
        self.assertTrue( hasattr(pykd, 'typedVarList') )
84
        self.assertTrue( hasattr(pykd, 'trace') )
85
        self.assertTrue( hasattr(pykd, 'wrmsr') )
86

87

88
    def testOldSupportedClass( self ):
89
        """ Branch test: old API 0.0.x class must be available """
90
        self.assertTrue( hasattr(pykd, 'BaseException') )
91
        self.assertTrue( hasattr(pykd, 'MemoryException') )
92
        self.assertTrue( hasattr(pykd, 'TypeException') )
93
        self.assertTrue( hasattr(pykd, 'WaitEventException') )
94
        self.assertTrue( hasattr(pykd, 'cpuReg') )
95
        self.assertTrue( hasattr(pykd, 'disasm') )
96
        self.assertTrue( hasattr(pykd, 'ext') )
97
        self.assertTrue( hasattr(pykd, 'intBase') )
98
        self.assertTrue( hasattr(pykd, 'typeInfo') )
99
        self.assertTrue( hasattr(pykd, 'typedVar') )
100

101
    def testOldRemovedApi( self ):
102
        """ Branch test: old API 0.0.x what should be removed """
103
        self.assertFalse( hasattr(pykd, 'dbgModuleClass') )
104
        self.assertFalse( hasattr(pykd, 'dbgStackFrameClass') )
105
        self.assertFalse( hasattr(pykd, 'debugEvent') )
106
        self.assertFalse( hasattr(pykd, 'findModule') )
107
        self.assertFalse( hasattr(pykd, 'loadLinkedList') )
108
        self.assertFalse( hasattr(pykd, 'reloadModule') )    
109
        self.assertFalse( hasattr(pykd, 'windbgIn') )
110
        self.assertFalse( hasattr(pykd, 'windbgOut') )
111
        self.assertFalse( hasattr(pykd, 'bp') )
112

113
    def testNewAddededApi( self ):
114
        """ Branch test: new API 0.1.x what must be available """
115
        # self.assertTrue( hasattr(pykd, 'createDbgClient') )
116
        self.assertTrue( hasattr(pykd, 'detachProcess') )
117
        self.assertTrue( hasattr(pykd, 'diaLoadPdb') )
118
        self.assertTrue( hasattr(pykd, 'getDebuggeeType' ) )
119
        self.assertTrue( hasattr(pykd, 'getLocals' ) )
120
        self.assertTrue( hasattr(pykd, 'getExecutionStatus' ) )
121
        self.assertTrue( hasattr(pykd, 'killProcess') )
122
        self.assertTrue( hasattr(pykd, 'loadExt') )
123
        self.assertTrue( hasattr(pykd, 'loadPtrList') )
124
        self.assertTrue( hasattr(pykd, 'setExecutionStatus') )
125
        self.assertTrue( hasattr(pykd, 'waitForEvent') )
126

127
        self.assertTrue( hasattr(pykd, 'setBp') )
128
        self.assertTrue( hasattr(pykd, 'getAllBp') )
129
        self.assertTrue( hasattr(pykd, 'removeBp') )
130

131
        self.assertTrue( hasattr(pykd, 'DiaException') )
132
        self.assertTrue( hasattr(pykd, 'DiaScope') )
133
        self.assertTrue( hasattr(pykd, 'DiaSymbol') )
134
        # self.assertTrue( hasattr(pykd, 'dbgClient') )
135
        self.assertTrue( hasattr(pykd, 'din') )
136
        self.assertTrue( hasattr(pykd, 'dout') )
137
        self.assertTrue( hasattr(pykd, 'eventHandler' ) )
138
        self.assertTrue( hasattr(pykd, 'module') )
139
        self.assertTrue( hasattr(pykd, 'stackFrame') )
140

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.