Ejemplo n.º 1
0
    def test_pattern(self):
        """ Import several Particles from a given pattern.
        """

        # Check stress-ng is installed
        print "Command exists?&&&&&&&&&&&&&&&&&&& %s" % commandExists(STRESS_NG)
        self.assertTrue(commandExists(STRESS_NG), "This test requires to have %s installed" % STRESS_NG)

        kwargs = {'noCpu': 2,
                'noMem': 0,
                'amountMem': 256,
                'timeout':10,
                'delay':1
                }
        
        #put some stress on the system
        prot1 = self.newProtocol(ProtStress, **kwargs)
        prot1.setObjLabel('stress')
        self.proj.launchProtocol(prot1,wait=False)

        #TODO fill protol pointer
        kwargs = {'samplingInterval': 1,
                'interval': 20
                }
        prot2 = self.newProtocol(ProtMonitorSystem, **kwargs)
        prot2.inputProtocols.append(prot1)
        self.launchProtocol(prot2)

        baseFn = prot2._getPath(SYSTEM_LOG_SQLITE)
        import os.path
        #not sure what to test here
        print baseFn
        self.assertTrue(os.path.isfile(baseFn))
Ejemplo n.º 2
0
def validateInstallation():
    """ This function will be used to check if ATSAS is properly installed. """
    missingPaths = []

    if not (commandExists(CRYSOL)):
        missingPaths.append("%s not found in the system" % CRYSOL)

    if missingPaths:
        return ["Missing variables:"] + missingPaths
    else:
        return []  # No errors
Ejemplo n.º 3
0
def validateInstallation():
    """ This function will be used to check if ATSAS is properly installed. """
    missingPaths = []

    if not (commandExists(CRYSOL)):
        missingPaths.append("%s not found in the system" % CRYSOL)

    if missingPaths:
        return ["Missing variables:"] + missingPaths
    else:
        return [] # No errors
Ejemplo n.º 4
0
    def validateInstallation(cls):
        """ This function will be used to check if PDFto latex is available. """
        missingPaths = []

        from pyworkflow.utils import commandExists
        if not (commandExists(PDFLATEX)):
            missingPaths.append("%s not found in the system" % PDFLATEX)

        if missingPaths:
            return ["Missing variables:"] + missingPaths
        else:
            return []  # No errors
Ejemplo n.º 5
0
def validateInstallation():
    """ This function will be used to check if RELION is properly installed. """
    missingPaths = []

    if not (os.path.exists(os.environ.get(ETHAN_HOME))
            or commandExists(ETHAN)):
        missingPaths.append("%s or %s: %s" % (ETHAN_HOME, ETHAN,
                                              "Ethan not found in the system"))

    if missingPaths:
        return ["Missing variables:"] + missingPaths
    else:
        return [] # No errors
Ejemplo n.º 6
0
def validateInstallation():
    """ This function will be used to check if RELION is properly installed. """
    missingPaths = []

    if not (os.path.exists(os.environ.get(ETHAN_HOME))
            or commandExists(ETHAN)):
        missingPaths.append(
            "%s or %s: %s" %
            (ETHAN_HOME, ETHAN, "Ethan not found in the system"))

    if missingPaths:
        return ["Missing variables:"] + missingPaths
    else:
        return []  # No errors
    def test_pattern(self):
        """ Import several Particles from a given pattern.
        """

        # Check stress-ng is installed
        self.assertTrue(
            pwutils.commandExists(emprot.STRESS_NG),
            "This test requires to have %s installed" % emprot.STRESS_NG)

        kwargs = {
            'noCpu': 2,
            'noMem': 0,
            'amountMem': 256,
            'timeout': 10,
            'delay': 1
        }

        # put some stress on the system
        prot1 = self.newProtocol(emprot.ProtStress, **kwargs)
        prot1.setObjLabel('stress')
        self.proj.launchProtocol(prot1, wait=False)

        # TODO fill protol pointer
        kwargs = {
            "samplingInterval": 2,
            "cpuAlert": 101.0,
            "memAlert": 101.0,
            "swapAlert": 101.0,
            "monitorTime": 300.0,
            "doMail": True,
            "emailFrom": "*****@*****.**",
            "emailTo": "*****@*****.**",
            "smtp": "smtp.fakeadress.com",
            "doGpu": False,
            "gpusToUse": "0",
            "doNetwork": True,
            "netInterfaces": 1,
            "doDiskIO": True
        }

        prot2 = self.newProtocol(monitorsProt.ProtMonitorSystem, **kwargs)
        prot2.inputProtocols.append(prot1)
        self.launchProtocol(prot2)

        baseFn = prot2._getPath(monitorsProt.SYSTEM_LOG_SQLITE)

        # not sure what to test here
        self.assertTrue(os.path.isfile(baseFn))
Ejemplo n.º 8
0
    def test_pattern(self):
        """ Import several Particles from a given pattern.
        """

        # Check stress-ng is installed
        self.assertTrue(commandExists(STRESS_NG),
                        "This test requires to have %s installed" % STRESS_NG)

        kwargs = {'noCpu': 2,
                  'noMem': 0,
                  'amountMem': 256,
                  'timeout': 10,
                  'delay': 1}

        # put some stress on the system
        prot1 = self.newProtocol(ProtStress, **kwargs)
        prot1.setObjLabel('stress')
        self.proj.launchProtocol(prot1, wait=False)

        # TODO fill protol pointer
        kwargs = {
            "samplingInterval": 2,
            "cpuAlert": 101.0,
            "memAlert": 101.0,
            "swapAlert": 101.0,
            "monitorTime": 300.0,
            "doMail": True,
            "emailFrom": "*****@*****.**",
            "emailTo": "*****@*****.**",
            "smtp": "smtp.fakeadress.com",
            "doGpu": False,
            "gpusToUse": "0",
            "doNetwork": True,
            "netInterfaces": 1,
            "doDiskIO": True}

        prot2 = self.newProtocol(ProtMonitorSystem, **kwargs)
        prot2.inputProtocols.append(prot1)
        self.launchProtocol(prot2)

        baseFn = prot2._getPath(SYSTEM_LOG_SQLITE)

        # not sure what to test here
        self.assertTrue(os.path.isfile(baseFn))