Fix tests for DNF 3

The configuration for modules has changed.

Lookaside handling has changed, and there are now test failures. This
is a not a bug in DNF, so we need to fix it on our side.

Relates: https://bugzilla.redhat.com/show_bug.cgi?id=1603123
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-07-04 09:16:51 +02:00
parent 9ca454007a
commit 7d099012aa
2 changed files with 23 additions and 2 deletions

View file

@ -22,6 +22,7 @@ os.environ['PATH'] = '%s:%s' % (BINDIR, os.environ['PATH'])
from pungi.wrappers.pungi import PungiWrapper
try:
from dnf import __version__ as dnf_version
from pungi.dnf_wrapper import DnfWrapper, Conf
from pungi.gather_dnf import Gather, GatherOptions, PkgFlag
HAS_DNF = True
@ -1810,7 +1811,10 @@ class DNFDepsolvingTestCase(DepsolvingBase, unittest.TestCase):
conf = Conf(base_arch)
conf.persistdir = persistdir
conf.cachedir = self.cachedir
conf.modulesdir = os.path.join(persistdir, 'modules.d')
if int(dnf_version.split('.')[0]) < 3:
conf.modulesdir = os.path.join(persistdir, 'modules.d')
else:
conf.modulesdir._set(os.path.join(persistdir, 'modules.d'))
if exclude:
conf.exclude = exclude
dnf = DnfWrapper(conf)