diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/rpm.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rpm.py b/meta/lib/oeqa/runtime/cases/rpm.py index a4ba4e6769..ea5619ffea 100644 --- a/meta/lib/oeqa/runtime/cases/rpm.py +++ b/meta/lib/oeqa/runtime/cases/rpm.py | |||
| @@ -80,21 +80,24 @@ class RpmBasicTest(OERuntimeTestCase): | |||
| 80 | 80 | ||
| 81 | class RpmInstallRemoveTest(OERuntimeTestCase): | 81 | class RpmInstallRemoveTest(OERuntimeTestCase): |
| 82 | 82 | ||
| 83 | @classmethod | 83 | def _find_test_file(self): |
| 84 | def setUpClass(cls): | 84 | pkgarch = self.td['TUNE_PKGARCH'].replace('-', '_') |
| 85 | pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_') | 85 | rpmdir = os.path.join(self.tc.td['DEPLOY_DIR'], 'rpm', pkgarch) |
| 86 | rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch) | ||
| 87 | # Pick base-passwd-doc as a test file to get installed, because it's small | 86 | # Pick base-passwd-doc as a test file to get installed, because it's small |
| 88 | # and it will always be built for standard targets | 87 | # and it will always be built for standard targets |
| 89 | rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch | 88 | rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch |
| 90 | if not os.path.exists(rpmdir): | 89 | if not os.path.exists(rpmdir): |
| 91 | return | 90 | self.fail("Rpm directory {} does not exist".format(rpmdir)) |
| 92 | for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc): | 91 | for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc): |
| 93 | cls.test_file = os.path.join(rpmdir, f) | 92 | self.test_file = os.path.join(rpmdir, f) |
| 94 | cls.dst = '/tmp/base-passwd-doc.rpm' | 93 | break |
| 94 | else: | ||
| 95 | self.fail("Couldn't find the test rpm file {} in {}".format(rpm_doc, rpmdir)) | ||
| 96 | self.dst = '/tmp/base-passwd-doc.rpm' | ||
| 95 | 97 | ||
| 96 | @OETestDepends(['rpm.RpmBasicTest.test_rpm_query']) | 98 | @OETestDepends(['rpm.RpmBasicTest.test_rpm_query']) |
| 97 | def test_rpm_install(self): | 99 | def test_rpm_install(self): |
| 100 | self._find_test_file() | ||
| 98 | self.tc.target.copyTo(self.test_file, self.dst) | 101 | self.tc.target.copyTo(self.test_file, self.dst) |
| 99 | status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm') | 102 | status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm') |
| 100 | msg = 'Failed to install base-passwd-doc package: %s' % output | 103 | msg = 'Failed to install base-passwd-doc package: %s' % output |
| @@ -117,6 +120,7 @@ class RpmInstallRemoveTest(OERuntimeTestCase): | |||
| 117 | Author: Alexander Kanavin <alex.kanavin@gmail.com> | 120 | Author: Alexander Kanavin <alex.kanavin@gmail.com> |
| 118 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 121 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> |
| 119 | """ | 122 | """ |
| 123 | self._find_test_file() | ||
| 120 | db_files_cmd = 'ls /var/lib/rpm/rpmdb.sqlite*' | 124 | db_files_cmd = 'ls /var/lib/rpm/rpmdb.sqlite*' |
| 121 | check_log_cmd = "grep RPM /var/log/messages | wc -l" | 125 | check_log_cmd = "grep RPM /var/log/messages | wc -l" |
| 122 | 126 | ||
