Changeset 79908 in vbox
- Timestamp:
- Jul 20, 2019 3:56:15 AM (6 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r79279 r79908 1352 1352 return time.time(); 1353 1353 1354 1355 1354 def timestampNano(): 1356 1355 """ … … 1376 1375 return long(_winFloatTime()); 1377 1376 return long(time.time()); 1377 1378 def secondsSinceUnixEpoch(): 1379 """ 1380 Returns unix time, floating point second count since 1970-01-01T00:00:00Z 1381 """ 1382 ## ASSUMES This returns unix epoch time on all systems we care about... 1383 return time.time(); 1378 1384 1379 1385 def getTimePrefix(): -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r79245 r79908 2958 2958 # 2959 2959 2960 def txsConnectViaTcp(self, cMsTimeout = 10*60000, sIpAddr = None, sMacAddr = None,fNatForwardingForTxs = False):2960 def txsConnectViaTcp(self, cMsTimeout = 10*60000, sIpAddr = None, fNatForwardingForTxs = False): 2961 2961 """ 2962 2962 Connects to the TXS using TCP/IP as transport. If no IP or MAC is … … 2968 2968 fReversedSetup = False; 2969 2969 fUseNatForTxs = False; 2970 sMacAddr = None; 2971 oIDhcpServer = None; 2970 2972 if sIpAddr is None: 2971 2973 try: 2972 oNic = self.oVM.getNetworkAdapter(0); 2973 if oNic.attachmentType == vboxcon.NetworkAttachmentType_NAT: 2974 oNic = self.oVM.getNetworkAdapter(0); 2975 enmAttachmentType = oNic.attachmentType; 2976 if enmAttachmentType == vboxcon.NetworkAttachmentType_NAT: 2974 2977 fUseNatForTxs = True; 2978 elif enmAttachmentType == vboxcon.NetworkAttachmentType_HostOnly and not sIpAddr: 2979 # Get the MAC address and find the DHCP server. 2980 sMacAddr = oNic.MACAddress; 2981 sHostOnlyNIC = oNic.hostOnlyInterface; 2982 oIHostOnlyIf = self.oVBox.host.findHostNetworkInterfaceByName(sHostOnlyNIC); 2983 sHostOnlyNet = oIHostOnlyIf.networkName; 2984 oIDhcpServer = self.oVBox.findDHCPServerByNetworkName(sHostOnlyNet); 2975 2985 except: 2976 2986 reporter.errorXcpt(); 2977 2987 return None; 2988 2978 2989 if fUseNatForTxs: 2979 2990 fReversedSetup = not fNatForwardingForTxs; … … 2982 2993 # Kick off the task. 2983 2994 try: 2984 oTask = TxsConnectTask(self, cMsTimeout, sIpAddr, sMacAddr, fReversedSetup,2995 oTask = TxsConnectTask(self, cMsTimeout, sIpAddr, sMacAddr, oIDhcpServer, fReversedSetup, 2985 2996 fnProcessEvents = self.oTstDrv.processPendingEvents); 2986 2997 except: … … 3052 3063 3053 3064 3054 def __init__(self, oSession, cMsTimeout, sIpAddr, sMacAddr, fReversedSetup, fnProcessEvents = None):3055 TdTaskBase.__init__(self, utils.getCallerName() );3065 def __init__(self, oSession, cMsTimeout, sIpAddr, sMacAddr, oIDhcpServer, fReversedSetup, fnProcessEvents = None): 3066 TdTaskBase.__init__(self, utils.getCallerName(), fnProcessEvents = fnProcessEvents); 3056 3067 self.cMsTimeout = cMsTimeout; 3057 3068 self.fnProcessEvents = fnProcessEvents; … … 3059 3070 self.sNextIpAddr = None; 3060 3071 self.sMacAddr = sMacAddr; 3072 self.oIDhcpServer = oIDhcpServer; 3061 3073 self.fReversedSetup = fReversedSetup; 3062 3074 self.oVBoxEventHandler = None; 3063 3075 self.oTxsSession = None; 3064 3076 3065 # Skip things we don't implement. 3066 if sMacAddr is not None: 3067 reporter.error('TxsConnectTask does not implement sMacAddr yet'); 3077 # Check that the input makes sense: 3078 if (sMacAddr is None) != (oIDhcpServer is None) \ 3079 or (sMacAddr and fReversedSetup) \ 3080 or (sMacAddr and sIpAddr): 3081 reporter.error('TxsConnectTask sMacAddr=%s oIDhcpServer=%s sIpAddr=%s fReversedSetup=%s' 3082 % (sMacAddr, oIDhcpServer, sIpAddr, fReversedSetup,)); 3068 3083 raise base.GenError(); 3069 3084 … … 3100 3115 if sIpAddr is not None: 3101 3116 self._setIp(sIpAddr); 3117 3118 # 3119 # If the network adapter of the VM is host-only we can talk poll IDHCPServer 3120 # for the guest IP, allowing us to detect it for VMs without guest additions. 3121 # This will when we're polled. 3122 # 3123 if sMacAddr is not None: 3124 assert self.oIDhcpServer is not None; 3125 3126 3102 3127 # end __init__ 3103 3128 … … 3203 3228 self._deregisterEventHandler(); 3204 3229 return True; 3230 3231 def _pollDhcpServer(self): 3232 """ 3233 Polls the DHCP server by MAC address in host-only setups. 3234 """ 3235 3236 if self.sIpAddr: 3237 return False; 3238 3239 if self.oIDhcpServer is None or not self.sMacAddr: 3240 return False; 3241 3242 try: 3243 (sIpAddr, sState, secIssued, secExpire) = self.oIDhcpServer.findLeaseByMAC(self.sMacAddr, 0); 3244 except: 3245 reporter.log2Xcpt('sMacAddr=%s' % (self.sMacAddr,)); 3246 return False; 3247 3248 secNow = utils.secondsSinceUnixEpoch(); 3249 reporter.log2('dhcp poll: secNow=%s secExpire=%s secIssued=%s sState=%s sIpAddr=%s' 3250 % (secNow, secExpire, secIssued, sState, sIpAddr,)); 3251 if secNow > secExpire or sState != 'acked' or not sIpAddr: 3252 return False; 3253 3254 reporter.log('dhcp poll: sIpAddr=%s secExpire=%s (%s TTL) secIssued=%s (%s ago)' 3255 % (sIpAddr, secExpire, secExpire - secNow, secIssued, secNow - secIssued,)); 3256 self._setIp(sIpAddr); 3257 return True; 3258 3259 # 3260 # Task methods 3261 # 3262 3263 def pollTask(self, fLocked = False): 3264 """ 3265 Overridden pollTask method. 3266 """ 3267 self._pollDhcpServer(); 3268 return TdTaskBase.pollTask(self, fLocked); 3205 3269 3206 3270 # -
trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py
r79475 r79908 61 61 ## @name VM option flags (OR together). 62 62 ## @{ 63 kfUbuntuAvx2Crash = 0x0001; ## < Disables AVX2 as ubuntu 16.04 think it means AVX512 is available and compiz crashes. 63 kfUbuntuAvx2Crash = 0x0001; ##< Disables AVX2 as ubuntu 16.04 think it means AVX512 is available and compiz crashes. 64 kfNoGAs = 0x0002; ##< No guest additions installation possible. 64 65 kfIdeIrqDelay = 0x1000; 65 66 kfUbuntuNewAmdBug = 0x2000; … … 113 114 # 114 115 if self.fOptInstallAdditions: 115 try: oIUnattended.installGuestAdditions = True; 116 except: return reporter.errorXcpt(); 117 try: oIUnattended.additionsIsoPath = oTestDrv.getGuestAdditionsIso(); 118 except: return reporter.errorXcpt(); 119 oTestDrv.processPendingEvents(); 116 if (self.fInstVmFlags & self.kfNoGAs) == 0: 117 try: oIUnattended.installGuestAdditions = True; 118 except: return reporter.errorXcpt(); 119 try: oIUnattended.additionsIsoPath = oTestDrv.getGuestAdditionsIso(); 120 except: return reporter.errorXcpt(); 121 oTestDrv.processPendingEvents(); 122 else: 123 reporter.log("Warning! Ignoring request to install Guest Additions as kfNoGAs is set!"); 120 124 121 125 return True; … … 405 409 ## @todo ubuntu 17.10, 18.04 & 18.10 do not work. They misses all the the build tools (make, gcc, perl, ++) 406 410 ## and has signed kmods: 407 ## @todo Mark these as no-install-additions for the time being? 408 #UnattendedVm(oSet, 'tst-ubuntu-17.10-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-17.10-desktop-amd64.iso'), # >4.0Gib 409 #UnattendedVm(oSet, 'tst-ubuntu-18.04-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-18.04-desktop-amd64.iso'), # >5.7GiB 410 #UnattendedVm(oSet, 'tst-ubuntu-18.10-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-18.10-desktop-amd64.iso'), 411 UnattendedVm(oSet, 'tst-ubuntu-17.10-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-17.10-desktop-amd64.iso', # >4.0Gib 412 UnattendedVm.kfNoGAs), 413 UnattendedVm(oSet, 'tst-ubuntu-18.04-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-18.04-desktop-amd64.iso', # >5.7GiB 414 UnattendedVm.kfNoGAs), 415 # 18.10 hangs reading install DVD during "starting partitioner..." 416 #UnattendedVm(oSet, 'tst-ubuntu-18.10-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-18.10-desktop-amd64.iso', 417 # UnattendedVm.kfNoGAs), 418 UnattendedVm(oSet, 'tst-ubuntu-19.04-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-19.04-desktop-amd64.iso', # >5.6GiB 419 UnattendedVm.kfNoGAs), 411 420 ]); 412 421 self.oTestVmSet = oSet;
Note:
See TracChangeset
for help on using the changeset viewer.