Exemple #1
0
 def __init__(self):
     TestDriverBase.__init__(self)
     self._asSubDriver = []
     # The sub driver and it's arguments.
     self._asBuildUrls = []
     # The URLs passed us on the command line.
     self._asBuildFiles = []
     # The downloaded file names.
     self._fAutoInstallPuelExtPack = True
Exemple #2
0
    def actionCleanupAfter(self):
        """
        Forward this to the sub testdriver, then uninstall VBox.
        """
        fRc = True
        if 'execute' not in self.asActions and 'all' not in self.asActions:
            fRc = self._executeSubDriver([
                'cleanup-after',
            ], fMaySkip=False)

        if not self._killAllVBoxProcesses():
            fRc = False

        if not self._uninstallVBox(
                self._persistentVarExists(self.ksVar_Skipped)):
            fRc = False

        if utils.getHostOs() == 'darwin':
            self._darwinUnmountDmg(fIgnoreError=True)
            # paranoia

        if not TestDriverBase.actionCleanupAfter(self):
            fRc = False

        return fRc
Exemple #3
0
 def showUsage(self):
     rc = TestDriverBase.showUsage(self)
     #             0         1         2         3         4         5         6         7         8
     #             012345678901234567890123456789012345678901234567890123456789012345678901234567890
     reporter.log('')
     reporter.log('vboxinstaller Options:')
     reporter.log('  --vbox-build    <url[,url2[,..]]>')
     reporter.log(
         '      Comma separated list of URL to file to download and install or/and'
     )
     reporter.log(
         '      unpack.  URLs without a schema are assumed to be files on the'
     )
     reporter.log('      build share and will be copied off it.')
     reporter.log('  --no-puel-extpack')
     reporter.log(
         '      Indicates that the PUEL extension pack should not be installed if found.'
     )
     reporter.log(
         '      The default is to install it if found in the vbox-build.')
     reporter.log('  --')
     reporter.log(
         '      Indicates the end of our parameters and the start of the sub'
     )
     reporter.log('      testdriver and its arguments.')
     return rc
Exemple #4
0
 def parseOption(self, asArgs, iArg):
     """
     Parse our arguments.
     """
     if asArgs[iArg] == '--':
         # End of our parameters and start of the sub driver invocation.
         iArg = self.requireMoreArgs(1, asArgs, iArg)
         assert not self._asSubDriver
         self._asSubDriver = asArgs[iArg:]
         self._asSubDriver[0] = self._asSubDriver[0].replace(
             '/', os.path.sep)
         iArg = len(asArgs) - 1
     elif asArgs[iArg] == '--vbox-build':
         # List of files to copy/download and install.
         iArg = self.requireMoreArgs(1, asArgs, iArg)
         self._asBuildUrls = asArgs[iArg].split(',')
     elif asArgs[iArg] == '--no-puel-extpack':
         self._fAutoInstallPuelExtPack = False
     elif asArgs[iArg] == '--puel-extpack':
         self._fAutoInstallPuelExtPack = True
     elif asArgs[iArg] == '--no-kernel-drivers':
         self._fKernelDrivers = False
     elif asArgs[iArg] == '--kernel-drivers':
         self._fKernelDrivers = True
     else:
         return TestDriverBase.parseOption(self, asArgs, iArg)
     return iArg + 1
 def actionAbort(self):
     """
     Forward this to the sub testdriver first, then wipe all VBox like
     processes, and finally do the pid file processing (again).
     """
     fRc1 = self._executeSubDriver([ 'abort', ], fMaySkip = False);
     fRc2 = self._killAllVBoxProcesses();
     fRc3 = TestDriverBase.actionAbort(self);
     return fRc1 and fRc2 and fRc3;
 def actionAbort(self):
     """
     Forward this to the sub testdriver first, then wipe all VBox like
     processes, and finally do the pid file processing (again).
     """
     fRc1 = self._executeSubDriver([ 'abort', ], fMaySkip = False);
     fRc2 = self._killAllVBoxProcesses();
     fRc3 = TestDriverBase.actionAbort(self);
     return fRc1 and fRc2 and fRc3;
 def actionAbort(self):
     """
     Forward this to the sub testdriver first, then do the default pid file
     based cleanup and finally swipe the scene with the heavy artillery.
     """
     fRc1 = self._executeSubDriver([ 'abort', ]);
     fRc2 = TestDriverBase.actionAbort(self);
     fRc3 = self._killAllVBoxProcesses();
     return fRc1 and fRc2 and fRc3;
Exemple #8
0
 def parseOption(self, asArgs, iArg):
     if asArgs[iArg] == '--test':
         iArg = self.requireMoreArgs(1, asArgs, iArg);
         if asArgs[iArg] not in self.kasValidTests:
             raise InvalidOption('Invalid test name "%s". Must be one of: %s'
                                 % (asArgs[iArg], ', '.join(self.kasValidTests),));
         self.sOptWhich = asArgs[iArg];
     else:
         return TestDriverBase.parseOption(self, asArgs, iArg);
     return iArg + 1;
 def parseOption(self, asArgs, iArg):
     if asArgs[iArg] == '--test':
         iArg = self.requireMoreArgs(1, asArgs, iArg);
         if asArgs[iArg] not in self.kasValidTests:
             raise InvalidOption('Invalid test name "%s". Must be one of: %s'
                                 % (asArgs[iArg], ', '.join(self.kasValidTests),));
         self.sOptWhich = asArgs[iArg];
     else:
         return TestDriverBase.parseOption(self, asArgs, iArg);
     return iArg + 1;
Exemple #10
0
 def actionAbort(self):
     """
     Forward this to the sub testdriver first, then do the default pid file
     based cleanup and finally swipe the scene with the heavy artillery.
     """
     fRc1 = self._executeSubDriver([
         'abort',
     ], fMaySkip=False)
     fRc2 = TestDriverBase.actionAbort(self)
     fRc3 = self._killAllVBoxProcesses()
     return fRc1 and fRc2 and fRc3
 def showUsage(self):
     rc = TestDriverBase.showUsage(self);
     #             0         1         2         3         4         5         6         7         8
     #             012345678901234567890123456789012345678901234567890123456789012345678901234567890
     reporter.log('');
     reporter.log('vboxinstaller Options:');
     reporter.log('  --vbox-build    <url[,url2[,..]]>');
     reporter.log('      Comma separated list of URL to file to download and install or/and');
     reporter.log('      unpack.  URLs without a schema are assumed to be files on the');
     reporter.log('      build share and will be copied off it.');
     reporter.log('  --no-puel-extpack');
     reporter.log('      Indicates that the PUEL extension pack should not be installed if found.');
     reporter.log('      The default is to install it if found in the vbox-build.');
     reporter.log('  --');
     reporter.log('      Indicates the end of our parameters and the start of the sub');
     reporter.log('      testdriver and its arguments.');
     return rc;
    def completeOptions(self):
        #
        # Check that we've got what we need.
        #
        if not self._asBuildUrls:
            reporter.error('No build files specfiied ("--vbox-build file1[,file2[...]]")');
            return False;
        if not self._asSubDriver:
            reporter.error('No sub testdriver specified. (" -- test/stuff/tdStuff1.py args")');
            return False;

        #
        # Construct _asBuildFiles as an array parallel to _asBuildUrls.
        #
        for sUrl in self._asBuildUrls:
            sDstFile = os.path.join(self.sScratchPath, webutils.getFilename(sUrl));
            self._asBuildFiles.append(sDstFile);

        return TestDriverBase.completeOptions(self);
    def completeOptions(self):
        #
        # Check that we've got what we need.
        #
        if len(self._asBuildUrls) == 0:
            reporter.error('No build files specfiied ("--vbox-build file1[,file2[...]]")');
            return False;
        if len(self._asSubDriver) == 0:
            reporter.error('No sub testdriver specified. (" -- test/stuff/tdStuff1.py args")');
            return False;

        #
        # Construct _asBuildFiles as an array parallel to _asBuildUrls.
        #
        for sUrl in self._asBuildUrls:
            sDstFile = os.path.join(self.sScratchPath, webutils.getFilename(sUrl));
            self._asBuildFiles.append(sDstFile);

        return TestDriverBase.completeOptions(self);
    def actionCleanupAfter(self):
        """
        Forward this to the sub testdriver, then uninstall VBox.
        """
        fRc = True;
        if 'execute' not in self.asActions and 'all' not in self.asActions:
            fRc = self._executeSubDriver([ 'cleanup-after', ]);

        if not self._killAllVBoxProcesses():
            fRc = False;

        if not self._uninstallVBox(self._persistentVarExists(self.ksVar_Skipped)):
            fRc = False;

        if utils.getHostOs() == 'darwin':
            self._darwinUnmountDmg(fIgnoreError = True); # paranoia

        if not TestDriverBase.actionCleanupAfter(self):
            fRc = False;

        return fRc;
 def parseOption(self, asArgs, iArg):
     """
     Parse our arguments.
     """
     if asArgs[iArg] == '--':
         # End of our parameters and start of the sub driver invocation.
         iArg = self.requireMoreArgs(1, asArgs, iArg);
         assert len(self._asSubDriver) == 0;
         self._asSubDriver = asArgs[iArg:];
         self._asSubDriver[0] = self._asSubDriver[0].replace('/', os.path.sep);
         iArg = len(asArgs) - 1;
     elif asArgs[iArg] == '--vbox-build':
         # List of files to copy/download and install.
         iArg = self.requireMoreArgs(1, asArgs, iArg);
         self._asBuildUrls = asArgs[iArg].split(',');
     elif asArgs[iArg] == '--no-puel-extpack':
         self._fAutoInstallPuelExtPack = False;
     elif asArgs[iArg] == '--puel-extpack':
         self._fAutoInstallPuelExtPack = True;
     else:
         return TestDriverBase.parseOption(self, asArgs, iArg);
     return iArg + 1;
 def __init__(self):
     TestDriverBase.__init__(self);
     self._asSubDriver   = [];   # The sub driver and it's arguments.
     self._asBuildUrls   = [];   # The URLs passed us on the command line.
     self._asBuildFiles  = [];   # The downloaded file names.
     self._fAutoInstallPuelExtPack = True;
Exemple #17
0
 def __init__(self):
     TestDriverBase.__init__(self)
 def __init__(self):
     TestDriverBase.__init__(self)
     self.sOptWhich = 'immediate-sub-tests'
 def __init__(self):
     TestDriverBase.__init__(self);
Exemple #20
0
 def __init__(self):
     TestDriverBase.__init__(self);
     self.sOptWhich = 'immediate-sub-tests';