[PATCH PM-QA v2 02/25] Replace double equals with one for comparison

2015-02-01 Thread Lisa Nguyen
Using double equals to evaluate whether two conditions are equal is considered BASH syntax. The POSIX compliant version uses one equal sign for evaluating. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_03.sh|2 +- cpufreq/cpufreq_04.sh|2 +- cpufreq/cpufreq_07.sh

[PATCH PM-QA v2 03/25] Remove sigtrap prefixes for traps

2015-02-01 Thread Lisa Nguyen
Remove signals that begin with SIG* since that is considered a bashism. Use the POSIX-compliant version to list signals to be used with the trap command. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_05.sh |2 +- cpufreq/cpufreq_06.sh |2 +- cpufreq/cpufreq_07.sh |2 +- cpufreq/cpuf

[PATCH PM-QA v2 05/25] Fix syntax to get the cpu id number

2015-02-01 Thread Lisa Nguyen
Fix the syntax to get the current cpu id number with the POSIX version. Signed-off-by: Lisa Nguyen --- cpuhotplug/cpuhotplug_03.sh |2 +- cpuhotplug/cpuhotplug_04.sh |2 +- cpuhotplug/cpuhotplug_05.sh |2 +- cpuhotplug/cpuhotplug_06.sh |2 +- cpuhotplug/cpuhotplug_07.sh |2 +-

[PATCH PM-QA v2 08/25] cpuhotplug: Rewrite randomize() function

2015-02-01 Thread Lisa Nguyen
$RANDOM is a BASH defined variable. Rewrite the randomize() function to be POSIX-compliant. Signed-off-by: Lisa Nguyen --- cpuhotplug/cpuhotplug_08.sh | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh index

[PATCH PM-QA v2 01/25] Fix path to library files and change shebang line

2015-02-01 Thread Lisa Nguyen
'source' is a BASH keyword. Edit the path to the library files by using the POSIX version of the 'source' keyword. Also change the interpreter from #!/bin/bash to #!/bin/sh. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_01.sh |4 ++-- cpufreq/cpufreq_02.sh |4 ++--

[PATCH PM-QA v2 12/25] Remove BASH arrays

2015-02-01 Thread Lisa Nguyen
The syntax for arrays, foo[index], is defined in BASH. Replace BASH arrays with ones that are POSIX compliant. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_06.sh| 20 include/functions.sh | 14 +++ include/thermal_functions.sh | 54 +++

[PATCH PM-QA v2 11/25] Remove unused variables and rename some

2015-02-01 Thread Lisa Nguyen
Remove unused variables and rename some variables to avoid conflicts since they are global. Also, renaming variables will make it easier to understand what variables are assigned to them. Signed-off-by: Lisa Nguyen --- cpuhotplug/cpuhotplug_02.sh |6 +- cpuhotplug/cpuhotplug_03.sh |5 +

[PATCH PM-QA v2 10/25] cpuidle: Use is_root() function in cpuidle_03

2015-02-01 Thread Lisa Nguyen
Instead of using a command to check if the user is root, use the is_root() function to perform that check in the cpuidle_03.sh script Signed-off-by: Lisa Nguyen --- cpuidle/cpuidle_03.sh |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpui

[PATCH PM-QA v2 16/25] cpuhotplug: Rename z_sanity_check files to cpuhotplug_99

2015-02-01 Thread Lisa Nguyen
z_sanity_check.sh doesn't have a meaningful name. Rename it to cpuhotplug_99 as the last script to run to see if all cpus are back online after running previous cpuhotplug scripts. Signed-off-by: Lisa Nguyen --- cpuhotplug/cpuhotplug_99.sh | 40 cpuho

[PATCH PM-QA v2 00/25] Removing bashisms and other cleanups

2015-02-01 Thread Lisa Nguyen
Changes in v2: - Reorganized previous patchset and recreated patches based on logical change - Rewritten logic to find certain attributes in sysfs [Let's try again...] This patchset primarily fixes Linaro Bug# 772 (https://bugs.linaro.org/show_bug.cgi?id=772) to remove bashisms in all PM-QA scri

[PATCH PM-QA v2 15/25] cpuhotplug: Rename 1_sanity_check files to cpuhotplug_00 files

2015-02-01 Thread Lisa Nguyen
1_sanity_check.sh script didn't have a meaningful name. Rename it to cpuhotplug_00 as the first script to check if all cpus are online before the other cpuhotplug scripts begin. Signed-off-by: Lisa Nguyen --- cpuhotplug/1_sanity_check.sh | 40 cpuhotpl

[PATCH PM-QA v2 09/25] Fix the syntax to call C programs

2015-02-01 Thread Lisa Nguyen
In PM-QA, there are programs written in C (e.g. cpuidle_killer, uevent_reader) that run in the background while some scripts are being. However, remove the extra slash and period when it's not necessary and create variables to store the path of these programs. Signed-off-by: Lisa Nguyen --- cpu

[PATCH PM-QA v2 13/25] Rewrite logic to check for sampling_rate

2015-02-01 Thread Lisa Nguyen
Set the sampling_rate to zero if the sampling_rate attribute cannot be found in either directories listed in the if condition. This will also resolve minor bugs where the sampling_rate is missing. Signed-off-by: Lisa Nguyen --- include/functions.sh |4 +++- 1 file changed, 3 insertions(+), 1

[PATCH PM-QA v2 07/25] Switches: Add hotplug_allow_cpu0=0

2015-02-01 Thread Lisa Nguyen
Add an entry in Switches.sh to export and set the hotplug_allow_cpu0 variable to zero. This will resolve Android issues where invalid comparisons cannot be made in the cpuhotplug scripts. Android runs the Switches.sh script before it runs any test modules. Signed-off-by: Lisa Nguyen --- Switches

[PATCH PM-QA v2 06/25] Remove thermal_try_max variable

2015-02-01 Thread Lisa Nguyen
The value of the thermal_try_max variable does not change when running PM-QA. There is no reason to check if the value is zero if it's hardly used at all. Signed-off-by: Lisa Nguyen --- Switches.sh |3 --- thermal/thermal_06.sh |5 - 2 files changed, 8 deletions(-) diff --

[PATCH PM-QA v2 17/25] cputopology: Add cputopology_sanity.sh

2015-02-01 Thread Lisa Nguyen
Every test module has a sanity script. Add one for cputopology to check for topology entries for all cpus. Signed-off-by: Lisa Nguyen --- cputopology/cputopology_sanity.sh | 49 cputopology/cputopology_sanity.txt |1 + 2 files changed, 50 insertions(+)

[PATCH PM-QA v2 14/25] suspend_functions: Check if $LOGDIR exists

2015-02-01 Thread Lisa Nguyen
Add an if condition to check if the log directory exists. Create one if it doesn't already exist. Signed-off-by: Lisa Nguyen --- include/suspend_functions.sh |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/suspend_functions.sh b/include/suspend_functions.sh inde

[PATCH PM-QA v2 18/25] Android: Update makefiles with new test numbers

2015-02-01 Thread Lisa Nguyen
Signed-off-by: Lisa Nguyen --- cpuhotplug/Android.mk |4 +--- cputopology/Android.mk |2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpuhotplug/Android.mk b/cpuhotplug/Android.mk index fabb70a..ac0ff0b 100644 --- a/cpuhotplug/Android.mk +++ b/cpuhotplug/Android.mk @

[PATCH PM-QA v2 19/25] Use -q option for grep command

2015-02-01 Thread Lisa Nguyen
Silence the grep results by using the -q option. The extra output that some grep commands print out would be more useful in debugging situations. Signed-off-by: Lisa Nguyen --- cpuhotplug/cpuhotplug_06.sh |2 +- cpuhotplug/cpuhotplug_07.sh |4 ++-- 2 files changed, 3 insertions(+), 3 del

[PATCH PM-QA v2 23/25] cpufreq: Check to see if scaling_available_governors is available

2015-02-01 Thread Lisa Nguyen
Before searching for specific governors, check to see if the scaling_available_governors attribute exists first. It is to add more error handling. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_05.sh | 83 +++-- 1 file changed, 45 insertions(+), 38 d

[PATCH PM-QA v2 20/25] Improve test conditions to see if a directory or file exists

2015-02-01 Thread Lisa Nguyen
Additional checks to see if a directory or file exists. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_sanity.sh |3 +-- cpuhotplug/cpuhotplug_07.sh |5 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpufreq/cpufreq_sanity.sh b/cpufreq/cpufreq_sanity.sh index 6aba

[PATCH PM-QA v2 25/25] Whitespace cleanup

2015-02-01 Thread Lisa Nguyen
Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_03.sh |3 -- cpufreq/cpufreq_04.sh |2 +- cpufreq/cpufreq_05.sh |6 ++- cpufreq/cpufreq_06.sh | 10 +--- cpufreq/cpufreq_07.sh | 32 ++-- cpufreq/cpufreq_08.sh |1

[PATCH PM-QA v2 24/25] cpufreq: Rewrite logic to check if powersave is supported

2015-02-01 Thread Lisa Nguyen
With this new change, the final result for the cpufreq_09 script will always show up and be counted in LAVA. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_09.sh |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpufreq/cpufreq_09.sh b/cpufreq/cpufreq_09.sh index 3e40cb

[PATCH PM-QA v2 22/25] Test: Add sort function

2015-02-01 Thread Lisa Nguyen
Use the built-in sort function to ensure that the PM-QA scripts will run in order. Some platforms may have makefile versions greater than 3.82. See the following link for details: https://lists.gnu.org/archive/html/info-gnu/2010-07/msg00023.html Signed-off-by: Lisa Nguyen --- Test.mk |2 +-

[PATCH PM-QA v2 21/25] cpufreq: Remove unnecessary checks

2015-02-01 Thread Lisa Nguyen
The check function already determines if a subtest fails, passes, or skips. No need to check for the return value of the command. Signed-off-by: Lisa Nguyen --- cpufreq/cpufreq_08.sh |3 --- cpufreq/cpufreq_09.sh |6 -- 2 files changed, 9 deletions(-) diff --git a/cpufreq/cpufreq_08

Re: [PATCH PM-QA v2 09/25] Fix the syntax to call C programs

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: > In PM-QA, there are programs written in C (e.g. cpuidle_killer, > uevent_reader) that run in the background while some scripts are > being. > > However, remove the extra slash and period when it's not necessary > and create variables to store th

Re: [PATCH PM-QA v2 13/25] Rewrite logic to check for sampling_rate

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: > Set the sampling_rate to zero if the sampling_rate attribute cannot > be found in either directories listed in the if condition. This will > also resolve minor bugs where the sampling_rate is missing. > > Signed-off-by: Lisa Nguyen > --- > inc

Re: [PATCH PM-QA v2 24/25] cpufreq: Rewrite logic to check if powersave is supported

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: > With this new change, the final result for the cpufreq_09 > script will always show up and be counted in LAVA. Why? > Signed-off-by: Lisa Nguyen > --- > cpufreq/cpufreq_09.sh |5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >

Re: [PATCH PM-QA v2 23/25] cpufreq: Check to see if scaling_available_governors is available

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: > Before searching for specific governors, check to see if the > scaling_available_governors attribute exists first. It is to add > more error handling. This doesn't seem to handle interactive governor that is usually the default on Android. > S

Re: [PATCH PM-QA v2 00/25] Removing bashisms and other cleanups

2015-02-01 Thread Amit Kucheria
Hi Lisa, On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: > Changes in v2: > - Reorganized previous patchset and recreated patches based on > logical change > - Rewritten logic to find certain attributes in sysfs > > [Let's try again...] Looks much better and easier to review. Still a few more

Re: [PATCH PM-QA v2 00/25] Removing bashisms and other cleanups

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 11:40 AM, Amit Kucheria wrote: > Hi Lisa, > > On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen wrote: >> Changes in v2: >> - Reorganized previous patchset and recreated patches based on >> logical change >> - Rewritten logic to find certain attributes in sysfs >> >> [Let's try a