From 1c732a1cd0bc651859e1d5ac86c76a29594e6453 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Thu, 19 Dec 2019 15:01:56 +0000 Subject: [PATCH] tests: staging: sched_android: Ensure frequencies are sorted Cpufreq's scaling_available_frequencies sysfs file does not guarantee any particular order for the frequencies. As such, on devices where they're not sorted in increasing order, the schedtune frequency test will fail to compute the right target frequency, leading to test failures. Fix this by sorting the frequencies when necessary in sched_android.py. Signed-off-by: Quentin Perret --- lisa/tests/staging/sched_android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisa/tests/staging/sched_android.py b/lisa/tests/staging/sched_android.py index b3763a131..37fc24484 100644 --- a/lisa/tests/staging/sched_android.py +++ b/lisa/tests/staging/sched_android.py @@ -190,7 +190,7 @@ class SchedTuneFreqItem(SchedTuneItemBase): # into a real OPP boost = self.boost target_freq = min(max_freq, max_freq * boost / 80) - target_freq = list(filter(lambda f: f >= target_freq, freqs))[0] + target_freq = sorted(list(filter(lambda f: f >= target_freq, freqs)))[0] # Get the real average frequency avg_freq = self.trace.analysis.frequency.get_average_cpu_frequency(cpu) -- GitLab