summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/cases/rpm.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rpm.py b/meta/lib/oeqa/runtime/cases/rpm.py
index d8cabd3640..2b45d34e2e 100644
--- a/meta/lib/oeqa/runtime/cases/rpm.py
+++ b/meta/lib/oeqa/runtime/cases/rpm.py
@@ -4,6 +4,7 @@
4 4
5import os 5import os
6import fnmatch 6import fnmatch
7import time
7 8
8from oeqa.runtime.case import OERuntimeTestCase 9from oeqa.runtime.case import OERuntimeTestCase
9from oeqa.core.decorator.depends import OETestDepends 10from oeqa.core.decorator.depends import OETestDepends
@@ -77,7 +78,21 @@ class RpmInstallRemoveTest(OERuntimeTestCase):
77 msg = 'status: %s. Cannot run rpm -qa: %s' % (status, output) 78 msg = 'status: %s. Cannot run rpm -qa: %s' % (status, output)
78 self.assertEqual(status, 0, msg=msg) 79 self.assertEqual(status, 0, msg=msg)
79 80
81 def check_no_process_for_user(u):
82 _, output = self.target.run(self.tc.target_cmds['ps'])
83 if u + ' ' in output:
84 return False
85 else:
86 return True
87
80 def unset_up_test_user(u): 88 def unset_up_test_user(u):
89 # ensure no test1 process in running
90 timeout = time.time() + 30
91 while time.time() < timeout:
92 if check_no_process_for_user(u):
93 break
94 else:
95 time.sleep(1)
81 status, output = self.target.run('userdel -r %s' % u) 96 status, output = self.target.run('userdel -r %s' % u)
82 msg = 'Failed to erase user: %s' % output 97 msg = 'Failed to erase user: %s' % output
83 self.assertTrue(status == 0, msg=msg) 98 self.assertTrue(status == 0, msg=msg)