예제 #1
0
  def testCbuildbotDefault(self):
    """Test default cbuildbot buildroot."""
    self.SetupCommandMock(['--cbuildbot', 'config'])
    options = self.cmd_mock.inst.options

    cros_tryjob.AdjustOptions(options)

    self.assertTrue(options.buildroot.endswith('/cbuild'))
예제 #2
0
  def testLocalExplicit(self):
    """Test explicit local buildroot."""
    self.SetupCommandMock(['--local', '--buildroot', '/buildroot', 'config'])
    options = self.cmd_mock.inst.options

    cros_tryjob.AdjustOptions(options)

    self.assertEqual(options.buildroot, '/buildroot')
예제 #3
0
  def testLocalDefault(self):
    """Test default local buildroot."""
    self.SetupCommandMock(['--local', 'config'])
    options = self.cmd_mock.inst.options

    cros_tryjob.AdjustOptions(options)

    self.assertTrue(options.buildroot.endswith('/tryjob'))
예제 #4
0
  def testRemote(self):
    """Test default remote buildroot."""
    self.SetupCommandMock(['config'])
    options = self.cmd_mock.inst.options

    cros_tryjob.AdjustOptions(options)

    self.assertIsNone(options.buildroot)
    def helperOptionsToCbuildbotArgs(self, args_in):
        """Convert cros tryjob arguments -> cbuildbot arguments.

    Does not do all intermediate steps, only for testing CbuildbotArgs.
    """
        self.SetupCommandMock(args_in)
        options = self.cmd_mock.inst.options
        cros_tryjob.AdjustOptions(options)
        args_out = cros_tryjob.CbuildbotArgs(options)
        return args_out
    def testCbuildbotExplicit(self):
        """Test explicit cbuildbot buildroot."""
        self.SetupCommandMock([
            '--cbuildbot', '--buildroot', '/buildroot', '--git-cache-dir',
            '/git-cache', 'config'
        ])
        options = self.cmd_mock.inst.options

        cros_tryjob.AdjustOptions(options)

        self.assertEqual(options.buildroot, '/buildroot')
        self.assertEqual(options.git_cache_dir, '/git-cache')