Пример #1
0
 def instrumentPost(self, problem, post,PUTName):
     
     instCommand =self.getInstrumentationCommand(problem, post, PUTName)
     instOutput = command_runner.runCommand(instCommand)
     
     
     buildCommand = self.getMsbuildCommand(problem)
     buildOutput = command_runner.runCommand(buildCommand)
Пример #2
0
def pcPostSaved(sender, instance, created, **kwargs):
    formattedMAC = []
    for i in range(0, len(instance.mac), 2):
        formattedMAC.append(instance.mac[i:i + 2])
    runCommand('dhcpdManager.py del %s && dhcpdManager.py add %s %s %s' %\
                (instance.name, instance.name,
                 ':'.join(formattedMAC), instance.ip))
    return instance
Пример #3
0
    def save_new(self, uname, realname):
        su = SysUser(user_name=uname, password=uname, realname=realname)

        @commit_on_success
        def _saveInner():
            su.save()

        _saveInner()
        for cmd in getattr(su, '_deferredCMDs', []):
            runCommand(cmd)
    def runTest(self):
        """
        Runs a Test Case
        """
        self.assertEqual(1, len(self._test) % 2,
                     'The length of test array must be odd')

        for i in range(0, len(self._test), 2):
            """
            Going through tests array and filling the states and actions arrays.
            States are even 0, 2, 4 etc.
            Actions are odd 1, 2, 5 etc.
            """
            state = self._test[i]
            #Verifies that the current machine state matches a given state.
            self._elem = verifier_runner.verifyState(self._config.states[state], self._amigo)

            if i < len(self._test)-1:
                action = self._test[i+1]
                # Running an action from actions dictionary
                command_runner.runCommand(self._config.actions[action], self._amigo)
Пример #5
0
    def RunTeacher(self, problem, PUTName,
                   precisFeatureList) -> List[FeatureVector]:
        args = self.GetExecCommand(problem.testDll, PUTName,
                                   problem.testNamespace, problem.testClass)
        pexOutput = command_runner.runCommand(args)

        self.reportBaseLocation = problem.testDebugFolder
        self.reportLocation = os.path.join(self.reportBaseLocation, self.ro,
                                           self.rn, "report.per")
        self.testsLocation = os.path.join(self.reportBaseLocation, self.ro,
                                          self.rn, "tests")
        #print (self.time)

        return self.ParseReport(problem.testDebugFolder, precisFeatureList)
Пример #6
0
    def runTest(self):
        """
        Runs a Test Case
        """
        self.assertEqual(1,
                         len(self._test) % 2,
                         'The length of test array must be odd')

        for i in range(0, len(self._test), 2):
            """
            Going through tests array and filling the states and actions arrays.
            States are even 0, 2, 4 etc.
            Actions are odd 1, 2, 5 etc.
            """
            state = self._test[i]
            #Verifies that the current machine state matches a given state.
            self._elem = verifier_runner.verifyState(
                self._config.states[state], self._amigo)

            if i < len(self._test) - 1:
                action = self._test[i + 1]
                # Running an action from actions dictionary
                command_runner.runCommand(self._config.actions[action],
                                          self._amigo)
Пример #7
0
 def stop(self):
     runCommand()
Пример #8
0
 def start(self):
     runCommand('wakeonlan -i %s.255 %s' % (NET_PART, self.formattedMAC()))
Пример #9
0
 def status(self):
     return runCommand('ping -c 1 -W 1 %s' % self.ip) == 0
Пример #10
0
def pcPreDelete(sender, instance, **kwargs):
    runCommand('dhcpdManager.py del %s' % instance.name)
    return instance