Changeset 80128 in vbox for trunk/src/VBox/ValidationKit/testmanager
- Timestamp:
- Aug 5, 2019 11:06:37 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132569
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py
r80125 r80128 40 40 41 41 # Standard python imports 42 import hashlib; 43 import os; 44 import re; 45 import smtplib; 46 import subprocess; 42 47 import sys; 43 import os; 44 import hashlib; 45 import subprocess; 46 import smtplib 47 from email.mime.multipart import MIMEMultipart 48 from email.mime.text import MIMEText 49 from email.utils import COMMASPACE 48 from email.mime.multipart import MIMEMultipart; 49 from email.mime.text import MIMEText; 50 from email.utils import COMMASPACE; 50 51 51 52 if sys.version_info[0] >= 3: … … 61 62 62 63 # Test Manager imports 64 from common import utils; 63 65 from testmanager.core.db import TMDatabaseConnection; 64 66 from testmanager.core.build import BuildDataEx; … … 98 100 self.oTestCase = oTestCase; # TestCaseDataEx 99 101 self.sMainLog = ''; # The main log file. Empty string if not accessible. 102 self.sSvcLog = ''; # The VBoxSVC log file. Empty string if not accessible. 100 103 101 104 # Generate a case file name. … … 238 241 self.oSheriff.vprint(u'Error opening the "%s" log file: %s' % (oFile.sFile, oSizeOrError,)); 239 242 return sContent; 243 244 def getSvcLog(self): 245 """ 246 Tries to read the VBoxSVC log file as it typically not associated with a failing test result. 247 Note! Returns the first VBoxSVC log file we find. 248 """ 249 if not self.sSvcLog: 250 asSvcLogFiles = self.oTree.getListOfLogFilesByKind(TestResultFileData.ksKind_LogReleaseSvc); 251 if asSvcLogFiles: 252 self.sSvcLog = self.getLogFile(asSvcLogFiles[0]); 253 return self.sSvcLog; 240 254 241 255 def getScreenshotSha256(self, oFile): … … 1018 1032 ( True, ktReason_OSInstall_Sata_no_BM, 'PCHS=14128/14134/8224' ), 1019 1033 ( True, ktReason_Host_DoubleFreeHeap, 'double free or corruption' ), 1020 ( False, ktReason_Unknown_VM_Start_Error, 'VMSetError: ' ), 1034 #( False, ktReason_Unknown_VM_Start_Error, 'VMSetError: ' ), - false positives for stuff like: 1035 # "VMSetError: VD: Backend 'VBoxIsoMaker' does not support async I/O" 1021 1036 ( False, ktReason_Unknown_VM_Start_Error, 'error: failed to open session for' ), 1022 1037 ( False, ktReason_Unknown_VM_Runtime_Error, 'Console: VM runtime error: fatal=true' ), … … 1096 1111 ]; 1097 1112 1098 ## Things we search a VBoxSVC log for to figure out why something went bust. 1099 katSimpleSvcLogReasons = [ 1100 # ( Whether to stop on hit, reason tuple, needle text. ) 1101 ( False, ktReason_Unknown_VM_Crash, ') exited normally: -1073741819 (0xc0000005)' ), 1102 ( False, ktReason_Unknown_VM_Crash, ') was signalled: 11 (0xb)' ), 1103 ]; 1113 1114 def scanLog(self, asLogs, atNeedles, oCaseFile, idTestResult): 1115 """ 1116 Scans for atNeedles in sLog. 1117 1118 Returns True if a stop-on-hit neelde was found. 1119 Returns None if a no-stop reason was found. 1120 Returns False if no hit. 1121 """ 1122 fRet = False; 1123 for fStopOnHit, tReason, oNeedle in atNeedles: 1124 fMatch = False; 1125 if utils.isString(oNeedle): 1126 for sLog in asLogs: 1127 if sLog: 1128 fMatch |= sLog.find(oNeedle) > 0; 1129 else: 1130 for sLog in asLogs: 1131 if sLog: 1132 fMatch |= oNeedle.search(sLog) is not None; 1133 if fMatch: 1134 oCaseFile.noteReasonForId(tReason, idTestResult); 1135 if fStopOnHit: 1136 return True; 1137 fRet = None; 1138 return fRet; 1104 1139 1105 1140 … … 1113 1148 Investigates the current set of VM related logs. 1114 1149 """ 1115 self.dprint('investigateLogSet: log lengths: result %u, VM %u, kernel %u, vga text %u, info text %u, hard %u , SVC %u'1150 self.dprint('investigateLogSet: log lengths: result %u, VM %u, kernel %u, vga text %u, info text %u, hard %u' 1116 1151 % ( len(sResultLog if sResultLog else ''), 1117 1152 len(sVMLog if sVMLog else ''), … … 1119 1154 len(sVgaText if sVgaText else ''), 1120 1155 len(sInfoText if sInfoText else ''), 1121 len(sNtHardLog if sNtHardLog else ''), 1122 len(sSvcLog if sSvcLog else ''), )); 1156 len(sNtHardLog if sNtHardLog else ''),)); 1123 1157 1124 1158 #self.dprint(u'main.log<<<\n%s\n<<<\n' % (sResultLog,)); … … 1150 1184 return oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult, sComment = sDetails.strip()); 1151 1185 1186 fFoundSomething = False; 1187 1152 1188 # 1153 1189 # Look for linux panic. 1154 1190 # 1155 1191 if sKrnlLog is not None: 1156 for fStopOnHit, tReason, sNeedle in self.katSimpleKernelLogReasons: 1157 if sKrnlLog.find(sNeedle) > 0: 1158 oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult); 1159 if fStopOnHit: 1160 return True; 1161 fFoundSomething = True; 1192 fRet = self.scanLog([sKrnlLog,], self.katSimpleKernelLogReasons, oCaseFile, oFailedResult.idTestResult); 1193 if fRet is True: 1194 return fRet; 1195 fFoundSomething |= fRet is None; 1162 1196 1163 1197 # 1164 1198 # Loop thru the simple stuff. 1165 1199 # 1166 fFoundSomething = False; 1167 for fStopOnHit, tReason, sNeedle in self.katSimpleMainAndVmLogReasons: 1168 if sResultLog.find(sNeedle) > 0 or (sVMLog is not None and sVMLog.find(sNeedle) > 0): 1169 oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult); 1170 if fStopOnHit: 1171 return True; 1172 fFoundSomething = True; 1200 fRet = self.scanLog([sResultLog, sVMLog], self.katSimpleMainAndVmLogReasons, oCaseFile, oFailedResult.idTestResult); 1201 if fRet is True: 1202 return fRet; 1203 fFoundSomething |= fRet is None; 1173 1204 1174 1205 # Continue with vga text. 1175 1206 if sVgaText: 1176 for fStopOnHit, tReason, sNeedle in self.katSimpleVgaTextReasons: 1177 if sVgaText.find(sNeedle) > 0: 1178 oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult); 1179 if fStopOnHit: 1180 return True; 1181 fFoundSomething = True; 1182 _ = sInfoText; 1207 fRet = self.scanLog([sVgaText,], self.katSimpleVgaTextReasons, oCaseFile, oFailedResult.idTestResult); 1208 if fRet is True: 1209 return fRet; 1210 fFoundSomething |= fRet is None; 1183 1211 1184 1212 # Continue with screen hashes. … … 1193 1221 # Check VBoxHardening.log. 1194 1222 if sNtHardLog is not None: 1195 for fStopOnHit, tReason, sNeedle in self.katSimpleVBoxHardeningLogReasons: 1196 if sNtHardLog.find(sNeedle) > 0: 1197 oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult); 1198 if fStopOnHit: 1199 return True; 1200 fFoundSomething = True; 1201 1202 # Check VBoxSVC.log. 1203 if sSvcLog is not None: 1204 for fStopOnHit, tReason, sNeedle in self.katSimpleSvcLogReasons: 1205 if sSvcLog.find(sNeedle) > 0: 1206 oCaseFile.noteReasonForId(tReason, oFailedResult.idTestResult); 1207 if fStopOnHit: 1208 return True; 1209 fFoundSomething = True; 1223 fRet = self.scanLog([sNtHardLog,], self.katSimpleVBoxHardeningLogReasons, oCaseFile, oFailedResult.idTestResult); 1224 if fRet is True: 1225 return fRet; 1226 fFoundSomething |= fRet is None; 1210 1227 1211 1228 # … … 1255 1272 sVgaText = None; 1256 1273 sInfoText = None; 1257 sSvcLog = None;1258 1274 for oFile in oFailedResult.aoFiles: 1259 1275 if oFile.sKind == TestResultFileData.ksKind_LogReleaseVm: … … 1268 1284 sScreenHash = None; 1269 1285 sNtHardLog = None; 1270 sSvcLog = None;1271 1286 sVMLog = oCaseFile.getLogFile(oFile); 1272 1287 else: … … 1278 1293 elif oFile.sKind == TestResultFileData.ksKind_InfoCollection: 1279 1294 sInfoText = oCaseFile.getLogFile(oFile); 1280 elif oFile.sKind == TestResultFileData.ksKind_LogReleaseSvc:1281 sSvcLog = oCaseFile.getLogFile(oFile);1282 1295 elif oFile.sKind == TestResultFileData.ksKind_ScreenshotFailure: 1283 1296 sScreenHash = oCaseFile.getScreenshotSha256(oFile); … … 1293 1306 1294 1307 return None; 1308 1309 ## Things we search a VBoxSVC log for to figure out why something went bust. 1310 katSimpleSvcLogReasons = [ 1311 # ( Whether to stop on hit, reason tuple, needle text. ) 1312 ( False, ktReason_Unknown_VM_Crash, re.compile(r'Reaper.* exited normally: -1073741819 \(0xc0000005\)') ), 1313 ( False, ktReason_Unknown_VM_Crash, re.compile(r'Reaper.* was signalled: 11 \(0xb\)') ), 1314 ]; 1315 1316 def investigateSvcLogForVMRun(self, oCaseFile, sSvcLog): 1317 """ 1318 Check the VBoxSVC log for a single VM run. 1319 """ 1320 if sSvcLog: 1321 fRet = self.scanLog([sSvcLog,], self.katSimpleSvcLogReasons, oCaseFile, oCaseFile.oTree.idTestResult); 1322 if fRet is True or fRet is None: 1323 return True; 1324 return False; 1295 1325 1296 1326 … … 1401 1431 self.vprint(u'TODO: Cannot place idTestResult=%u - %s' % (oFailedResult.idTestResult, oFailedResult.sName,)); 1402 1432 self.dprint(u'%s + %s <<\n%s\n<<' % (oFailedResult.tsCreated, oFailedResult.tsElapsed, sResultLog,)); 1433 1434 # 1435 # Check VBoxSVC.log for VM crashes if inconclusive on single VM runs. 1436 # 1437 if fSingleVM and len(oCaseFile.dReasonForResultId) < len(aoFailedResults): 1438 self.dprint(u'Got %u out of %u - checking VBoxSVC.log...' 1439 % (len(oCaseFile.dReasonForResultId), len(aoFailedResults))); 1440 if self.investigateSvcLogForVMRun(oCaseFile, oCaseFile.getSvcLog()): 1441 return self.caseClosed(oCaseFile); 1403 1442 1404 1443 # -
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r79919 r80128 220 220 Get a list of test results instances actually contributing to cErrors. 221 221 222 Returns a list of TestResultDataEx instance from this tree. (shared!)222 Returns a list of TestResultDataEx instances from this tree. (shared!) 223 223 """ 224 224 # Check each child (if any). … … 233 233 if self.cErrors > cChildErrors: 234 234 aoRet.append(self); 235 236 return aoRet; 237 238 def getListOfLogFilesByKind(self, asKinds): 239 """ 240 Get a list of test results instances actually contributing to cErrors. 241 242 Returns a list of TestResultFileDataEx instances from this tree. (shared!) 243 """ 244 aoRet = []; 245 246 # Check the children first. 247 for oChild in self.aoChildren: 248 aoRet.extend(oChild.getListOfLogFilesByKind(asKinds)); 249 250 # Check our own files next. 251 for oFile in self.aoFiles: 252 if oFile.sKind in asKinds: 253 aoRet.append(oFile); 235 254 236 255 return aoRet; … … 402 421 ksKind_LogDebugVm = 'log/debug/vm'; 403 422 ksKind_LogReleaseSvc = 'log/release/svc'; 404 ksKind_Log RebugSvc = 'log/debug/svc';423 ksKind_LogDebugSvc = 'log/debug/svc'; 405 424 ksKind_LogReleaseClient = 'log/release/client'; 406 425 ksKind_LogDebugClient = 'log/debug/client'; … … 427 446 ksKind_LogDebugVm, 428 447 ksKind_LogReleaseSvc, 429 ksKind_Log RebugSvc,448 ksKind_LogDebugSvc, 430 449 ksKind_LogReleaseClient, 431 450 ksKind_LogDebugClient,
Note:
See TracChangeset
for help on using the changeset viewer.