Changeset 87231 in vbox for trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
- Timestamp:
- Jan 13, 2021 10:33:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
r87227 r87231 102 102 self.fPae = fPae; 103 103 self.sGuestAdditionsIso = sGuestAdditionsIso; 104 self._asTestBuildDirs = oTstDrv.asTestBuildDirs; 105 self._sTestBuild = None; 106 self._sVBoxInstaller = ""; 104 self.asTestBuildDirs = oTstDrv.asTestBuildDirs; 105 self.sVBoxInstaller = ""; 107 106 self.asVirtModesSup = ['hwvirt-np',]; 108 107 self.asParavirtModesSup = ['default',]; 109 110 @property111 def asTestBuildDirs(self):112 return self._asTestBuildDirs;113 114 @asTestBuildDirs.setter115 def asTestBuildDirs(self, value):116 self._asTestBuildDirs = value;117 self.sTestBuild = self._findFile(self._sVBoxInstaller, value);118 if not self.sTestBuild:119 raise base.GenError("VirtualBox install package not found");120 121 @property122 def sTestBuild(self):123 return self._sTestBuild;124 125 @sTestBuild.setter126 def sTestBuild(self, value):127 if not os.path.exists(value):128 raise base.GenError("The %s does not exist" % (value,));129 self._sTestBuild = value;130 108 131 109 def _findFile(self, sRegExp, asTestBuildDirs): … … 674 652 tdAutostartOs.__init__(self, oSet, oTstDrv, sVmName, sKind, sHdd, eNic0Type, cMbRam, \ 675 653 cCpus, fPae, sGuestAdditionsIso); 676 self._sVBoxInstaller = '^VirtualBox-.*\\.run$'; 654 try: self.sVBoxInstaller = '^VirtualBox-.*\\.run$'; 655 except: pass; 677 656 return; 678 657 … … 757 736 Install VirtualBox in the guest. 758 737 """ 759 if self.sTestBuild is None:760 return False;761 738 reporter.testStart('Install Virtualbox into the guest VM'); 762 reporter.log("Virtualbox install file: %s" % os.path.basename(self.sTestBuild)); 763 fRc = self.uploadFile(oGuestSession, self.sTestBuild, 764 '/tmp/' + os.path.basename(self.sTestBuild)); 739 sTestBuild = self._findFile(self.sVBoxInstaller, self.asTestBuildDirs); 740 reporter.log("Virtualbox install file: %s" % os.path.basename(sTestBuild)); 741 fRc = sTestBuild is not None; 742 if fRc: 743 fRc = self.uploadFile(oGuestSession, sTestBuild, 744 '/tmp/' + os.path.basename(sTestBuild)); 745 else: 746 reporter.error("VirtualBox install package is not defined"); 747 765 748 if not fRc: 766 749 reporter.error('Upload the vbox installer into guest VM failed'); … … 770 753 30 * 1000, '/usr/bin/sudo', 771 754 ['/usr/bin/sudo', '/bin/chmod', '755', 772 '/tmp/' + os.path.basename(s elf.sTestBuild)],755 '/tmp/' + os.path.basename(sTestBuild)], 773 756 False, True); 774 757 if not fRc: … … 778 761 240 * 1000, '/usr/bin/sudo', 779 762 ['/usr/bin/sudo', 780 '/tmp/' + os.path.basename(s elf.sTestBuild),],763 '/tmp/' + os.path.basename(sTestBuild),], 781 764 False, True); 782 765 if not fRc: … … 947 930 tdAutostartOs.__init__(self, oSet, oTstDrv, sVmName, sKind, sHdd, eNic0Type, cMbRam, \ 948 931 cCpus, fPae, sGuestAdditionsIso); 949 self._sVBoxInstaller = '^VirtualBox-.*\\.(exe|msi)$'; 932 try: self.sVBoxInstaller = '^VirtualBox-.*\\.(exe|msi)$'; 933 except: pass; 950 934 return; 951 935 … … 1071 1055 Install VirtualBox in the guest. 1072 1056 """ 1073 if self.sTestBuild is None:1074 return False;1075 1057 reporter.testStart('Install Virtualbox into the guest VM'); 1076 reporter.log("Virtualbox install file: %s" % os.path.basename(self.sTestBuild));1077 1058 # Used windows image already contains the C:\Temp 1078 fRc = self.uploadFile(oGuestSession, self.sTestBuild, 1079 'C:\\Temp\\' + os.path.basename(self.sTestBuild)); 1059 sTestBuild = self._findFile(self.sVBoxInstaller, self.asTestBuildDirs); 1060 reporter.log("Virtualbox install file: %s" % os.path.basename(sTestBuild)); 1061 fRc = sTestBuild is not None; 1062 if fRc: 1063 fRc = self.uploadFile(oGuestSession, sTestBuild, 1064 'C:\\Temp\\' + os.path.basename(sTestBuild)); 1065 else: 1066 reporter.error("VirtualBox install package is not defined"); 1067 1080 1068 if not fRc: 1081 1069 reporter.error('Upload the installing into guest VM failed'); 1082 1070 else: 1083 if s elf.sTestBuild.endswith('.msi'):1071 if sTestBuild.endswith('.msi'): 1084 1072 sLogFile = 'C:/Temp/VBoxInstallLog.txt'; 1085 1073 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox', 1086 1074 600 * 1000, 'C:\\Windows\\System32\\msiexec.exe', 1087 1075 ['msiexec', '/quiet', '/norestart', '/i', 1088 'C:\\Temp\\' + os.path.basename(s elf.sTestBuild),1076 'C:\\Temp\\' + os.path.basename(sTestBuild), 1089 1077 '/lv', sLogFile], 1090 1078 False, True); … … 1094 1082 sLogFile = 'C:/Temp/Virtualbox/VBoxInstallLog.txt'; 1095 1083 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox', 1096 600 * 1000, 'C:\\Temp\\' + os.path.basename(s elf.sTestBuild),1097 ['C:\\Temp\\' + os.path.basename(s elf.sTestBuild), '-vvvv',1084 600 * 1000, 'C:\\Temp\\' + os.path.basename(sTestBuild), 1085 ['C:\\Temp\\' + os.path.basename(sTestBuild), '-vvvv', 1098 1086 '--silent', '--logging', 1099 1087 '--msiparams', 'REBOOT=ReallySuppress'], … … 1304 1292 ## @todo r=bird: The --test-build-dirs option as primary way to get the installation files to test 1305 1293 ## is not an acceptable test practice as we don't know wtf you're testing. See defect for more. 1306 self.asTestBuildDirs = os.path.join(self.sScratchPath, 'bin');1294 self.asTestBuildDirs = [os.path.join(self.sScratchPath, 'bin'),]; 1307 1295 self.sGuestAdditionsIso = None; #'D:/AlexD/TestBox/TestAdditionalFiles/VBoxGuestAdditions_6.1.2.iso'; 1308 1296 oSet = vboxtestvms.TestVmSet(self.oTestVmManager, acCpus = [2], asVirtModes = ['hwvirt-np',], fIgnoreSkippedVm = True);
Note:
See TracChangeset
for help on using the changeset viewer.