示例#1
0
 def testRestart2(self):
     self.openRepository()
     self.openRmakeRepository()
     jobId = fixtures.addMultiContextJob1(self)
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     assert (txt == 'warning: Context nossl used in job 1 does not exist\n')
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert (kw['configDict']['nossl'])
     assert (len(args) == 1 and len(args[0]) == 2)  # building both troves
     assert (set([x[3] for x in args[0]]) == set(['', 'nossl']))
     self.buildCfg.setSection('nossl')
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     assert (txt == '')
示例#2
0
 def testRestart2(self):
     self.openRepository()
     self.openRmakeRepository()
     jobId = fixtures.addMultiContextJob1(self)
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     assert(txt == 'warning: Context nossl used in job 1 does not exist\n')
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert(kw['configDict']['nossl'])
     assert(len(args) == 1 and len(args[0]) == 2) # building both troves
     assert(set([x[3] for x in args[0]]) == set(['', 'nossl']))
     self.buildCfg.setSection('nossl')
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     assert(txt == '')
示例#3
0
 def testRestartUpdateConfig(self):
     self.openRepository()
     self.openRmakeRepository()
     jobId = fixtures.addMultiContextJob1(self)
     oldILP = self.buildCfg.installLabelPath
     self.buildCfg.installLabelPath = [ self.cfg.buildLabel,
                                   versions.Label('localhost@rpl:branch') ]
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert(kw['configDict']['nossl'].installLabelPath == oldILP)
     rc, txt = self.captureOutput(helper.restartJob, jobId,
                                 updateConfigKeys=['installLabelPath'])
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert(kw['configDict']['nossl'])
     assert(kw['configDict']['nossl'].installLabelPath
                             == self.buildCfg.installLabelPath)
示例#4
0
    def testCommitMultipleContexts(self):
        self.openRepository()
        self.openRmakeRepository()
        jobId = fixtures.addMultiContextJob1(self)
        client = self.startRmakeServer()
        helper = self.getRmakeHelper(client.uri)
        rc, txt = self.captureOutput(helper.commitJob, jobId)
        self.assertEquals(txt, '''
Committed job 1:
    testcase3:source=/localhost@rpl:linux/1-1[%s] ->
       testcase3=/localhost@rpl:linux/1-1-1[]
       testcase3-pkg=/localhost@rpl:linux/1-1-1[]

warning: Not committing testcase3, testcase3-pkg on /localhost@rpl:linux//rmakehost@local:linux/1-2-0.1[]{nossl} - overridden by /localhost@rpl:linux//rmakehost@local:linux/1-1-0.1[]
''' % self.getArchFlavor())
        restartJobId = self.discardOutput(helper.restartJob, jobId)
        helper.waitForJob(restartJobId)
        job = helper.getJob(restartJobId)
        assert(job.isBuilt())
        rc, txt = self.captureOutput(helper.commitJob, restartJobId)
        self.assertEquals(txt,
                    'warning: All built troves have already been committed\n')
示例#5
0
    def testCommitMultipleContexts(self):
        self.openRepository()
        self.openRmakeRepository()
        jobId = fixtures.addMultiContextJob1(self)
        client = self.startRmakeServer()
        helper = self.getRmakeHelper(client.uri)
        rc, txt = self.captureOutput(helper.commitJob, jobId)
        self.assertEquals(
            txt, '''
Committed job 1:
    testcase3:source=/localhost@rpl:linux/1-1[%s] ->
       testcase3=/localhost@rpl:linux/1-1-1[]
       testcase3-pkg=/localhost@rpl:linux/1-1-1[]

warning: Not committing testcase3, testcase3-pkg on /localhost@rpl:linux//rmakehost@local:linux/1-2-0.1[]{nossl} - overridden by /localhost@rpl:linux//rmakehost@local:linux/1-1-0.1[]
''' % self.getArchFlavor())
        restartJobId = self.discardOutput(helper.restartJob, jobId)
        helper.waitForJob(restartJobId)
        job = helper.getJob(restartJobId)
        assert (job.isBuilt())
        rc, txt = self.captureOutput(helper.commitJob, restartJobId)
        self.assertEquals(
            txt, 'warning: All built troves have already been committed\n')
示例#6
0
 def testRestartUpdateConfig(self):
     self.openRepository()
     self.openRmakeRepository()
     jobId = fixtures.addMultiContextJob1(self)
     oldILP = self.buildCfg.installLabelPath
     self.buildCfg.installLabelPath = [
         self.cfg.buildLabel,
         versions.Label('localhost@rpl:branch')
     ]
     helper = self.getRmakeHelper()
     mock.mockMethod(helper.buildJob)
     mock.mockMethod(helper._createBuildJob)
     rc, txt = self.captureOutput(helper.restartJob, jobId)
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert (kw['configDict']['nossl'].installLabelPath == oldILP)
     rc, txt = self.captureOutput(helper.restartJob,
                                  jobId,
                                  updateConfigKeys=['installLabelPath'])
     args, kw = helper._createBuildJob._mock.popCall()
     kw = dict(kw)
     assert (kw['configDict']['nossl'])
     assert (kw['configDict']['nossl'].installLabelPath ==
             self.buildCfg.installLabelPath)