def BuildAutotestTarballs(self): """Build the autotest tarballs.""" with osutils.TempDir(prefix='cbuildbot-autotest') as tempdir: with self.ArtifactUploader(strict=True) as queue: cwd = os.path.abspath( os.path.join(self._build_root, 'chroot', 'build', self._current_board, constants.AUTOTEST_BUILD_PATH, '..')) control_files_tarball = commands.BuildAutotestControlFilesTarball( self._build_root, cwd, tempdir) queue.put([control_files_tarball]) packages_tarball = commands.BuildAutotestPackagesTarball( self._build_root, cwd, tempdir) queue.put([packages_tarball]) # Tar up the test suites. test_suites_tarball = commands.BuildAutotestTestSuitesTarball( self._build_root, cwd, tempdir) queue.put([test_suites_tarball]) # Build the server side package. server_tarball = commands.BuildAutotestServerPackageTarball( self._build_root, cwd, tempdir) queue.put([server_tarball])
def testBuildAutotestServerPackageTarball(self): """Tests that generating the autotest server package tarball is correct.""" control_file_list = ['autotest/server/site_tests/testA/control', 'autotest/server/site_tests/testB/control'] self.PatchObject(commands, 'FindFilesWithPattern', return_value=control_file_list) tar_mock = self.PatchObject(commands, 'BuildTarball') commands.BuildAutotestServerPackageTarball(self._buildroot, self._cwd, self._tarball_dir) tar_mock.assert_called_once_with( self._buildroot, control_file_list, os.path.join(self._tarball_dir, 'autotest_server_package.tar.bz2'), cwd=self._cwd, error_code_ok=True)