oeqa/runtime: Added a new auto rpm test
The test tries to query the rpm list with a non-root user (From OE-Core rev: 9d5deedfdae28d0257e84e1980c2cb7fd4e38c45) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
a8c98c399f
commit
b0b8f47e99
|
@ -47,6 +47,16 @@ class RpmInstallRemoveTest(oeRuntimeTest):
|
|||
(status,output) = self.target.run('rpm -e rpm-doc')
|
||||
self.assertEqual(status, 0, msg="Failed to remove rpm-doc package: %s" % output)
|
||||
|
||||
@testcase(1096)
|
||||
@skipUnlessPassed('test_ssh')
|
||||
def test_rpm_query_nonroot(self):
|
||||
(status, output) = self.target.run('useradd test1')
|
||||
self.assertTrue(status == 0, msg="Failed to create new user")
|
||||
(status, output) = self.target.run('sudo -u test1 id')
|
||||
self.assertTrue('(test1)' in output, msg="Failed to execute as new user")
|
||||
(status, output) = self.target.run('sudo -u test1 rpm -qa')
|
||||
self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa" % status)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(self):
|
||||
oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
|
||||
|
|
Loading…
Reference in New Issue