diff options
author | Lucian Musat <george.l.musat@intel.com> | 2015-03-20 14:39:36 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-21 09:42:39 +0000 |
commit | 9d5deedfdae28d0257e84e1980c2cb7fd4e38c45 (patch) | |
tree | 2812ac38041835b6207d1597a6170e08cad8b7bb | |
parent | b3005576a9e0bcaa47c41f25451d1fe7ef30c7fe (diff) | |
download | openembedded-core-9d5deedfdae28d0257e84e1980c2cb7fd4e38c45.tar.gz openembedded-core-9d5deedfdae28d0257e84e1980c2cb7fd4e38c45.tar.bz2 openembedded-core-9d5deedfdae28d0257e84e1980c2cb7fd4e38c45.zip |
oeqa/runtime: Added a new auto rpm test
The test tries to query the rpm list with a non-root user
Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/runtime/rpm.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/rpm.py b/meta/lib/oeqa/runtime/rpm.py index b17e8b46a8..0529992cbe 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') |