VirtualBox

Ignore:
Timestamp:
Apr 17, 2020 5:56:52 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137299
Message:

Validation Kit/testdriver: More work on checking task results; txsRunTest() now has an optional attribute fCheckSessionStatus to avoid having to check that status in the calling code. Also, the overall test result of such a particular test then would indicate success/failure better in the log.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py

    r83764 r83774  
    259259        if oTestVm.sKind not in ('WindowsNT4', 'Windows2000', 'WindowsXP', 'Windows2003'):
    260260            fRc = self.txsRunTest(oTxsSession, 'VBoxCertUtil.exe', 1 * 60 * 1000, '${CDROM}/cert/VBoxCertUtil.exe',
    261                                   ('${CDROM}/cert/VBoxCertUtil.exe', 'add-trusted-publisher', '${CDROM}/cert/vbox-sha1.cer'));
    262             if not fRc \
    263             or oTxsSession.getResult() is False:
     261                                  ('${CDROM}/cert/VBoxCertUtil.exe', 'add-trusted-publisher', '${CDROM}/cert/vbox-sha1.cer'),
     262                                  fCheckSessionStatus = True);
     263            if not fRc:
    264264                reporter.error('Error installing SHA1 certificate');
    265265            else:
    266266                fRc = self.txsRunTest(oTxsSession, 'VBoxCertUtil.exe', 1 * 60 * 1000, '${CDROM}/cert/VBoxCertUtil.exe',
    267267                                      ('${CDROM}/cert/VBoxCertUtil.exe', 'add-trusted-publisher',
    268                                        '${CDROM}/cert/vbox-sha256.cer'));
    269                 if not fRc \
    270                 or oTxsSession.getResult() is False:
     268                                       '${CDROM}/cert/vbox-sha256.cer'), fCheckSessionStatus = True);
     269                if not fRc:
    271270                    reporter.error('Error installing SHA256 certificate');
    272271
     
    291290                                                  ('c:\\Windows\\System32\\reg.exe', 'add',
    292291                                                   '"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup"',
    293                                                    '/v', 'LogLevel', '/t', 'REG_DWORD', '/d', '0xFF'));
     292                                                   '/v', 'LogLevel', '/t', 'REG_DWORD', '/d', '0xFF'),
     293                                                   fCheckSessionStatus = True);
    294294
    295295        for sFile in asLogFiles:
     
    302302        #
    303303        fRc = self.txsRunTest(oTxsSession, 'VBoxWindowsAdditions.exe', 5 * 60 * 1000, '${CDROM}/VBoxWindowsAdditions.exe',
    304                               ('${CDROM}/VBoxWindowsAdditions.exe', '/S', '/l', '/with_autologon'));
     304                              ('${CDROM}/VBoxWindowsAdditions.exe', '/S', '/l', '/with_autologon'), fCheckSessionStatus = True);
    305305
    306306        #
     
    344344        or oTestVm.sKind.startswith('Ubuntu'):
    345345            fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000,
    346                                   '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'linux-headers-generic'));
    347             if not fRc \
    348             or oTxsSession.getResult() is False:
     346                                  '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'linux-headers-generic'),
     347                                  fCheckSessionStatus = True);
     348            if not fRc:
    349349                reporter.error('Error installing Kernel headers');
    350350            fRc = self.txsRunTest(oTxsSession, 'Installing Guest Additions depdendencies', 5 * 60 *1000, \
    351                                   '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'build-essential', 'perl'));
    352             if not fRc \
    353             or oTxsSession.getResult() is False:
     351                                  '/usr/bin/apt-get', ('/usr/bin/apt-get', 'install', '-y', 'build-essential', 'perl'),
     352                                  fCheckSessionStatus = True);
     353            if not fRc:
    354354                reporter.error('Error installing additional installer dependencies');
    355355        elif oTestVm.sKind.startswith('OL') \
     
    359359        or   oTestVm.sKind.startswith('Cent'):
    360360            fRc = self.txsRunTest(oTxsSession, 'Installing Kernel headers', 5 * 60 *1000,
    361                                   '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', 'kernel-headers'));
    362             if not fRc \
    363             or oTxsSession.getResult() is False:
     361                                  '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', 'kernel-headers'),
     362                                  fCheckSessionStatus = True);
     363            if not fRc:
    364364                reporter.error('Error installing Kernel headers');
    365365            fRc = self.txsRunTest(oTxsSession, 'Installing Guest Additions depdendencies', 5 * 60 *1000, \
    366366                                  '/usr/bin/yum', ('/usr/bin/yum', '-y', 'install', \
    367                                                    'make', 'automake', 'gcc', 'kernel-devel', 'dkms', 'bzip2', 'perl'));
    368             if not fRc \
    369             or oTxsSession.getResult() is False:
     367                                                   'make', 'automake', 'gcc', 'kernel-devel', 'dkms', 'bzip2', 'perl'),
     368                                  fCheckSessionStatus = True);
     369            if not fRc:
    370370                reporter.error('Error installing additional installer dependencies');
    371371        else:
     
    379379            #
    380380            fRc = self.txsRunTest(oTxsSession, 'VBoxLinuxAdditions.run', 5 * 60 * 1000,
    381                 '/bin/sh', ('/bin/sh', '${CDROM}/VBoxLinuxAdditions.run'));
    382             if not fRc \
    383             or oTxsSession.getResult() is False:
     381                '/bin/sh', ('/bin/sh', '${CDROM}/VBoxLinuxAdditions.run'), fCheckSessionStatus = True);
     382            if not fRc:
    384383                reporter.error('Installing Linux Additions failed (see log file for details)');
    385384
Note: See TracChangeset for help on using the changeset viewer.

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