Example #1
0
 def test_install(self):
     mock_cipd = MockCipd()
     mock_cipd.install()
     self.assertEqual(
         mock_cipd.last,
         mock_cipd._bin + ' install fuchsia/test_data/fuzzing/' +
         str(mock_cipd.fuzzer) + ' --root ' + mock_cipd.root)
Example #2
0
 def test_create(self):
     mock_cipd = MockCipd()
     mock_cipd.create()
     self.assertIn(
         mock_cipd._bin + ' create --pkg-def ' + os.path.join(
             mock_cipd.root, 'cipd.yaml') +
         ' --ref latest --tag integration:' + mock_cipd.host.snapshot(),
         mock_cipd.history)
Example #3
0
    def test_create(self):
        mock_cipd = MockCipd()
        corpus = mock_cipd.corpus
        host = corpus.fuzzer.device.host

        mock_cipd.create()
        self.assertIn(
            mock_cipd._bin + ' create --pkg-def ' + os.path.join(
                corpus.root, 'cipd.yaml') + ' --ref latest --tag integration:' +
            host.snapshot(), host.history)
Example #4
0
    def test_instances(self):
        mock_cipd = MockCipd()
        corpus = mock_cipd.corpus
        fuzzer = corpus.fuzzer
        host = fuzzer.device.host

        output = mock_cipd.instances()
        self.assertIn(
            mock_cipd._bin + ' instances fuchsia/test_data/fuzzing/' +
            str(fuzzer), host.history)
        self.assertIn('some-version', output)
Example #5
0
    def test_install(self):
        mock_cipd = MockCipd()
        corpus = mock_cipd.corpus
        fuzzer = corpus.fuzzer
        host = fuzzer.device.host

        self.assertFalse(mock_cipd.install('latest'))

        mock_cipd.add_version('latest')
        self.assertTrue(mock_cipd.install('latest'))
        self.assertIn(
            'CWD=' + corpus.root + ' ' + mock_cipd._bin +
            ' install fuchsia/test_data/fuzzing/' + str(fuzzer) + ' latest',
            host.history)

        mock_cipd.add_version('some-version')
        mock_cipd.install('integration:some-revision')
        self.assertIn(
            ' '.join([
                'CWD=' + corpus.root, mock_cipd._bin, 'install',
                'fuchsia/test_data/fuzzing/' + str(fuzzer), 'some-version'
            ]), host.history)
Example #6
0
 def test_install(self):
     mock_cipd = MockCipd()
     mock_cipd.install()
     self.assertIn(
         'CWD=' + mock_cipd.root + ' ' + mock_cipd._bin +
         ' install fuchsia/test_data/fuzzing/' + str(
             mock_cipd.fuzzer) + ' latest', mock_cipd.history)
     mock_cipd.label = 'integration:f581cfbbb07fd975f2008ddfed7a9d9f92491375'
     mock_cipd.install()
     self.assertIn(
         'CWD=' + mock_cipd.root + ' ' + mock_cipd._bin +
         ' install fuchsia/test_data/fuzzing/' + str(mock_cipd.fuzzer) +
         ' s4BNxLyjxJIdZWumbZZtIf1a5TdrjGSpvEbSxQhQBE4C', mock_cipd.history)
Example #7
0
 def test_create(self):
     mock_cipd = MockCipd()
     mock_cipd.create()
     self.assertEqual(
         mock_cipd.last, mock_cipd._bin + ' create --pkg-def ' +
         os.path.join(mock_cipd.root, 'cipd.yaml') + ' --ref latest')
Example #8
0
 def test_list(self):
     mock_cipd = MockCipd()
     mock_cipd.list()
     self.assertEqual(
         mock_cipd.last, mock_cipd._bin +
         ' instances fuchsia/test_data/fuzzing/' + str(mock_cipd.fuzzer))