Ejemplo n.º 1
0
    def setUp(self):
        super(TestUpdateInfoMetadata, self).setUp()

        self._new_mash_stage_dir = tempfile.mkdtemp()
        self._mash_stage_dir = config['mash_stage_dir']
        self._mash_dir = config['mash_dir']
        config['mash_stage_dir'] = self._new_mash_stage_dir
        config['mash_dir'] = os.path.join(config['mash_stage_dir'], 'mash')
        os.makedirs(os.path.join(config['mash_dir'], 'f17-updates-testing'))

        # Initialize our temporary repo
        self.tempdir = tempfile.mkdtemp('bodhi')
        self.tempcompdir = join(self.tempdir, 'f17-updates-testing')
        self.temprepo = join(self.tempcompdir, 'compose', 'Everything', 'i386',
                             'os')
        mkmetadatadir(self.temprepo)
        mkmetadatadir(
            join(self.tempcompdir, 'compose', 'Everything', 'source', 'tree'))
        self.repodata = join(self.temprepo, 'repodata')
        assert exists(join(self.repodata, 'repomd.xml'))

        DevBuildsys.__rpms__ = [{
            'arch': 'src',
            'build_id': 6475,
            'buildroot_id': 1883,
            'buildtime': 1178868422,
            'epoch': None,
            'id': 62330,
            'name': 'bodhi',
            'nvr': 'bodhi-2.0-1.fc17',
            'release': '1.fc17',
            'size': 761742,
            'version': '2.0'
        }]
Ejemplo n.º 2
0
 def setUp(self):
     """
     Initialize our temporary repo.
     """
     super(TestAddUpdate, self).setUp()
     setup_buildsystem({'buildsystem': 'dev'})
     self.tempdir = tempfile.mkdtemp('bodhi')
     self.temprepo = join(self.tempdir, 'f17-updates-testing')
     mkmetadatadir(join(self.temprepo, 'f17-updates-testing', 'i386'))
Ejemplo n.º 3
0
 def setUp(self):
     """
     Initialize our temporary repo.
     """
     super(UpdateInfoMetadataTestCase, self).setUp()
     setup_buildsystem({'buildsystem': 'dev'})
     self.tempdir = tempfile.mkdtemp('bodhi')
     self.tempcompdir = join(self.tempdir, 'f17-updates-testing')
     self.temprepo = join(self.tempcompdir, 'compose', 'Everything', 'i386', 'os')
     mkmetadatadir(join(self.temprepo, 'f17-updates-testing', 'i386'))
     config['cache_dir'] = os.path.join(self.tempdir, 'cache')
     os.makedirs(config['cache_dir'])
Ejemplo n.º 4
0
    def test_extended_metadata_cache(self):
        """Asserts that when the same update is retrieved twice, the info is unshelved.

        After the first run, we clear the buildsystem.__rpms__ so that there would be no way to
        again retrieve the info from the buildsystem, and it'll have to be returned from the
        cache.
        """
        self._test_extended_metadata(True)
        shutil.rmtree(self.temprepo)
        mkmetadatadir(self.temprepo)
        mkmetadatadir(join(self.tempcompdir, 'compose', 'Everything', 'source', 'tree'))
        DevBuildsys.__rpms__ = []
        self._test_extended_metadata(True)