VirtualBox

Changeset 84641 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jun 2, 2020 1:57:33 PM (5 years ago)
Author:
vboxsync
Message:

Main: bugref:9341: Improved some testcase reporting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py

    r84616 r84641  
    280280        Returns (True, ProcessStatus, ProcessExitCode, ProcessStdOutBuffer) on success or (False, 0, 0, None) on failure.
    281281        """
     282        _ = sTestName;
    282283        fRc = True; # Be optimistic.
    283 
    284         reporter.testStart(sTestName);
    285284
    286285        reporter.log2('Using session user=%s, name=%s, timeout=%d'
     
    410409            fRc = reporter.errorXcpt('asArgs=%s' % (asArgs,));
    411410        reporter.log2('Process (PID %d) has exit code: %d; status: %d ' % (iPid, iExitCode, uExitStatus));
    412         reporter.testDone();
    413411
    414412        return (fRc, uExitStatus, iExitCode, aBuf);
     
    549547        cAttempt = 0;
    550548        oGuestSession = None;
     549        fRc = False;
    551550        while cAttempt < 30:
    552551            fRc, oGuestSession = self.createSession(oSession, 'Session for user: vbox',
     
    570569        Returns result and guest session obtained after reboot
    571570        """
     571        reporter.testStart('Reboot VM and wait for readiness');
    572572        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Reboot the VM',
    573573                                                  30 * 1000, '/usr/bin/sudo',
    574574                                                  ['sudo', 'reboot'],
    575575                                                  False, True);
     576        if not fRc:
     577            reporter.error('Calling the reboot utility failed');
    576578        fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack.
    577579        if fRc:
    578580            (fRc, oGuestSession) = self.waitVMisReady(oSession);
     581
     582        if not fRc:
     583            reporter.error('VM is not ready after reboot');
     584        reporter.testDone();
    579585        return (fRc, oGuestSession);
    580586
     
    588594        if oGuestSession is None:
    589595            return False;
     596
     597        reporter.testStart('Power down the VM');
    590598
    591599        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM',
     
    593601                                                  ['sudo', 'poweroff'],
    594602                                                  False, True);
     603        if not fRc:
     604            reporter.error('Calling the poweroff utility failed');
    595605        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();
    596610        return fRc;
    597611
     
    600614        Install guest additions in the guest.
    601615        """
     616        reporter.testStart('Install Guest Additions');
    602617
    603618        fRc = False;
     
    668683                    asLogFile.append('/var/log/vboxadd-install.log');
    669684                    self.downloadFiles(oGuestSession, asLogFile, fIgnoreErrors = True);
     685            else:
     686                reporter.error('Installing guest additions failed: Error occured during vbox installer execution')
    670687
    671688        if fRc:
    672689            (fRc, oGuestSession) = self.rebootVMAndCheckReady(oSession, oGuestSession);
    673 
     690            if not fRc:
     691                reporter.error('Reboot after installing GuestAdditions failed');
     692        reporter.testDone();
    674693        return (fRc, oGuestSession);
    675694
     
    681700            return False;
    682701
     702        reporter.testStart('Install Virtualbox into the guest VM');
     703
    683704        fRc = self.uploadFile(oGuestSession, self.sTestBuild,
    684705                              '/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:
    687709            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession,
    688710                                                      'Allowing execution for the vbox installer',
     
    691713                                                       '/tmp/' + os.path.basename(self.sTestBuild)],
    692714                                                      False, True);
     715            if not fRc:
     716                reporter.error('Allowing execution for the vbox installer failed');
    693717        if fRc:
    694718            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox',
     
    697721                                                       '/tmp/' + os.path.basename(self.sTestBuild),],
    698722                                                      False, True);
     723            if not fRc:
     724                reporter.error('Installing VBox failed');
     725        reporter.testDone();
    699726        return fRc;
    700727
     
    704731        Configures the autostart feature in the guest.
    705732        """
    706 
     733        reporter.testStart('Configure autostart');
    707734        # Create autostart database directory writeable for everyone
    708735        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating autostart database',
     
    710737                                                  ['/usr/bin/sudo', '/bin/mkdir', '-m', '1777', '/etc/vbox/autostart.d'],
    711738                                                  False, True);
     739        if not fRc:
     740            reporter.error('Creating autostart database failed');
    712741        # 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');
    716748        if fRc:
    717749            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Moving to destination',
     
    720752                                                       '/etc/default/virtualbox'],
    721753                                                      False, True);
     754            if not fRc:
     755                reporter.error('Moving the /tmp/virtualbox to destination failed');
    722756        if fRc:
    723757            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Setting permissions',
     
    726760                                                       '/etc/default/virtualbox'],
    727761                                                      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
    731771        if fRc:
    732772            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Moving to destination',
     
    735775                                                       '/etc/vbox/autostart.cfg'],
    736776                                                      False, True);
     777            if not fRc:
     778                reporter.error('Moving the /tmp/autostart.cfg to destination failed');
    737779        if fRc:
    738780            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Setting permissions',
     
    741783                                                       '/etc/vbox/autostart.cfg'],
    742784                                                      False, True);
     785            if not fRc:
     786                reporter.error('Setting permissions for the autostart.cfg failed');
     787        reporter.testDone();
    743788        return fRc;
    744789
     
    747792        Create a new user with the given name
    748793        """
    749 
     794        reporter.testStart('Create user %s' % sUser);
    750795        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating new user',
    751796                                                  30 * 1000, '/usr/bin/sudo',
    752797                                                  ['/usr/bin/sudo', '/usr/sbin/useradd', '-m', '-U',
    753798                                                   sUser], False, True);
     799        if not fRc:
     800            reporter.error('Create user %s failed' % sUser);
     801        reporter.testDone();
    754802        return fRc;
    755803
     
    764812
    765813        _ = oSession;
     814
     815        reporter.testStart('Create test VM for user %s' % sUser);
    766816
    767817        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Configuring autostart database',
     
    770820                                                   'setproperty', 'autostartdbpath', '/etc/vbox/autostart.d'],
    771821                                                  False, True);
    772         if fRc:
     822        if not fRc:
     823            reporter.error('Configuring autostart database failed');
     824        else:
    773825            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName,
    774826                                                      30 * 1000, '/usr/bin/sudo',
     
    776828                                                       '/opt/VirtualBox/VBoxManage', 'createvm',
    777829                                                       '--name', sVmName, '--register'], False, True);
     830            if not fRc:
     831                reporter.error('Create VM %s failed' % sVmName);
    778832        if fRc:
    779833            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM',
     
    782836                                                       '/opt/VirtualBox/VBoxManage', 'modifyvm',
    783837                                                      sVmName, '--autostart-enabled', 'on'], False, True);
     838            if not fRc:
     839                reporter.error('Enabling autostart for %s failed' % sVmName);
     840        reporter.testDone();
    784841        return fRc;
    785842
     
    793850        _ = oSession;
    794851
     852        reporter.testStart('Check the VM %s is running for user %s' % (sVmName, sUser));
    795853        (fRc, _, _, aBuf) = self.guestProcessExecute(oGuestSession, 'Check for running VM',
    796854                                                     30 * 1000, '/usr/bin/sudo',
     
    798856                                                      '/opt/VirtualBox/VBoxManage',
    799857                                                      '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:
    801861            bufWrapper = VBoxManageStdOutWrapper();
    802862            bufWrapper.write(aBuf);
    803863            fRc = bufWrapper.sVmRunning == sVmName;
    804864
     865        reporter.testDone();
    805866        return fRc;
    806867
     
    872933        Reboot the VM and wait the VM is ready.
    873934        """
    874 
     935        reporter.testStart('Reboot VM and wait for readiness');
    875936        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Reboot the VM',
    876937                                                  30 * 1000, 'C:\\Windows\\System32\\shutdown.exe',
     
    878939                                                   '/r', '/t', '0'],
    879940                                                  False, True);
     941        if not fRc:
     942            reporter.error('Calling the shutdown utility failed');
    880943        fRc = self.closeSession(oGuestSession, True) and fRc and True; # pychecker hack.
    881944        if fRc:
    882945            (fRc, oGuestSession) = self.waitVMisReady(oSession);
     946        if not fRc:
     947            reporter.error('VM is not ready after reboot');
     948        reporter.testDone();
    883949        return (fRc, oGuestSession);
    884950
     
    893959            return False;
    894960
     961        reporter.testStart('Power down the VM');
    895962        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Power down the VM',
    896963                                                  30 * 1000, 'C:\\Windows\\System32\\shutdown.exe',
     
    898965                                                   '/s', '/t', '0'],
    899966                                                  False, True);
     967        if not fRc:
     968            reporter.error('Calling the shutdown utility failed');
    900969        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();
    901973        return fRc;
    902974
     
    911983        #       deletion errors from the guest side (e.g. sharing violations) and just continue.
    912984        #
     985        reporter.testStart('Install Guest Additions');
    913986        asLogFiles = [];
    914987        fHaveSetupApiDevLog = False;
     
    9751048                    #
    9761049                    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();
    9781055        return (fRc, oGuestSession);
    9791056
     
    9851062        if self.sTestBuild is None:
    9861063            return False;
    987 
     1064        reporter.testStart('Install Virtualbox into the guest VM');
    9881065        # Used windows image already contains the C:\Temp
    9891066        fRc = self.uploadFile(oGuestSession, self.sTestBuild,
    9901067                              '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:
    9931071            if self.sTestBuild.endswith('.msi'):
    9941072                (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox',
     
    9971075                                                         'C:\\Temp\\' + os.path.basename(self.sTestBuild)],
    9981076                                                        False, True);
     1077                if not fRc:
     1078                    reporter.error('Installing the VBox from msi installer failed');
    9991079            else:
    10001080                (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Installing VBox',
     
    10021082                                                        ['C:\\Temp\\' + os.path.basename(self.sTestBuild), '--silent'],
    10031083                                                        False, True);
     1084                if not fRc:
     1085                    reporter.error('Installing the VBox failed');
     1086        reporter.testDone();
    10041087        return fRc;
    10051088
     
    10091092        Configures the autostart feature in the guest.
    10101093        """
    1011 
     1094        reporter.testStart('Configure autostart');
    10121095        # Create autostart database directory writeable for everyone
    10131096        (fRc, _, _, _) = \
     
    10191102                                      'C:\\ProgramData\\autostart.cfg', '/f'],
    10201103                                     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();
    10241113        return fRc;
    10251114
     
    10291118        """
    10301119        _ = oGuestSession;
     1120
     1121        reporter.testStart('Create test VM for user %s' % sUser);
    10311122
    10321123        fRc, oGuestSession = self.createSession(oSession, 'Session for user: %s' % (sUser,),
    10331124                                                sUser, 'password', 10 * 1000, True);
    10341125        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:
    10431128            (fRc, _, _, _) = \
    1044                 self.guestProcessExecute(oGuestSession, 'Enabling autostart for test VM',
     1129                self.guestProcessExecute(oGuestSession, 'Create VM ' + sVmName,
    10451130                                         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();
    10591162        return fRc;
    10601163
     
    10651168
    10661169        _ = oGuestSession;
     1170
     1171        reporter.testStart('Check the VM %s is running for user %s' % (sVmName, sUser));
    10671172
    10681173        fRc, oGuestSession = self.createSession(oSession, 'Session for user: %s' % (sUser,),
    10691174                                                sUser, 'password', 10 * 1000, True);
    10701175        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();
    10841194        return fRc;
    10851195
     
    10881198        Create a new user with the given name
    10891199        """
    1090 
     1200        reporter.testStart('Create user %s' % sUser);
    10911201        # Create user
    10921202        (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Creating user %s to run a VM' % sUser,
    10931203                                                30 * 1000, 'C:\\Windows\\System32\\net.exe',
    10941204                                                ['net', 'user', sUser, 'password', '/add' ], False, True);
    1095 
     1205        if not fRc:
     1206            reporter.error('Creating user %s to run a VM failed' % sUser);
    10961207        # Add the user to Administrators group
    1097         if fRc:
     1208        else:
    10981209            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession, 'Adding the user %s to Administrators group' % sUser,
    10991210                                                      30 * 1000, 'C:\\Windows\\System32\\net.exe',
    11001211                                                      ['net', 'localgroup', 'Administrators', sUser, '/add' ], False, True);
     1212            if not fRc:
     1213                reporter.error('Adding the user %s to Administrators group failed' % sUser);
    11011214
    11021215        #Allow the user to logon as service
    1103         sSecPolicyEditor = """
     1216        if fRc:
     1217            sSecPolicyEditor = """
    11041218' SetLogonAsAServiceRight.vbs
    11051219' Sample VBScript to set or grant Logon As A Service Right.
     
    11361250WScript.Echo "Logon As A Service Right granted to user '"& strUserName &"'"
    11371251                           """ % 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');
    11391255        if fRc:
    11401256            (fRc, _, _, _) = self.guestProcessExecute(oGuestSession,
     
    11421258                                                      30 * 1000, 'C:\\Windows\\System32\\cscript.exe',
    11431259                                                      ['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);
    11441262        try:
    11451263            oGuestSession.fsObjRemove('C:\\Temp\\adjustsec.vbs');
    11461264        except:
    11471265            fRc = reporter.errorXcpt('Removing policy script failed');
     1266        reporter.testDone();
    11481267        return fRc;
    11491268
     
    13771496                                    reporter.error('Test VM is not running inside the guest for allowed user');
    13781497                            else:
    1379                                 reporter.log('Rebooting the guest failed');
     1498                                reporter.error('Rebooting the guest failed');
    13801499                        else:
    1381                             reporter.log('Creating test VM failed');
     1500                            reporter.error('Creating test VM failed');
    13821501                    else:
    1383                         reporter.log('Configuring autostart in the guest failed');
     1502                        reporter.error('Configuring autostart in the guest failed');
    13841503                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');
    13881507
    13891508            if oGuestSession is not None:
     
    13911510                except: pass;
    13921511        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));
    13941513            fRc = False;
    13951514
    13961515        reporter.testDone();
    13971516        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;
    14151517
    14161518    def testAutostartOneCfg(self, sVmName):
     
    14441546                try:    self.terminateVmBySession(oSession);
    14451547                except: pass;
    1446                 self.deleteVM(oVM);
    14471548            else:
    14481549                fRc = False;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette