Changeset 84641 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jun 2, 2020 1:57:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
r84616 r84641 280 280 Returns (True, ProcessStatus, ProcessExitCode, ProcessStdOutBuffer) on success or (False, 0, 0, None) on failure. 281 281 """ 282 _ = sTestName; 282 283 fRc = True; # Be optimistic. 283 284 reporter.testStart(sTestName);285 284 286 285 reporter.log2('Using session user=%s, name=%s, timeout=%d' … … 410 409 fRc = reporter.errorXcpt('asArgs=%s' % (asArgs,)); 411 410 reporter.log2('Process (PID %d) has exit code: %d; status: %d ' % (iPid, iExitCode, uExitStatus)); 412 reporter.testDone();413 411 414 412 return (fRc, uExitStatus, iExitCode, aBuf); … … 549 547 cAttempt = 0; 550 548 oGuestSession = None; 549 fRc = False; 551 550 while cAttempt < 30: 552 551 fRc, oGuestSession = self.createSession(oSession, 'Session for user: vbox', … … 570 569 Returns result and guest session obtained after reboot 571 570 """ 571 reporter.testStart('Reboot VM and wait for readiness'); 572 572 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Reboot the VM', 573 573 30 * 1000, '/usr/bin/sudo', 574 574 ['sudo', 'reboot'], 575 575 False, True); 576 if not fRc: 577 reporter.error('Calling the reboot utility failed'); 576 578 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 577 579 if fRc: 578 580 (fRc, oGuestSession) = self.waitVMisReady(oSession); 581 582 if not fRc: 583 reporter.error('VM is not ready after reboot'); 584 reporter.testDone(); 579 585 return (fRc, oGuestSession); 580 586 … … 588 594 if oGuestSession is None: 589 595 return False; 596 597 reporter.testStart('Power down the VM'); 590 598 591 599 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM', … … 593 601 ['sudo', 'poweroff'], 594 602 False, True); 603 if not fRc: 604 reporter.error('Calling the poweroff utility failed'); 595 605 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 606 607 if not fRc: 608 reporter.error('Power down the VM failed'); 609 reporter.testDone(); 596 610 return fRc; 597 611 … … 600 614 Install guest additions in the guest. 601 615 """ 616 reporter.testStart('Install Guest Additions'); 602 617 603 618 fRc = False; … … 668 683 asLogFile.append('/var/log/vboxadd-install.log'); 669 684 self.downloadFiles(oGuestSession, asLogFile, fIgnoreErrors = True); 685 else: 686 reporter.error('Installing guest additions failed: Error occured during vbox installer execution') 670 687 671 688 if fRc: 672 689 (fRc, oGuestSession) = self.rebootVMAndCheckReady(oSession, oGuestSession); 673 690 if not fRc: 691 reporter.error('Reboot after installing GuestAdditions failed'); 692 reporter.testDone(); 674 693 return (fRc, oGuestSession); 675 694 … … 681 700 return False; 682 701 702 reporter.testStart('Install Virtualbox into the guest VM'); 703 683 704 fRc = self.uploadFile(oGuestSession, self.sTestBuild, 684 705 '/tmp/' + os.path.basename(self.sTestBuild)); 685 686 if fRc: 706 if not fRc: 707 reporter.error('Upload the vbox installer into guest VM failed'); 708 else: 687 709 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 688 710 'Allowing execution for the vbox installer', … … 691 713 '/tmp/' + os.path.basename(self.sTestBuild)], 692 714 False, True); 715 if not fRc: 716 reporter.error('Allowing execution for the vbox installer failed'); 693 717 if fRc: 694 718 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox', … … 697 721 '/tmp/' + os.path.basename(self.sTestBuild),], 698 722 False, True); 723 if not fRc: 724 reporter.error('Installing VBox failed'); 725 reporter.testDone(); 699 726 return fRc; 700 727 … … 704 731 Configures the autostart feature in the guest. 705 732 """ 706 733 reporter.testStart('Configure autostart'); 707 734 # Create autostart database directory writeable for everyone 708 735 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating autostart database', … … 710 737 ['/usr/bin/sudo', '/bin/mkdir', '-m', '1777', '/etc/vbox/autostart.d'], 711 738 False, True); 739 if not fRc: 740 reporter.error('Creating autostart database failed'); 712 741 # Create /etc/default/virtualbox 713 sVBoxCfg = 'VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg\n' \ 714 + 'VBOXAUTOSTART_DB=/etc/vbox/autostart.d\n'; 715 fRc = fRc and self.uploadString(oGuestSession, sVBoxCfg, '/tmp/virtualbox'); 742 if fRc: 743 sVBoxCfg = 'VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg\n' \ 744 + 'VBOXAUTOSTART_DB=/etc/vbox/autostart.d\n'; 745 fRc = self.uploadString(oGuestSession, sVBoxCfg, '/tmp/virtualbox'); 746 if not fRc: 747 reporter.error('Upload to /tmp/virtualbox failed'); 716 748 if fRc: 717 749 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Moving to destination', … … 720 752 '/etc/default/virtualbox'], 721 753 False, True); 754 if not fRc: 755 reporter.error('Moving the /tmp/virtualbox to destination failed'); 722 756 if fRc: 723 757 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Setting permissions', … … 726 760 '/etc/default/virtualbox'], 727 761 False, True); 728 729 sVBoxCfg = self._createAutostartCfg(sDefaultPolicy, asUserAllow, asUserDeny); 730 fRc = fRc and self.uploadString(oGuestSession, sVBoxCfg, '/tmp/autostart.cfg'); 762 if not fRc: 763 reporter.error('Setting permissions for the virtualbox failed'); 764 765 if fRc: 766 sVBoxCfg = self._createAutostartCfg(sDefaultPolicy, asUserAllow, asUserDeny); 767 fRc = self.uploadString(oGuestSession, sVBoxCfg, '/tmp/autostart.cfg'); 768 if not fRc: 769 reporter.error('Upload to /tmp/autostart.cfg failed'); 770 731 771 if fRc: 732 772 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Moving to destination', … … 735 775 '/etc/vbox/autostart.cfg'], 736 776 False, True); 777 if not fRc: 778 reporter.error('Moving the /tmp/autostart.cfg to destination failed'); 737 779 if fRc: 738 780 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Setting permissions', … … 741 783 '/etc/vbox/autostart.cfg'], 742 784 False, True); 785 if not fRc: 786 reporter.error('Setting permissions for the autostart.cfg failed'); 787 reporter.testDone(); 743 788 return fRc; 744 789 … … 747 792 Create a new user with the given name 748 793 """ 749 794 reporter.testStart('Create user %s' % sUser); 750 795 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating new user', 751 796 30 * 1000, '/usr/bin/sudo', 752 797 ['/usr/bin/sudo', '/usr/sbin/useradd', '-m', '-U', 753 798 sUser], False, True); 799 if not fRc: 800 reporter.error('Create user %s failed' % sUser); 801 reporter.testDone(); 754 802 return fRc; 755 803 … … 764 812 765 813 _ = oSession; 814 815 reporter.testStart('Create test VM for user %s' % sUser); 766 816 767 817 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Configuring autostart database', … … 770 820 'setproperty', 'autostartdbpath', '/etc/vbox/autostart.d'], 771 821 False, True); 772 if fRc: 822 if not fRc: 823 reporter.error('Configuring autostart database failed'); 824 else: 773 825 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName, 774 826 30 * 1000, '/usr/bin/sudo', … … 776 828 '/opt/VirtualBox/VBoxManage', 'createvm', 777 829 '--name', sVmName, '--register'], False, True); 830 if not fRc: 831 reporter.error('Create VM %s failed' % sVmName); 778 832 if fRc: 779 833 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM', … … 782 836 '/opt/VirtualBox/VBoxManage', 'modifyvm', 783 837 sVmName, '--autostart-enabled', 'on'], False, True); 838 if not fRc: 839 reporter.error('Enabling autostart for %s failed' % sVmName); 840 reporter.testDone(); 784 841 return fRc; 785 842 … … 793 850 _ = oSession; 794 851 852 reporter.testStart('Check the VM %s is running for user %s' % (sVmName, sUser)); 795 853 (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM', 796 854 30 * 1000, '/usr/bin/sudo', … … 798 856 '/opt/VirtualBox/VBoxManage', 799 857 'list', 'runningvms'], True, True); 800 if fRc: 858 if not fRc: 859 reporter.error('Checking the VM %s is running for user %s failed' % (sVmName, sUser)); 860 else: 801 861 bufWrapper = VBoxManageStdOutWrapper(); 802 862 bufWrapper.write(aBuf); 803 863 fRc = bufWrapper.sVmRunning == sVmName; 804 864 865 reporter.testDone(); 805 866 return fRc; 806 867 … … 872 933 Reboot the VM and wait the VM is ready. 873 934 """ 874 935 reporter.testStart('Reboot VM and wait for readiness'); 875 936 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Reboot the VM', 876 937 30 * 1000, 'C:\\Windows\\System32\\shutdown.exe', … … 878 939 '/r', '/t', '0'], 879 940 False, True); 941 if not fRc: 942 reporter.error('Calling the shutdown utility failed'); 880 943 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 881 944 if fRc: 882 945 (fRc, oGuestSession) = self.waitVMisReady(oSession); 946 if not fRc: 947 reporter.error('VM is not ready after reboot'); 948 reporter.testDone(); 883 949 return (fRc, oGuestSession); 884 950 … … 893 959 return False; 894 960 961 reporter.testStart('Power down the VM'); 895 962 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM', 896 963 30 * 1000, 'C:\\Windows\\System32\\shutdown.exe', … … 898 965 '/s', '/t', '0'], 899 966 False, True); 967 if not fRc: 968 reporter.error('Calling the shutdown utility failed'); 900 969 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 970 if not fRc: 971 reporter.error('Power down the VM failed'); 972 reporter.testDone(); 901 973 return fRc; 902 974 … … 911 983 # deletion errors from the guest side (e.g. sharing violations) and just continue. 912 984 # 985 reporter.testStart('Install Guest Additions'); 913 986 asLogFiles = []; 914 987 fHaveSetupApiDevLog = False; … … 975 1048 # 976 1049 self.downloadFiles(oGuestSession, asLogFiles, fIgnoreErrors = True); 977 1050 else: 1051 reporter.error('Reboot after installing GuestAdditions failed'); 1052 else: 1053 reporter.error('Create session for user vbox after GA updating failed'); 1054 reporter.testDone(); 978 1055 return (fRc, oGuestSession); 979 1056 … … 985 1062 if self.sTestBuild is None: 986 1063 return False; 987 1064 reporter.testStart('Install Virtualbox into the guest VM'); 988 1065 # Used windows image already contains the C:\Temp 989 1066 fRc = self.uploadFile(oGuestSession, self.sTestBuild, 990 1067 'C:\\Temp\\' + os.path.basename(self.sTestBuild)); 991 992 if fRc: 1068 if not fRc: 1069 reporter.error('Upload the installing into guest VM failed'); 1070 else: 993 1071 if self.sTestBuild.endswith('.msi'): 994 1072 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox', … … 997 1075 'C:\\Temp\\' + os.path.basename(self.sTestBuild)], 998 1076 False, True); 1077 if not fRc: 1078 reporter.error('Installing the VBox from msi installer failed'); 999 1079 else: 1000 1080 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox', … … 1002 1082 ['C:\\Temp\\' + os.path.basename(self.sTestBuild), '--silent'], 1003 1083 False, True); 1084 if not fRc: 1085 reporter.error('Installing the VBox failed'); 1086 reporter.testDone(); 1004 1087 return fRc; 1005 1088 … … 1009 1092 Configures the autostart feature in the guest. 1010 1093 """ 1011 1094 reporter.testStart('Configure autostart'); 1012 1095 # Create autostart database directory writeable for everyone 1013 1096 (fRc, _, _, _) = \ … … 1019 1102 'C:\\ProgramData\\autostart.cfg', '/f'], 1020 1103 False, True); 1021 1022 sVBoxCfg = self._createAutostartCfg(sDefaultPolicy, asUserAllow, asUserDeny); 1023 fRc = fRc and self.uploadString(oGuestSession, sVBoxCfg, 'C:\\ProgramData\\autostart.cfg'); 1104 if not fRc: 1105 reporter.error('Setting the autostart environment variable failed'); 1106 1107 if fRc: 1108 sVBoxCfg = self._createAutostartCfg(sDefaultPolicy, asUserAllow, asUserDeny); 1109 fRc = self.uploadString(oGuestSession, sVBoxCfg, 'C:\\ProgramData\\autostart.cfg'); 1110 if not fRc: 1111 reporter.error('Upload the autostart.cfg failed'); 1112 reporter.testDone(); 1024 1113 return fRc; 1025 1114 … … 1029 1118 """ 1030 1119 _ = oGuestSession; 1120 1121 reporter.testStart('Create test VM for user %s' % sUser); 1031 1122 1032 1123 fRc, oGuestSession = self.createSession(oSession, 'Session for user: %s' % (sUser,), 1033 1124 sUser, 'password', 10 * 1000, True); 1034 1125 if not fRc: 1035 return fRc; 1036 1037 (fRc, _, _, _) = \ 1038 self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName, 1039 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1040 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 'createvm', 1041 '--name', sVmName, '--register'], False, True); 1042 if fRc: 1126 reporter.error('Create session for user %s failed' % sUser); 1127 else: 1043 1128 (fRc, _, _, _) = \ 1044 self.guestProcessExecute(oGuestSession, ' Enabling autostart for test VM',1129 self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName, 1045 1130 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1046 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1047 'modifyvm', sVmName, '--autostart-enabled', 'on'], False, True); 1048 fRc = fRc and self.uploadString(oGuestSession, 'password', 'C:\\ProgramData\\password.cfg'); 1049 if fRc: 1050 (fRc, _, _, _) = \ 1051 self.guestProcessExecute(oGuestSession, 'Install autostart service for the user', 1052 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe', 1053 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe', 1054 'install', '--user=' + sUser, 1055 '--password-file=C:\\ProgramData\\password.cfg'], 1056 False, True); 1057 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 1058 1131 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 'createvm', 1132 '--name', sVmName, '--register'], False, True); 1133 if not fRc: 1134 reporter.error('Create VM %s for user %s failed' % (sVmName, sUser)); 1135 else: 1136 (fRc, _, _, _) = \ 1137 self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM', 1138 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1139 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1140 'modifyvm', sVmName, '--autostart-enabled', 'on'], False, True); 1141 if not fRc: 1142 reporter.error('Enabling autostart for VM %s for user %s failed' % (sVmName, sUser)); 1143 if fRc: 1144 fRc = self.uploadString(oGuestSession, 'password', 'C:\\ProgramData\\password.cfg'); 1145 if not fRc: 1146 reporter.error('Upload the password.cfg failed'); 1147 if fRc: 1148 (fRc, _, _, _) = \ 1149 self.guestProcessExecute(oGuestSession, 'Install autostart service for the user', 1150 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe', 1151 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxAutostartSvc.exe', 1152 'install', '--user=' + sUser, 1153 '--password-file=C:\\ProgramData\\password.cfg'], 1154 False, True); 1155 if not fRc: 1156 reporter.error('Install autostart service for user %s failed' % (sVmName, sUser)); 1157 fRc1 = self.closeSession(oGuestSession, True); 1158 if not fRc1: 1159 reporter.error('Closing session for user %s failed' % sUser); 1160 fRc = fRc1 and fRc and True; # pychecker hack. 1161 reporter.testDone(); 1059 1162 return fRc; 1060 1163 … … 1065 1168 1066 1169 _ = oGuestSession; 1170 1171 reporter.testStart('Check the VM %s is running for user %s' % (sVmName, sUser)); 1067 1172 1068 1173 fRc, oGuestSession = self.createSession(oSession, 'Session for user: %s' % (sUser,), 1069 1174 sUser, 'password', 10 * 1000, True); 1070 1175 if not fRc: 1071 return fRc; 1072 1073 (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM', 1074 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1075 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1076 'list', 'runningvms'], True, True); 1077 if fRc: 1078 bufWrapper = VBoxManageStdOutWrapper(); 1079 bufWrapper.write(aBuf); 1080 fRc = bufWrapper.sVmRunning == sVmName; 1081 1082 fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack. 1083 1176 reporter.error('Create session for user %s failed' % sUser); 1177 else: 1178 (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM', 1179 30 * 1000, 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1180 ['C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe', 1181 'list', 'runningvms'], True, True); 1182 if not fRc: 1183 reporter.error('Checking the VM %s is running for user %s failed' % (sVmName, sUser)); 1184 else: 1185 bufWrapper = VBoxManageStdOutWrapper(); 1186 bufWrapper.write(aBuf); 1187 fRc = bufWrapper.sVmRunning == sVmName; 1188 1189 fRc1 = self.closeSession(oGuestSession, True); 1190 if not fRc1: 1191 reporter.error('Closing session for user %s failed' % sUser); 1192 fRc = fRc1 and fRc and True; # pychecker hack. 1193 reporter.testDone(); 1084 1194 return fRc; 1085 1195 … … 1088 1198 Create a new user with the given name 1089 1199 """ 1090 1200 reporter.testStart('Create user %s' % sUser); 1091 1201 # Create user 1092 1202 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating user %s to run a VM' % sUser, 1093 1203 30 * 1000, 'C:\\Windows\\System32\\net.exe', 1094 1204 ['net', 'user', sUser, 'password', '/add' ], False, True); 1095 1205 if not fRc: 1206 reporter.error('Creating user %s to run a VM failed' % sUser); 1096 1207 # Add the user to Administrators group 1097 if fRc:1208 else: 1098 1209 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Adding the user %s to Administrators group' % sUser, 1099 1210 30 * 1000, 'C:\\Windows\\System32\\net.exe', 1100 1211 ['net', 'localgroup', 'Administrators', sUser, '/add' ], False, True); 1212 if not fRc: 1213 reporter.error('Adding the user %s to Administrators group failed' % sUser); 1101 1214 1102 1215 #Allow the user to logon as service 1103 sSecPolicyEditor = """ 1216 if fRc: 1217 sSecPolicyEditor = """ 1104 1218 ' SetLogonAsAServiceRight.vbs 1105 1219 ' Sample VBScript to set or grant Logon As A Service Right. … … 1136 1250 WScript.Echo "Logon As A Service Right granted to user '"& strUserName &"'" 1137 1251 """ % sUser; 1138 fRc = fRc and self.uploadString(oGuestSession, sSecPolicyEditor, 'C:\\Temp\\adjustsec.vbs'); 1252 fRc = self.uploadString(oGuestSession, sSecPolicyEditor, 'C:\\Temp\\adjustsec.vbs'); 1253 if not fRc: 1254 reporter.error('Upload the adjustsec.vbs failed'); 1139 1255 if fRc: 1140 1256 (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, … … 1142 1258 30 * 1000, 'C:\\Windows\\System32\\cscript.exe', 1143 1259 ['cscript.exe', 'C:\\Temp\\adjustsec.vbs', '//Nologo'], False, True); 1260 if not fRc: 1261 reporter.error('Setting the "Logon as service" policy to the user %s failed' % sUser); 1144 1262 try: 1145 1263 oGuestSession.fsObjRemove('C:\\Temp\\adjustsec.vbs'); 1146 1264 except: 1147 1265 fRc = reporter.errorXcpt('Removing policy script failed'); 1266 reporter.testDone(); 1148 1267 return fRc; 1149 1268 … … 1377 1496 reporter.error('Test VM is not running inside the guest for allowed user'); 1378 1497 else: 1379 reporter. log('Rebooting the guest failed');1498 reporter.error('Rebooting the guest failed'); 1380 1499 else: 1381 reporter. log('Creating test VM failed');1500 reporter.error('Creating test VM failed'); 1382 1501 else: 1383 reporter. log('Configuring autostart in the guest failed');1502 reporter.error('Configuring autostart in the guest failed'); 1384 1503 else: 1385 reporter. log('Installing VirtualBox in the guest failed');1386 else: 1387 reporter. log('Creating test users failed');1504 reporter.error('Installing VirtualBox in the guest failed'); 1505 else: 1506 reporter.error('Creating test users failed'); 1388 1507 1389 1508 if oGuestSession is not None: … … 1391 1510 except: pass; 1392 1511 else: 1393 reporter. log('Guest OS helper not created for VM %s' % (sVmName));1512 reporter.error('Guest OS helper not created for VM %s' % (sVmName)); 1394 1513 fRc = False; 1395 1514 1396 1515 reporter.testDone(); 1397 1516 return fRc; 1398 1399 def deleteVM(self, oVM):1400 try: self.oVBox.unregisterMachine(oVM.id);1401 except: pass;1402 if self.fpApiVer >= 4.0:1403 try:1404 if self.fpApiVer >= 4.3:1405 oProgress = oVM.deleteConfig([]);1406 else:1407 oProgress = oVM.delete(None);1408 self.waitOnProgress(oProgress);1409 except:1410 reporter.logXcpt();1411 else:1412 try: oVM.deleteSettings();1413 except: reporter.logXcpt();1414 return None;1415 1517 1416 1518 def testAutostartOneCfg(self, sVmName): … … 1444 1546 try: self.terminateVmBySession(oSession); 1445 1547 except: pass; 1446 self.deleteVM(oVM);1447 1548 else: 1448 1549 fRc = False;
Note:
See TracChangeset
for help on using the changeset viewer.