summaryrefslogtreecommitdiff
path: root/automated/lib
AgeCommit message (Collapse)Author
2017-04-19automated: android: added disable_suspend functionMilosz Wasilewski
The function unlocks the device and sets it to be awake all the time Change-Id: I53e39a047e8983e2d08c53b650df9251a793e7ab Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
2017-04-12Don't run adb root if adbd is already run as rootVishal Bhoj
if adbd is already running as root, it will not restart adbd server when we call adb root. This will cause lxc-device-wait-add to be blocked on usb event. Here are problematic jobs: https://staging.validation.linaro.org/scheduler/job/169678#L2308 https://staging.validation.linaro.org/scheduler/job/169679 Change-Id: Iefc65d6241898877b7b26bd8f5826c16e1247f7b Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
2017-04-10fix adb root issueVishal Bhoj
Based on inputs from LAVA team, the right sequence of calls is: lava-lxc-device-wait-add lava-lxc-device-add adb wait-for-device Change-Id: I345aa85910ee68c79cf87b3447104b31d26d936f Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
2017-03-27android-test-lib: add parse_common_args()Chase Qi
Moving the parsing for common args to android-test-lib can avoid code duplication. On the other hand, except the common args, if the test script support additional args, IMO, we should put them together and do the paring in the script. Actually, with the capability to handle illegal input, I don't see an easy way to split the args. And make the code easy to read also is a priority. Change-Id: I6ea7ac4a624f6accb509aaf4e735cd8e190fcc36 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-03-27android-test-lib: run 'adb shell which' with root permissionChase Qi
Root permission is required to locate some commands. For example: T440 test-definitions # adb shell which tee-supplicant T440 test-definitions # adb shell "echo which tee-supplicant | su" /system/bin/tee-supplicant T440 test-definitions # adb shell ls -l /system/bin/tee-supplicant ls: /system/bin/tee-supplicant: Permission denied Change-Id: I129d55d12b081ad4e5cf4c4fd72d1f905223b9a4 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-03-23automated: android: only set permission on the folder/file pushedChase Qi
'chmod -R 755 ${remote}' will change other files located under the same ${remote} folder, not just the folder/file pushed by test script. The current patch get the exact path to the folder/file and set permission on it only. Change-Id: Iaaba46e64b320101eedb4f4a9d8db7f64a63b744 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-03-22automated: android-test-lib: add adb_shell_which()Chase Qi
Change-Id: Ieec3d241a33c5d9a645a2e5ca2c1aeab96cc955d Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-03-22automated: android: set and use environmental variable ANDROID_SERIALChase Qi
When ANDROID_SERIAL set, we don't need to use '-s' to specify device serial no. any more. Change-Id: Ide4951c6ab68806a6241b38c3bf001e2e4e15eab Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-03-02automated: android-test-lib: add install_latest_adb() and adb_root() functionsChase Qi
Change-Id: If83af404a7b819eecf5eb6359821e42cfbbfa029 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-02-22automated: improve android-test-libChase Qi
Change-Id: I6b7eafea28b6bea74a75c31cbb60f6dba2012795 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-02-20automated: android: add cts testChase Qi
Change-Id: I75eb65bc7de03cbe612b33c4ee69d50cfdc6608d Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-02-17automated: sh-test-lib: add create_out_dir()Daniel Díaz
Some error checking and renaming can happen here for all other scripts to peruse. Change-Id: I7286cf2909c59fc41935658d0a970b9c4b7ec795 Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
2017-02-06automated: use '*' instead of 'unknown' for unsupported distrosChase Qi
When dist_name() fails to detect distribution ID, it sets ${dist} to 'unknown'. install_deps() doesn't support 'unknown' distros, and it doesn't support some known distros like oe-rpb either. Using wildcard able to cover these two cases. Change-Id: I619e06d9dbc911c9629d6d6a7f1622c40ed1f234 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-01-26automated: sh-test-lib: add check_root() when neededNicolas Dechesne
In a few lib functions , we are running commands which require root. so let's call check_root() whenever it's needed, to avoid adding the check in the test scripts themselves. For example , in many test case we use check_root() mostly because we want to install packages with install_deps(). Let's add a call to check_root() in install_deps() directly, since installing packages *always* require root. Then we can remove un-needed checks from the test case themselves. Change-Id: Ifd76dacf85f21825f2e47cd224a3725c69eba899 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2017-01-26automated: use pattern matching for rpbFathi Boudra
avoid to hardcode the rpb variants. use "oe-rpb" as a distribution value instead of "oe-based". Change-Id: I8f1ccf35a1b82718f662bd79480cb2c7dc41c1b8 Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
2017-01-25automated: always convert dist to lower caseFathi Boudra
Change-Id: I5ab1e600776e83a56167e22b35b0e0520f85214a Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
2017-01-25automated: switch to using ID field for distroNicolas Dechesne
Let's standardadize all test cases to use lowercase distro ID field from /etc/os-release, instead of the 'pretty' (capitalized) name that we used so far. This is an invasive change, all test scripts were modified with this command: $ sed -i -e 's|Debian\(.*\))|debian\1)|g' \ -e 's|Ubuntu\(.*\))|ubuntu\1)|g' \ -e 's|CentOS\(.*\))|centos\1)|g' \ -e 's|Fedora\(.*\))|fedora\1)|g' \ -e 's|Unknown\(.*\))|unknown\1)|g' And the remaining instances were fixed manually. dist_name() function was updated to always report lowercase distro name. Also when /etc/os-release is not available and that we use lsb_release output, we convert the old capitalized name into the new lowercase ones. Change-Id: I1f1ce0932ab04476567f0338e902656470267a74 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2017-01-25automated: sh-test-lib: add support for /etc/os-release fileNicolas Dechesne
/etc/os-release is a standard file in most distro now, [1] and [2]. Let's use it as the default mechanism to detect the distro at run time, and keep the old mechanisms as fallback. Also * defines 'oe-based' name for any known OE based releases, so that we can adapt test cases accordingly. * convert the ID name found in /etc/os-release into the one we used to have in lsb_release (e.g. Ubuntu vs ubuntu, ... ). [1] https://www.freedesktop.org/software/systemd/man/os-release.html [2] http://0pointer.de/blog/projects/os-release.html Change-Id: I1c9e11b449f8532450c8343bc29eb0aeec58c229 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2017-01-25automated: sh-test-lib: do not source /etc/lsb-releaseNicolas Dechesne
If /etc/lsb-release file exists , then it will be sourced in dist_name() so any variable defined in this file will override/pollute our existing environment. Since dist_name() is called in the context of the test script, we might end up polluting our test environment with unneeded variable, or even worse we might override variables that we have set in our test scripts... Instead of sourcing the file in the current env, let's do it in a subshell. Change-Id: I99ff9b7bb498f47f01adfe0d21f9b1cce0ebf2cc Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2017-01-20automated: sh-test-lib: use warn_msg for step skippingChase Qi
error_msg exit with non-zero, it will kill the 'run.sh' generated by lava-dispatcher or local test-runner as the file has '-e' enabled. To print a warning message for step skipping, use warn_msg instead of error_msg. Change-Id: I20f32de217761fab8261cfa625841737cca48288 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2017-01-19automated: add support for measurements with no unitNicolas Dechesne
It is possible to report measurements with no specific units, however the helper functions currently require the unit to be specified. This patch allows test case to provide only the measurement in add_metric() , effectively making the last arg (unit) optional. When processing the output , we then need to ensure whether or not the unit was specified in the first place. I needed this when porting sysbench test case onto 'automated' method (e.g. sysbench reports 'count of events'). With this change I can get the following test results from sysbench: <TEST_CASE_ID=total-time-2-threads RESULT=pass UNITS=s MEASUREMENT=4.0010> <TEST_CASE_ID=total-number-of-events-2-threads RESULT=pass UNITS= MEASUREMENT=8827> <TEST_CASE_ID=total-time-taken-by-event-execution-2-threads RESULT=pass UNITS= MEASUREMENT=7.9996> <TEST_CASE_ID=min-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.90> <TEST_CASE_ID=avg-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.91> <TEST_CASE_ID=max-2-threads RESULT=pass UNITS=ms MEASUREMENT=3.38> <TEST_CASE_ID=approx.-95-percentile-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.93> <ENDRUN sysbench 9ce36643-e7e9-481e-a45a-464cd07d8cd9> 2017-01-19 15:45:57,557 - RUNNER.ResultParser: INFO: Result files saved to: /home/ndec/output/sysbench_9ce36643-e7e9-481e-a45a-464cd07d8cd9 --- Printing result.csv --- name,test_case_id,result,measurement,units,test_params sysbench,total-time-2-threads,pass,4.0010,s,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,total-number-of-events-2-threads,pass,8827,,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,total-time-taken-by-event-execution-2-threads,pass,7.9996,,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,min-2-threads,pass,0.90,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,avg-2-threads,pass,0.91,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,max-2-threads,pass,3.38,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 sysbench,approx.-95-percentile-2-threads,pass,0.93,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1 Change-Id: Id41207c3237f597bc3db83a5d7d54ee35f6974e3 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2017-01-18automated: sh-test-lib: error_msg: exit with non-zeroChase Qi
LAVA uses '-e' in run.sh. I though we should try to save as many results as possible by always exiting with zero so that the following 'send-to-lava.sh' step will be executed even when test script exit with non-zero. However, in this way, LAVA will record test run as pass even something went wrong and there is no result at all. Always exit with non-zero when error occurs should be the right approach, at least for error_msg() function. In the abnormally exiting cases, we will need to investigate test log in any way. Change-Id: Iaaa5d141878734dea3cd9860dd6779e5d09e10b1 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-11-18lib: Adding new function exit_on_skipNaresh Kamboju
exit_on_skip "testcase-name" "reason for skip" Change-Id: I361f8282c1201362cd89afb4961012d02c8b2bbe Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
2016-11-18lib: sh-test-lib: remove non POSIX 'local' keywordNaresh Kamboju
To cope with shellcheck - Non-POSIX keyword 'local' removed - variable name and keyword 'test' renamed to 'test_case' Change-Id: Idb1b4064bb82ec219c9b4fed39fd6d07d5cc9249 Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
2016-10-28v2: sh-test-lib: added support for adding 3rd-party repoChase Qi
Change-Id: Icae2293f011b7ed59061452cf119e4e1b077d6cd Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-27v2: sh-test-lib: add run_test_case functionChase Qi
When shell argument "-e" set and "$?" is non-zero, test script will exit immediately. check_return and exit_on_fail would not work. run_test_case should be used instead. run_test_case runs test command within if block and able to give pass/fail respectively. "skip_list" is supported as an optional parameter. It skip the following tests and exit when skip_list isn't empty. Change-Id: I0f4040f37b6d9daa0558bac0d6bf87ba1c3bd904 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-27v2: sh-test-lib: add detect_abi functionChase Qi
Binaries are placed in folders named with abi. Test script need to detect abi type and use related binary. Change-Id: Id64bb84ba1170a52fdc2f1b485dc46eec1faae3f Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-25v2: sh-test-lib: add convert_to_mb functionChase Qi
Change-Id: I91764f7abc7ca2fb1995d9fb110c32d3b5f8c2f5 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-24v2: sh-test-lib: fix shellcheck error on validate_check_sum funtionChase Qi
Change-Id: Iaca9fd730ffd80ffaba71c0438786fd6b14034f0 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-24v2: sh-test-lib: disable shellcheck SC2086 on install_deps functionChase Qi
SC2086 - Double quote to prevent globbing and word splitting. "${pkgs}" stands for a single package, not a list of packages. When multiple packages defined in the variable, quotes on it needs to be removed. Change-Id: I972df969ba3f388fe5582a6099baacda1db24cdd Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-10-20v2: lib: add pipe0_status functionChase Qi
pipe0_status is used to return exit code of the first command when using pipe. Usage: pipe0_status "cmd1" "cmd2" Change-Id: I1549e807c2a5401fdc1435a4ac3ac06e27765663 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-09-30v2: lib: added skip_list support for exit_on_failChase Qi
When using exit_on_fail function, you may need to save "rest_tests skip" to result file. Adding optional parameter skip_list for that usage. Change-Id: I6c8165dfaae36caace5757bd90b4e19185c46199 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-09-16v2: lib: update sh-test-libNaresh Kamboju
Adding two functions - report_pass - report_fail Change-Id: Ib28c8962f6ecad0b285ff54db607b61c74a056f4 Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
2016-09-13v2: linux: add openjdk smoke testChase Qi
Change-Id: I1abb98d67746529197b5f262311e2b06a582edf8 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-09-06ui-browser-test: Adding UI browser testingNaresh Kamboju
Ui browser test developed on top of Robot frame work. Test runs chromium, chrome and firefox test cases. On LAVA we have access to serial console and we have to run ui tests from this serial console, this is possible by changing user from root to linaro and exporting the DISPLAY=:0. because linaro owns the X display process. Change-Id: I43bda407f468120839b0a4c8248777303945529e Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
2016-08-30v2: linux: add dd write/read speed testChase Qi
- Added Linux dd write/read speed test - Optimized sh-test-lib Change-Id: I3bccfda212535e9a36b8e231b69c0dd2367a88f6 Signed-off-by: Chase Qi <chase.qi@linaro.org>
2016-08-25v2: initial commitChase Qi
- Added utils, bin, and lib folders and related tools - Added Linux smoke test case as an example - Added test plan example that used to test test-runner Change-Id: I73693108db219cb67afc99525d80cab93f1eb9ea Signed-off-by: Chase Qi <chase.qi@linaro.org>