summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-07-12 16:55:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-15 09:29:59 +0100
commit41bac92fdbf893370dc830b6f810118eed25e05d (patch)
tree09a0d8850cd6fe4246ee843cef39baf088232743
parentd0d4c079d1d6c8903ab1b8f9bac83965debca030 (diff)
downloadpoky-41bac92fdbf893370dc830b6f810118eed25e05d.tar.gz
oeqa/runtime/rpm: Move test_rpm_query_nonroot test case to RpmBasicTest
The test_rpm_query_nonroot test case was in RpmInstallRemoveTest. But it should logically belong to RpmBasicTest. So move it there. (From OE-Core rev: 506388a10a26613524602dcb4e630f216c6fee60) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/runtime/cases/rpm.py59
1 files changed, 30 insertions, 29 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rpm.py b/meta/lib/oeqa/runtime/cases/rpm.py
index 2b45d34e2e..8e18b426f8 100644
--- a/meta/lib/oeqa/runtime/cases/rpm.py
+++ b/meta/lib/oeqa/runtime/cases/rpm.py
@@ -30,35 +30,6 @@ class RpmBasicTest(OERuntimeTestCase):
30 msg = 'status and output: %s and %s' % (status, output) 30 msg = 'status and output: %s and %s' % (status, output)
31 self.assertEqual(status, 0, msg=msg) 31 self.assertEqual(status, 0, msg=msg)
32 32
33class RpmInstallRemoveTest(OERuntimeTestCase):
34
35 @classmethod
36 def setUpClass(cls):
37 pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_')
38 rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch)
39 # Pick base-passwd-doc as a test file to get installed, because it's small
40 # and it will always be built for standard targets
41 rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch
42 if not os.path.exists(rpmdir):
43 return
44 for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc):
45 cls.test_file = os.path.join(rpmdir, f)
46 cls.dst = '/tmp/base-passwd-doc.rpm'
47
48 @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
49 def test_rpm_install(self):
50 self.tc.target.copyTo(self.test_file, self.dst)
51 status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm')
52 msg = 'Failed to install base-passwd-doc package: %s' % output
53 self.assertEqual(status, 0, msg=msg)
54 self.tc.target.run('rm -f %s' % self.dst)
55
56 @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install'])
57 def test_rpm_remove(self):
58 status,output = self.target.run('rpm -e base-passwd-doc')
59 msg = 'Failed to remove base-passwd-doc package: %s' % output
60 self.assertEqual(status, 0, msg=msg)
61
62 @OETestDepends(['rpm.RpmBasicTest.test_rpm_query']) 33 @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
63 def test_rpm_query_nonroot(self): 34 def test_rpm_query_nonroot(self):
64 35
@@ -105,6 +76,36 @@ class RpmInstallRemoveTest(OERuntimeTestCase):
105 finally: 76 finally:
106 unset_up_test_user(tuser) 77 unset_up_test_user(tuser)
107 78
79
80class RpmInstallRemoveTest(OERuntimeTestCase):
81
82 @classmethod
83 def setUpClass(cls):
84 pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_')
85 rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch)
86 # Pick base-passwd-doc as a test file to get installed, because it's small
87 # and it will always be built for standard targets
88 rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch
89 if not os.path.exists(rpmdir):
90 return
91 for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc):
92 cls.test_file = os.path.join(rpmdir, f)
93 cls.dst = '/tmp/base-passwd-doc.rpm'
94
95 @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
96 def test_rpm_install(self):
97 self.tc.target.copyTo(self.test_file, self.dst)
98 status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm')
99 msg = 'Failed to install base-passwd-doc package: %s' % output
100 self.assertEqual(status, 0, msg=msg)
101 self.tc.target.run('rm -f %s' % self.dst)
102
103 @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install'])
104 def test_rpm_remove(self):
105 status,output = self.target.run('rpm -e base-passwd-doc')
106 msg = 'Failed to remove base-passwd-doc package: %s' % output
107 self.assertEqual(status, 0, msg=msg)
108
108 @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_remove']) 109 @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_remove'])
109 def test_check_rpm_install_removal_log_file_size(self): 110 def test_check_rpm_install_removal_log_file_size(self):
110 """ 111 """