diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-06-14 12:52:32 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-25 22:27:45 +0000 |
commit | 0676240f4c3c72646557c5d940a997ae0cf164f0 (patch) | |
tree | c97a616d7956557c0b82550e9d019a6444772b4c | |
parent | c172c8fdc63ddc139240b550523eb4f05fd540d7 (diff) | |
download | poky-0676240f4c3c72646557c5d940a997ae0cf164f0.tar.gz |
oeqa/runtime/cases/rpm.py: change to use base-passwd-doc
The test cases assume that rpm-doc is built out, as it says it its
comment. This is not always true. And it sometimes results in
following error.
| cls.tc.target.copyTo(test_file, dst)
| UnboundLocalError: local variable 'test_file' referenced before assignment
Change to use base-passwd-doc, as this package is more likely to be
built out than rpm-doc.
(From OE-Core rev: 2e23543b48921182307065c1fa9e8b9d7fbb3cdc)
(From OE-Core rev: 1ce378ce07d2c49f40054893a623456c8471e177)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/runtime/cases/rpm.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rpm.py b/meta/lib/oeqa/runtime/cases/rpm.py index 58df28bd29..1e5e4631d3 100644 --- a/meta/lib/oeqa/runtime/cases/rpm.py +++ b/meta/lib/oeqa/runtime/cases/rpm.py | |||
@@ -39,31 +39,31 @@ class RpmInstallRemoveTest(OERuntimeTestCase): | |||
39 | 39 | ||
40 | pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_') | 40 | pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_') |
41 | rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch) | 41 | rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch) |
42 | # Pick rpm-doc as a test file to get installed, because it's small | 42 | # Pick base-passwd-doc as a test file to get installed, because it's small |
43 | # and it will always be built for standard targets | 43 | # and it will always be built for standard targets |
44 | rpm_doc = 'rpm-doc-*.%s.rpm' % pkgarch | 44 | rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch |
45 | for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc): | 45 | for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc): |
46 | test_file = os.path.join(rpmdir, f) | 46 | test_file = os.path.join(rpmdir, f) |
47 | dst = '/tmp/rpm-doc.rpm' | 47 | dst = '/tmp/base-passwd-doc.rpm' |
48 | cls.tc.target.copyTo(test_file, dst) | 48 | cls.tc.target.copyTo(test_file, dst) |
49 | 49 | ||
50 | @classmethod | 50 | @classmethod |
51 | def tearDownClass(cls): | 51 | def tearDownClass(cls): |
52 | dst = '/tmp/rpm-doc.rpm' | 52 | dst = '/tmp/base-passwd-doc.rpm' |
53 | cls.tc.target.run('rm -f %s' % dst) | 53 | cls.tc.target.run('rm -f %s' % dst) |
54 | 54 | ||
55 | @OETestID(192) | 55 | @OETestID(192) |
56 | @OETestDepends(['rpm.RpmBasicTest.test_rpm_help']) | 56 | @OETestDepends(['rpm.RpmBasicTest.test_rpm_help']) |
57 | def test_rpm_install(self): | 57 | def test_rpm_install(self): |
58 | status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm') | 58 | status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm') |
59 | msg = 'Failed to install rpm-doc package: %s' % output | 59 | msg = 'Failed to install base-passwd-doc package: %s' % output |
60 | self.assertEqual(status, 0, msg=msg) | 60 | self.assertEqual(status, 0, msg=msg) |
61 | 61 | ||
62 | @OETestID(194) | 62 | @OETestID(194) |
63 | @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install']) | 63 | @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install']) |
64 | def test_rpm_remove(self): | 64 | def test_rpm_remove(self): |
65 | status,output = self.target.run('rpm -e rpm-doc') | 65 | status,output = self.target.run('rpm -e base-passwd-doc') |
66 | msg = 'Failed to remove rpm-doc package: %s' % output | 66 | msg = 'Failed to remove base-passwd-doc package: %s' % output |
67 | self.assertEqual(status, 0, msg=msg) | 67 | self.assertEqual(status, 0, msg=msg) |
68 | 68 | ||
69 | @OETestID(1096) | 69 | @OETestID(1096) |
@@ -119,16 +119,16 @@ class RpmInstallRemoveTest(OERuntimeTestCase): | |||
119 | self.assertEqual(0, status, msg=msg) | 119 | self.assertEqual(0, status, msg=msg) |
120 | 120 | ||
121 | # Remove the package just in case | 121 | # Remove the package just in case |
122 | self.target.run('rpm -e rpm-doc') | 122 | self.target.run('rpm -e base-passwd-doc') |
123 | 123 | ||
124 | # Install/Remove a package 10 times | 124 | # Install/Remove a package 10 times |
125 | for i in range(10): | 125 | for i in range(10): |
126 | status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm') | 126 | status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm') |
127 | msg = 'Failed to install rpm-doc package. Reason: {}'.format(output) | 127 | msg = 'Failed to install base-passwd-doc package. Reason: {}'.format(output) |
128 | self.assertEqual(0, status, msg=msg) | 128 | self.assertEqual(0, status, msg=msg) |
129 | 129 | ||
130 | status, output = self.target.run('rpm -e rpm-doc') | 130 | status, output = self.target.run('rpm -e base-passwd-doc') |
131 | msg = 'Failed to remove rpm-doc package. Reason: {}'.format(output) | 131 | msg = 'Failed to remove base-passwd-doc package. Reason: {}'.format(output) |
132 | self.assertEqual(0, status, msg=msg) | 132 | self.assertEqual(0, status, msg=msg) |
133 | 133 | ||
134 | # if using systemd this should ensure all entries are flushed to /var | 134 | # if using systemd this should ensure all entries are flushed to /var |