tests: Select the group to use based on the release

Use c-development on fedora and development on RHEL

Related: rhbz#1678937
This commit is contained in:
Brian C. Lane 2019-04-02 14:17:36 -07:00
parent 33dfeed5bb
commit a2252112d4
2 changed files with 12 additions and 1 deletions

View File

@ -42,3 +42,9 @@ def get_file_magic(filename):
finally:
ms.close()
return details
def this_is_rhel():
"""Check to see if the tests are running on RHEL
"""
release = open("/etc/system-release", "r").read()
return "Red Hat Enterprise Linux" in release

View File

@ -22,6 +22,7 @@ import tempfile
import time
import unittest
from ..lib import this_is_rhel
from pylorax.sysutils import joinpaths
from pylorax.api.config import configure, make_dnf_dirs
from pylorax.api.projects import api_time, api_changelog, pkg_to_project, pkg_to_project_info, pkg_to_dep
@ -196,7 +197,11 @@ class ProjectsTest(unittest.TestCase):
self.assertEqual(modules[0]["dependencies"][0]["name"], "basesystem")
def test_groups_depsolve(self):
deps = projects_depsolve(self.dbo, [], ["c-development"])
if this_is_rhel():
group_names = ["development"]
else:
group_names = ["c-development"]
deps = projects_depsolve(self.dbo, [], group_names)
names = [grp["name"] for grp in deps]
self.assertTrue("autoconf" in names) # mandatory package
self.assertTrue("ctags" in names) # default package