diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2023-02-16 13:56:45 -0500 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2023-02-17 11:57:58 -0500 |
commit | bde852acd5f5a20e20e66d51b4f6d855aa34316c (patch) | |
tree | 1474893ac408713a68356fbc78d8d1fcd228d1a6 /tests/report_tests | |
parent | b29ab8e997a066efcd8c5508905c3b265f99a7d5 (diff) | |
download | sos-bde852acd5f5a20e20e66d51b4f6d855aa34316c.tar.gz |
[tests] Add version consistency test
Commits a downstream test from RHEL to ensure that a given release has a
consistent version string in the UI report, manifest, and most
importantly for the package nvr for an sos package built from the
current branch. Note that this test is only implemented for RPM
installations at this time.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/report_tests')
-rw-r--r-- | tests/report_tests/basic_report_tests.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/report_tests/basic_report_tests.py b/tests/report_tests/basic_report_tests.py index c5d7d3ae..a6fdf003 100644 --- a/tests/report_tests/basic_report_tests.py +++ b/tests/report_tests/basic_report_tests.py @@ -6,8 +6,9 @@ # # See the LICENSE file in the source distribution for further information. - -from sos_tests import StageOneReportTest +from avocado.core.exceptions import TestSkipError +from avocado.utils import process +from sos_tests import StageOneReportTest, redhat_only class NormalSoSReport(StageOneReportTest): @@ -43,6 +44,15 @@ class NormalSoSReport(StageOneReportTest): "Tag summary malformed" ) + @redhat_only + def test_version_matches_package(self): + if not self.params.get('TESTLOCAL') == 'true': + raise TestSkipError("Not testing local package installation") + _pkg_ver = process.run('rpm -q sos').stdout.decode().split('-')[1] + self.assertSosUILogContains(f"(version {_pkg_ver})") + self.assertEqual(self.manifest['version'], _pkg_ver) + + class LogLevelTest(StageOneReportTest): """ :avocado: tags=stageone |