- Timestamp:
- May 22, 2020 7:41:19 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
r84429 r84441 34 34 import sys; 35 35 import uuid; 36 if sys.version_info[0] >= 3: 37 from io import StringIO as StringIO; # pylint: disable=import-error,no-name-in-module,useless-import-alias 38 else: 39 from StringIO import StringIO as StringIO; # pylint: disable=import-error,no-name-in-module,useless-import-alias 36 40 37 41 # Only the main script needs to modify the path. … … 200 204 if oTestVm.isLinux(): 201 205 reporter.testStart('Enabling udev logging ...'); 202 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False, 203 cMsCdWait = 5 * 60 * 1000); 204 oTxsSession.syncExec("/bin/sed", ("/bin/sed", "-i", "'s/.*udev_log.*/udev_log=\"debug\"/'", "/etc/udev/udev.conf"), 205 fIgnoreErrors = True); 206 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False); 206 207 reporter.testDone(); 207 208 reporter.testStart('Enabling udev monitoring ...'); 209 sUdevMonitorServiceContent = \ 210 '[Unit]\n' \ 211 'Description=udev Monitoring\n' \ 212 'DefaultDependencies=no\n' \ 213 'Wants=systemd-udevd.service\n' \ 214 'After=systemd-udevd-control.socket systemd-udevd-kernel.socket\n' \ 215 'Before=sysinit.target systemd-udev-trigger.service\n' \ 216 '[Service]\n' \ 217 'Type=simple\n' \ 218 'ExecStart=/usr/bin/sh -c "/usr/sbin/udevadm monitor --udev --env > /tmp/udev_monitor.log\n' \ 219 '[Install]\n' \ 220 'WantedBy=sysinit.target'; 221 sUdevMonitorServiceFile = '/etc/systemd/system/systemd-udev-monitor.service'; 222 oTxsSession.syncUploadString(sUdevMonitorServiceContent, sUdevMonitorServiceFile, 0o644); 223 oTxsSession.syncExec("/bin/systemctl", ("/bin/systemctl", "enable", "systemd-udev-monitor.service"), 224 fIgnoreErrors = True); 225 reporter.testDone(); 208 if oTxsSession: 209 oTxsSession.syncExec("sed", 210 ("sed", "-i", "'s/.*udev_log.*/udev_log=\"debug\"/'", "/etc/udev/udev.conf"), 211 fIgnoreErrors = True); 212 213 sUDevMonitorLog = '/tmp/udev_monitor.log'; 214 215 reporter.testStart('Enabling udev monitoring ...'); 216 sUdevSvc = StringIO(); 217 sUdevSvc.write('[Unit]\n'); 218 sUdevSvc.write('Description=udev Monitoring\n'); 219 sUdevSvc.write('DefaultDependencies=no\n'); 220 sUdevSvc.write('Wants=systemd-udevd.service\n'); 221 sUdevSvc.write('After=systemd-udevd-control.socket systemd-udevd-kernel.socket\n'); 222 sUdevSvc.write('Before=sysinit.target systemd-udev-trigger.service\n'); 223 sUdevSvc.write('[Service]\n'); 224 sUdevSvc.write('Type=simple\n'); 225 sUdevSvc.write('ExecStart=/usr/bin/sh -c "/usr/sbin/udevadm monitor --udev --env > ' + sUDevMonitorLog + '\n'); 226 sUdevSvc.write('[Install]\n'); 227 sUdevSvc.write('WantedBy=sysinit.target'); 228 oTxsSession.syncUploadString(sUdevSvc.getvalue(), '/etc/systemd/system/systemd-udev-monitor.service', 0o644, 229 fIgnoreErrors = True); 230 oTxsSession.syncExec("systemctl", ("systemctl", "enable", "systemd-udev-monitor.service"), 231 fIgnoreErrors = True); 232 reporter.testDone(); 226 233 227 234 reporter.testStart('Waiting for TXS + CD (%s)' % (self.sFileCdWait,)); 228 235 if oTestVm.isLinux(): 229 (fRc, oTxsSession)= self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, fCdWait = True,230 231 236 fRc, oTxsSession = self.txsRebootAndReconnectViaTcp(oSession, oTxsSession, fCdWait = True, 237 cMsCdWait = 5 * 60 * 1000, 238 sFileCdWait = self.sFileCdWait); 232 239 else: 233 240 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True, … … 237 244 238 245 if oTestVm.isLinux(): 239 asLogFiles = [ '/tmp/udev_monitor.log'];246 asLogFiles = [ sUDevMonitorLog ]; 240 247 self.txsDownloadFiles(oSession, oTxsSession, asLogFiles, fIgnoreErrors = True); 241 248
Note:
See TracChangeset
for help on using the changeset viewer.