Esempio n. 1
0
    def test_submission(self, buildcfg=None):
        self.vmx_path = self.machinecfg.get_vmx_path()
        if self.vmx_path == None:
            self.vmx_path = self.get_submission_vmx_file()
        if self.vmx_path == None:
            # no vmx, nothing to do.
            _logger.error('Could not find a vmx to run')
            with open(self.error_fname, 'a') as handler:
                print >> handler, 'Error powering on the virtual machine.\n' + \
           'Unable to find .vmx file.\n'
            sys.exit(1)

        self.initialize()

        if self.asscfg.getd(self.assignment, 'assignmentstorage',
                            '').lower() != 'large':
            VM.test_submission(self)
        else:
            timeout = self.asscfg.get(self.assignment, 'Timeout')
            testcfg = {
                'input': ['tests.zip'],
                'script': ['run.sh'],
                'output': ['run-stdout.vmr', 'run-stderr.vmr'],
                'timeout': int(timeout)
            }
            super(VmWareVM, self).test_submission(testcfg)
Esempio n. 2
0
    def test_submission(self, buildcfg = None):
        self.vmx_path = self.machinecfg.get_vmx_path()
        if self.vmx_path == None:
            self.vmx_path = self.get_submission_vmx_file()
        if self.vmx_path == None:
            # no vmx, nothing to do.
            _logger.error('Could not find a vmx to run')
            with open(self.error_fname, 'a') as handler:
                print >> handler, 'Error powering on the virtual machine.\n' + \
	        		'Unable to find .vmx file.\n'
            sys.exit(1) 
            
        self.initialize()

        if self.asscfg.getd(self.assignment, 'assignmentstorage', '').lower() != 'large':
            VM.test_submission(self)
        else:
            timeout = self.asscfg.get(self.assignment, 'Timeout')
            testcfg = {
                'input'  : ['tests.zip'],
                'script' : ['run.sh'],
                'output' : ['run-stdout.vmr', 'run-stderr.vmr'],
                'timeout': int(timeout)
                }
            super(VmWareVM,self).test_submission(testcfg)