init: Drop database from comps repo
It should not be needed there, since the repo is empty anyway. A test is added for the variant specific comps repo. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
89d798006b
commit
1afb709404
@ -149,10 +149,12 @@ def create_comps_repo(compose, arch, variant):
|
|||||||
compose.log_warning("[SKIP ] %s" % msg)
|
compose.log_warning("[SKIP ] %s" % msg)
|
||||||
else:
|
else:
|
||||||
compose.log_info("[BEGIN] %s" % msg)
|
compose.log_info("[BEGIN] %s" % msg)
|
||||||
cmd = repo.get_createrepo_cmd(comps_repo, update=True, database=True, skip_stat=True,
|
cmd = repo.get_createrepo_cmd(comps_repo, database=False,
|
||||||
outputdir=comps_repo, groupfile=comps_path,
|
outputdir=comps_repo, groupfile=comps_path,
|
||||||
checksum=createrepo_checksum)
|
checksum=createrepo_checksum)
|
||||||
run(cmd, logfile=compose.paths.log.log_file(arch, "comps_repo"), show_cmd=True)
|
logfile = 'comps_repo-%s' % variant if variant else 'comps_repo'
|
||||||
|
run(cmd, logfile=compose.paths.log.log_file(arch, logfile),
|
||||||
|
show_cmd=True)
|
||||||
compose.log_info("[DONE ] %s" % msg)
|
compose.log_info("[DONE ] %s" % msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,11 +142,29 @@ class TestCreateCompsRepo(PungiTestCase):
|
|||||||
[mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo',
|
[mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo',
|
||||||
'--outputdir=%s/work/x86_64/comps_repo' % self.topdir,
|
'--outputdir=%s/work/x86_64/comps_repo' % self.topdir,
|
||||||
'--groupfile=%s/work/x86_64/comps/comps-x86_64.xml' % self.topdir,
|
'--groupfile=%s/work/x86_64/comps/comps-x86_64.xml' % self.topdir,
|
||||||
'--update', '--skip-stat', '--database', '--checksum=sha256',
|
'--update', '--no-database', '--checksum=sha256',
|
||||||
'--unique-md-filenames'],
|
'--unique-md-filenames'],
|
||||||
logfile=self.topdir + '/logs/x86_64/comps_repo.x86_64.log',
|
logfile=self.topdir + '/logs/x86_64/comps_repo.x86_64.log',
|
||||||
show_cmd=True)])
|
show_cmd=True)])
|
||||||
|
|
||||||
|
@mock.patch('pungi.phases.init.run')
|
||||||
|
def test_run_with_variant(self, run):
|
||||||
|
compose = DummyCompose(self.topdir, {
|
||||||
|
'createrepo_checksum': 'sha256',
|
||||||
|
})
|
||||||
|
compose.DEBUG = False
|
||||||
|
|
||||||
|
init.create_comps_repo(compose, 'x86_64', compose.variants['Server'])
|
||||||
|
|
||||||
|
self.assertEqual(run.mock_calls,
|
||||||
|
[mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo_Server',
|
||||||
|
'--outputdir=%s/work/x86_64/comps_repo_Server' % self.topdir,
|
||||||
|
'--groupfile=%s/work/x86_64/comps/comps-Server.x86_64.xml' % self.topdir,
|
||||||
|
'--update', '--no-database', '--checksum=sha256',
|
||||||
|
'--unique-md-filenames'],
|
||||||
|
logfile=self.topdir + '/logs/x86_64/comps_repo-Server.x86_64.log',
|
||||||
|
show_cmd=True)])
|
||||||
|
|
||||||
@mock.patch('pungi.phases.init.run')
|
@mock.patch('pungi.phases.init.run')
|
||||||
def test_run_in_debug(self, run):
|
def test_run_in_debug(self, run):
|
||||||
compose = DummyCompose(self.topdir, {
|
compose = DummyCompose(self.topdir, {
|
||||||
|
Loading…
Reference in New Issue
Block a user