Skip to contentSkip to conversation

oeqa/runtime/rpm: use su instead of sudo

PATCH New Ross Burton 1 participant 1 message Aug 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/runtime/rpm: use su instead of sudo

This test works fine with su, which is more likely to be installed in images than sudo.

---
 meta/lib/oeqa/runtime/rpm.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/lib/oeqa/runtime/rpm.py +2 -3
index 624c515..4d03ecb 100644
@@ -53,9 +53,9 @@ class RpmInstallRemoveTest(oeRuntimeTest):
     def test_rpm_query_nonroot(self):
         (status, output) = self.target.run('useradd test1')
         self.assertTrue(status == 0, msg="Failed to create new user: " + output)
-        (status, output) = self.target.run('sudo -u test1 id')
+        (status, output) = self.target.run('su -c id test1')
         self.assertTrue('(test1)' in output, msg="Failed to execute as new user")
-        (status, output) = self.target.run('sudo -u test1 rpm -qa')
+        (status, output) = self.target.run('su -c "rpm -qa" test1 ')
         self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa: %s" % (status, output))
 
     @testcase(195)
@@ -98,4 +98,3 @@ class RpmInstallRemoveTest(oeRuntimeTest):
     @classmethod
     def tearDownClass(self):
         oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
-
Signature · 1 line
2.8.1