[OE-core] [PATCH] oeqa/runtime: Added a new auto rpm test
Lucian Musat
george.l.musat at intel.com
Fri Mar 20 12:39:36 UTC 2015
The test tries to query the rpm list with a non-root user
Signed-off-by: Lucian Musat <george.l.musat at intel.com>
---
meta/lib/oeqa/runtime/rpm.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/lib/oeqa/runtime/rpm.py b/meta/lib/oeqa/runtime/rpm.py
index b17e8b4..0529992 100644
--- a/meta/lib/oeqa/runtime/rpm.py
+++ b/meta/lib/oeqa/runtime/rpm.py
@@ -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')
--
2.1.0
More information about the Openembedded-core
mailing list