summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2015-06-30 00:37:10 +0800
committerChase Qi <chase.qi@linaro.org>2015-06-30 04:00:47 +0000
commit9737b165b1301905e35b96514ca2096d595efc5f (patch)
tree6e5b7712a898c85dab02d3bd72e618e593c3a671
parentbc7f141363534cb07eb6b012ae4043b065d3b39e (diff)
Ubuntu: Fix rcutorture test on new Kernel
- Update test code to simply check if torture module exist in lsmod output. On Kernel V3.18, torture module is used by rcutorture. lsmod output list two torture modules. The current assumption on rcutorture-module-check test is too strong. - On kernel V3.18, because torture is using by rcutorture, 'rmmod torture' doesn't work. The right approach is use 'modprobe -r rcutorture'. 'modprobe -r' is smarter then rmmod. If the modules rcutorture depends on are also unused, it will try to removed them too. Change-Id: I46d9184ebe300ed16fc2c7d65f5d836d24983496 Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rwxr-xr-xubuntu/scripts/rcutorture.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/ubuntu/scripts/rcutorture.py b/ubuntu/scripts/rcutorture.py
index 6b7d6ac..6feb601 100755
--- a/ubuntu/scripts/rcutorture.py
+++ b/ubuntu/scripts/rcutorture.py
@@ -51,7 +51,8 @@ if start_return != 0:
collect_result('rcutorture-end', 'skip')
sys.exit(1)
else:
- print 'RCU Torture test started. Test time is ' + str(rcutorture_time) + ' Seconds.'
+ print('RCU Torture test started. Test time is %s seconds'
+ % (rcutorture_time))
collect_result('rcutorture-start', 'pass')
time.sleep(int(rcutorture_time))
@@ -60,22 +61,17 @@ lsmod_output = subprocess.check_output(['lsmod'])
print lsmod_output
lsmod_list = lsmod_output.split()
torture_list = filter(lambda x: x.find('torture') != -1, lsmod_list)
-if torture_list == []:
+if len(torture_list) == 0:
print 'Cannot find rcutorture module in lsmod, abort!'
collect_result('rcutorture-module-check', 'fail')
collect_result('rcutorture-end', 'skip')
sys.exit(1)
-elif len(torture_list) == 1:
- rcutorture_end = 'rmmod ' + torture_list[0]
+else:
collect_result('rcutorture-module-check', 'pass')
-elif len(torture_list) > 1:
- print 'More than one item with torture in name, please check it manually.'
- collect_result('rcutorture-module-check', 'fail')
- collect_result('rcutorture-end', 'skip')
- sys.exit(1)
# RCU Torture result check
end_keyword = 'rcu-torture:--- End of test'
+rcutorture_end = 'modprobe -r rcutorture'
end_return = subprocess.call(shlex.split(rcutorture_end))
if end_return != 0:
print 'RCU Torture terminate command ran failed.'