- Timestamp:
- Mar 15, 2023 3:53:43 PM (21 months ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r98962 r98992 2509 2509 sIommuType = 'none', 2510 2510 sDvdControllerType = 'IDE Controller', 2511 sCom1RawFile = None): 2511 sCom1RawFile = None, 2512 fSecureBoot = False, 2513 sUefiMokPathPrefix = None): 2512 2514 """ 2513 2515 Creates a test VM with a immutable HD from the test resources. … … 2567 2569 elif fRc and sFirmwareType == 'efi': 2568 2570 fRc = oSession.setFirmwareType(vboxcon.FirmwareType_EFI); 2571 if fRc and self.fpApiVer >= 7.0 and fSecureBoot: 2572 fRc = oSession.enableSecureBoot(fSecureBoot, sUefiMokPathPrefix); 2569 2573 if fRc and self.fEnableDebugger: 2570 2574 fRc = oSession.setExtraData('VBoxInternal/DBGC/Enabled', '1'); -
trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py
r98655 r98992 973 973 sIommuType = 'none', # type: str 974 974 sHddControllerType = 'IDE Controller', # type: str 975 sDvdControllerType = 'IDE Controller' # type: str 975 sDvdControllerType = 'IDE Controller', # type: str 976 fSecureBoot = False, # type: bool 977 sUefiMokPathPrefix = None # type: str 976 978 ): 977 979 self.oSet = oSet; … … 1001 1003 self.fCom1RawFile = False; 1002 1004 1005 self.fSecureBoot = fSecureBoot; 1006 self.sUefiMokPathPrefix = sUefiMokPathPrefix; 1007 1003 1008 self.fSnapshotRestoreCurrent = False; # Whether to restore execution on the current snapshot. 1004 1009 self.fSkip = False; # All VMs are included in the configured set by default. … … 1198 1203 sChipsetType = self.sChipsetType, 1199 1204 sIommuType = self.sIommuType, 1200 sCom1RawFile = self.sCom1RawFile if self.fCom1RawFile else None 1205 sCom1RawFile = self.sCom1RawFile if self.fCom1RawFile else None, 1206 fSecureBoot = self.fSecureBoot, 1207 sUefiMokPathPrefix = self.sUefiMokPathPrefix 1201 1208 ); 1202 1209 … … 1950 1957 sKind = 'Oracle_64', acCpusSup = range(1, 33), fIoApic = True, sFirmwareType = 'efi', 1951 1958 asParavirtModesSup = [g_ksParavirtProviderKVM,]), 1959 TestVm('tst-ol-8_1-64-efi-sb', kfGrpStdSmoke, sHd = '6.1/efi/ol-8_1-efi-amd64-2.vdi', 1960 sKind = 'Oracle_64', acCpusSup = range(1, 33), fIoApic = True, sFirmwareType = 'efi', 1961 asParavirtModesSup = [g_ksParavirtProviderKVM,], fSecureBoot = True, sUefiMokPathPrefix = '7.0/mok/vbox-test-MOK'), 1952 1962 TestVm('tst-ol-6u2-32', kfGrpStdSmoke, sHd = '6.1/ol-6u2-x86.vdi', 1953 1963 sKind = 'Oracle', acCpusSup = range(1, 33), fIoApic = True, … … 1956 1966 sKind = 'Ubuntu_64', acCpusSup = range(1, 33), fIoApic = True, sFirmwareType = 'efi', 1957 1967 asParavirtModesSup = [g_ksParavirtProviderKVM,]), 1968 TestVm('tst-ubuntu-15_10-64-efi-sb', kfGrpStdSmoke, sHd = '6.1/efi/ubuntu-15_10-efi-amd64-3.vdi', 1969 sKind = 'Ubuntu_64', acCpusSup = range(1, 33), fIoApic = True, sFirmwareType = 'efi', 1970 asParavirtModesSup = [g_ksParavirtProviderKVM,], fSecureBoot = True, sUefiMokPathPrefix = '7.0/mok/vbox-test-MOK'), 1958 1971 # Note: Deprecated / buggy; use the one in the 6.1 folder. 1959 1972 #TestVm('tst-ubuntu-15_10-64-efi', kfGrpStdSmoke, sHd = '4.2/efi/ubuntu-15_10-efi-amd64.vdi', -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r98655 r98992 45 45 import socket; 46 46 import sys; 47 import uuid; 47 48 48 49 # Validation Kit imports. … … 1229 1230 reporter.log('set firmwareType=%s for "%s"' % (eType, self.sName)); 1230 1231 self.oTstDrv.processPendingEvents(); 1232 return fRc; 1233 1234 def enableSecureBoot(self, fEnable, sUefiMokPathPrefix = None): 1235 """ 1236 Enables or disables Secure Boot. Error information is logged. 1237 """ 1238 1239 if self.fpApiVer >= 7.0: 1240 1241 fRc = True; 1242 try: 1243 self.o.machine.nonVolatileStore.initUefiVariableStore(0); 1244 1245 # Enroll necessary keys and signatures in case if Secure Boot needs to be turned ON. 1246 if fEnable: 1247 self.o.machine.nonVolatileStore.uefiVariableStore.enrollDefaultMsSignatures(); 1248 self.o.machine.nonVolatileStore.uefiVariableStore.enrollOraclePlatformKey(); 1249 if sUefiMokPathPrefix is not None: 1250 sFullName = self.oTstDrv.getFullResourceName(sUefiMokPathPrefix) + '.der'; 1251 with open(sFullName, "rb") as f: 1252 self.o.machine.nonVolatileStore.uefiVariableStore.addSignatureToMok(bytearray(f.read()), uuid.uuid4().hex, vboxcon.SignatureType_X509); 1253 1254 self.o.machine.nonVolatileStore.uefiVariableStore.secureBootEnabled = fEnable; 1255 except: 1256 reporter.errorXcpt('failed to change Secure Boot to %s for "%s"' % (fEnable, self.sName)); 1257 fRc = False; 1258 else: 1259 reporter.log('changed Secure Boot to %s for "%s"' % (fEnable, self.sName)); 1260 self.oTstDrv.processPendingEvents(); 1261 1262 else: 1263 reporter.log('Secure Boot is only supported for API 7.0 or newer'); 1264 fRc = False; 1265 1231 1266 return fRc; 1232 1267 -
trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
r98872 r98992 83 83 84 84 # Wether to reboot guest after Guest Additions installation. 85 self.fReb botAfterInstall = True;85 self.fRebootAfterInstall = True; 86 86 87 87 self.addSubTestDriver(SubTstDrvAddGuestCtrl(self)); … … 119 119 120 120 elif asArgs[iArg] == '--no-reboot-after-install': 121 self.fReb botAfterInstall = False;121 self.fRebootAfterInstall = False; 122 122 reporter.log('Guest will not be rebooted after Guest Additions installation, ' + 123 123 'kernel modules and user services should be reloaded automatically without reboot'); … … 491 491 # The actual install. 492 492 # Also tell the installer to produce the appropriate log files. 493 # 493 494 # Deploy signing keys into guest if VM has Secure Boot enabled. 495 if oTestVm.fSecureBoot: 496 reporter.log('Deploying Secure Boot signing keys to the guest'); 497 fRc = self.txsMkDirPath(oSession, oTxsSession, '/var/lib/shim-signed/mok'); 498 if fRc: 499 fRc = self.txsUploadFile(oSession, oTxsSession, 500 self.getFullResourceName(oTestVm.sUefiMokPathPrefix) + '.der', 501 '/var/lib/shim-signed/mok/MOK.der') 502 if fRc: 503 fRc = self.txsUploadFile(oSession, oTxsSession, 504 self.getFullResourceName(oTestVm.sUefiMokPathPrefix) + '.priv', 505 '/var/lib/shim-signed/mok/MOK.priv') 506 if fRc and oTxsSession.isSuccess(): 507 pass 508 else: 509 reporter.testFailure('Unable to deploy Secure Boot signing keys to the guest'); 510 494 511 # Make sure to add "--nox11" to the makeself wrapper in order to not getting any blocking 495 512 # xterm window spawned. … … 498 515 (self.getGuestSystemShell(oTestVm), 499 516 '${CDROM}/%s/VBoxLinuxAdditions.run' % self.sGstPathGaPrefix, '--nox11')); 500 if not fRc: 501 iRc = self.getAdditionsInstallerResult(oTxsSession); 502 # Check for rc == 0 just for completeness. 503 if iRc in (0, 2): # Can happen if the GA installer has detected older VBox kernel modules running and needs a reboot. 504 reporter.log('Guest has old(er) VBox kernel modules still running; requires a reboot'); 505 fRc = True; 517 if fRc and oTxsSession.isSuccess(): 518 reporter.log('Installation completed'); 519 else: 520 # Guest Additions installer which requires guest reboot after installation might return 521 # special exit code which can indicate that all was installed, but kernel modules were 522 # not rebooted. Handle this case here. 523 if self.fRebootAfterInstall: 524 iRc = self.getAdditionsInstallerResult(oTxsSession); 525 # Check for rc == 0 just for completeness. 526 if iRc in (0, 2): # Can happen if the GA installer has detected older VBox kernel modules running and needs a reboot. 527 reporter.log('Guest has old(er) VBox kernel modules still running; requires a reboot'); 528 fRc = True; 506 529 507 530 if not fRc: … … 519 542 # Do the final reboot to get the just installed Guest Additions up and running. 520 543 if fRc: 521 if self.fReb botAfterInstall:544 if self.fRebootAfterInstall: 522 545 reporter.testStart('Rebooting guest w/ updated Guest Additions active'); 523 546 (fRc, oTxsSession) = self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, cMsTimeout = 15 * 60 * 1000); … … 530 553 (self.getGuestSystemShell(oTestVm), 531 554 '/sbin/rcvboxadd', 'status-kernel')); 532 iRc = self.getAdditionsInstallerResult(oTxsSession); 533 if fRc and iRc == 0: 555 if fRc and oTxsSession.isSuccess(): 534 556 fRc = self.txsRunTest(oTxsSession, 'Check Guest Additions user services status', 5 * 60 * 1000, 535 557 self.getGuestSystemShell(oTestVm), 536 558 (self.getGuestSystemShell(oTestVm), 537 559 '/sbin/rcvboxadd', 'status-user')); 538 iRc = self.getAdditionsInstallerResult(oTxsSession); 539 if fRc and iRc == 0: 560 if fRc and oTxsSession.isSuccess(): 540 561 pass; 541 562 else:
Note:
See TracChangeset
for help on using the changeset viewer.