Changeset 70812 in vbox for trunk/src/VBox/ValidationKit/tests/api/tdTreeDepth1.py
- Timestamp:
- Jan 30, 2018 5:46:55 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdTreeDepth1.py
r69111 r70812 42 42 43 43 # Validation Kit imports. 44 from testdriver import base 44 45 from testdriver import reporter 45 from testdriver import vbox46 46 from testdriver import vboxcon 47 47 48 48 49 class tdTreeDepth1(vbox.TestDriver):49 class SubTstDrvTreeDepth1(base.SubTestDriverBase): 50 50 """ 51 Medium and Snapshot Tree Depth Test #1.51 Sub-test driver for Medium and Snapshot Tree Depth Test #1. 52 52 """ 53 53 54 def __init__(self): 55 vbox.TestDriver.__init__(self) 56 self.asRsrcs = None 54 def __init__(self, oTstDrv): 55 base.SubTestDriverBase.__init__(self, 'tree-depth', oTstDrv) 57 56 58 59 # 60 # Overridden methods. 61 # 62 63 def actionConfig(self): 57 def testIt(self): 64 58 """ 65 Import the API. 66 """ 67 if not self.importVBoxApi(): 68 return False 69 return True 70 71 def actionExecute(self): 72 """ 73 Execute the testcase. 59 Execute the sub-testcase. 74 60 """ 75 61 return self.testMediumTreeDepth() \ … … 87 73 88 74 try: 89 oVM = self. createTestVM('test-medium', 1, None, 4)75 oVM = self.oTstDrv.createTestVM('test-medium', 1, None, 4) 90 76 assert oVM is not None 91 77 92 78 # create chain with 300 disk images (medium tree depth limit) 93 79 fRc = True 94 oSession = self.o penSession(oVM)80 oSession = self.oTstDrv.openSession(oVM) 95 81 for i in range(1, 301): 96 sHddPath = os.path.join(self. sScratchPath, 'Test' + str(i) + '.vdi')82 sHddPath = os.path.join(self.oTstDrv.sScratchPath, 'Test' + str(i) + '.vdi') 97 83 if i is 1: 98 84 oHd = oSession.createBaseHd(sHddPath, cb=1024*1024) … … 112 98 reporter.log('unregistering VM') 113 99 oVM.unregister(vboxcon.CleanupMode_DetachAllReturnNone) 114 oVBox = self.o VBoxMgr.getVirtualBox()100 oVBox = self.oTstDrv.oVBoxMgr.getVirtualBox() 115 101 reporter.log('opening VM %s, testing config reading' % (sSettingsFile)) 116 102 oVM = oVBox.openMachine(sSettingsFile) … … 129 115 130 116 try: 131 oVM = self. createTestVM('test-snap', 1, None, 4)117 oVM = self.oTstDrv.createTestVM('test-snap', 1, None, 4) 132 118 assert oVM is not None 133 119 134 120 # modify the VM config, create and attach empty HDD 135 oSession = self.o penSession(oVM)136 sHddPath = os.path.join(self. sScratchPath, 'TestSnapEmpty.vdi')121 oSession = self.oTstDrv.openSession(oVM) 122 sHddPath = os.path.join(self.oTstDrv.sScratchPath, 'TestSnapEmpty.vdi') 137 123 fRc = True 138 124 fRc = fRc and oSession.createAndAttachHd(sHddPath, cb=1024*1024, sController='SATA Controller', fImmutable=False) … … 148 134 reporter.log('unregistering VM') 149 135 oVM.unregister(vboxcon.CleanupMode_DetachAllReturnNone) 150 oVBox = self.o VBoxMgr.getVirtualBox()136 oVBox = self.oTstDrv.oVBoxMgr.getVirtualBox() 151 137 reporter.log('opening VM %s, testing config reading' % (sSettingsFile)) 152 138 oVM = oVBox.openMachine(sSettingsFile) … … 160 146 161 147 if __name__ == '__main__': 162 sys.exit(tdTreeDepth1().main(sys.argv)) 148 sys.path.append(os.path.dirname(os.path.abspath(__file__))) 149 from tdApi1 import tdApi1 150 oTstDrv = tdApi1() 151 oTstDrv.addSubTestDriver(SubTstDrvTreeDepth1(oTstDrv)) 152 sys.exit(oTstDrv.main(sys.argv)) 163 153
Note:
See TracChangeset
for help on using the changeset viewer.