Changeset 84590 in vbox
- Timestamp:
- May 28, 2020 1:13:09 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138320
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
r84559 r84590 605 605 return fRc; 606 606 607 def powerDownVM(self, oSession): 608 """ 609 Power down the VM by calling guest process without wating 610 the VM is really powered off. 611 It helps the terminateBySession to stop the VM without aborting. 612 """ 613 614 fRc, oGuestSession = self.createSession(oSession, 'Session for user: vbox', 615 'vbox', 'password', 10 * 1000, True); 616 if not fRc: 617 return fRc; 618 619 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM', 620 30 * 1000, '/usr/bin/sudo', 621 ['sudo', 'poweroff'], 622 False, True); 623 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 624 return fRc; 625 607 626 def installAdditions(self, oSession, oVM): 608 627 """ … … 924 943 925 944 fRc = fRc and self.waitVMisReady(oSession); 945 return fRc; 946 947 def powerDownVM(self, oSession): 948 """ 949 Power down the VM by calling guest process without wating 950 the VM is really powered off. 951 It helps the terminateBySession to stop the VM without aborting. 952 """ 953 954 fRc, oGuestSession = self.createSession(oSession, 'Session for user: vbox', 955 'vbox', 'password', 10 * 1000, True); 956 if not fRc: 957 return fRc; 958 959 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM', 960 30 * 1000, 'C:\\Windows\\System32\\shutdown.exe', 961 ['C:\\Windows\\System32\\shutdown.exe', '/f', 962 '/s', '/t', '0'], 963 False, True); 964 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 926 965 return fRc; 927 966 … … 1428 1467 else: 1429 1468 reporter.log('Creating test users failed'); 1469 1470 try: oGuestOsHlp.powerDownVM(oSession); 1471 except: pass; 1472 1430 1473 else: 1431 1474 reporter.log('Guest OS helper not created for VM %s' % (sVmName)); … … 1480 1523 if oSession is not None: 1481 1524 fRc = self.testAutostartRunProgs(oSession, sVmName, oVM); 1482 self.terminateVmBySession(oSession); 1525 try: self.terminateVmBySession(oSession); 1526 except: pass; 1483 1527 self.deleteVM(oVM); 1484 1528 else:
Note:
See TracChangeset
for help on using the changeset viewer.