-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting more variables via command line #219
Conversation
Great start! I tested this by running the tests from ghaf host on Lenovo-X1. Few comments:
|
Thanks for trying this out. My suggestions to these.
The first step was meant generally somehow connecting to ghaf-host either from gui-vm or from separate machine over network.
Or is it replacing your previously set user with the testuser?
We could skip all automated Logouts if CONFIG_PATH is set to None.
I checked that is actually possible to open the report with chrome if first copying the report files to chrome-vm:/tmp and giving them appuser:users ownership. Or then copying to other machine for study... but this is not very smooth. I try to automate sending the results for chrome to read. |
5e9b23a
to
bd7a27a
Compare
If CONFIG_PATH is set to None reading config file variables will be ignored which allows setting target IP address from command line. This makes local smoke testing more straightforward. Prevent Set Variables from overwriting password if given via cmd line. Allow reading test user credentials via /etc/secrets instead of defaulting to testuser/testpw. Add script for sending report files to chrome-vm. Signed-off-by: Samuli Leivo <[email protected]>
60f7aae
to
1475a5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements! Now this works great. I tested running both pre-merge-tests and bat-tests in Ghaf from ghaf-host and then checked the results in Chrome.
Or is it replacing your previously set user with the testuser?
It won't replace the user. If the username/password are different the tests just won't work.
(As a note about the documentation: python ../lib/send_report.py
also required a password to be given :))
Thanks for testing. Yes, forgot to mention that password. I will add. |
Tested also on dev test pipeline with lenovo-x1 |
The purpose of this PR is to bring more flexibility into manual use of ci-test-automation and to make local smoke testing faster. Fully automated setups should not be affected.
CONFIG_PATH (path to test_config.json) can be given via command line. If not given it defaults to the current path.
If CONFIG_PATH is set to
None
reading config file variables will be ignored which allows setting target IP address from command line. This makes local testing more straightforward, not having to create or modify test_config.json.Prevents Set Variables from overwriting password (given via cmd line) if /run/secrets/dut-pass does not exist.
Custom test user name and password are now allowed. They can be stored to /etc/secrets/testuser and /etc/secrets/testpw. If those files don't exist test user credentials default to testuser/testpw.
Steps to run smoke tests locally from ghaf-host:
I ran also with
robot -v CONFIG_PATH:None -v DEVICE:Lenovo-X1 -v DEVICE_IP_ADDRESS:192.168.100.1 -v PASSWORD:ghaf -i lenovo-x1ANDbat -i lenovo-x1ANDgui-apps ./
after setting wifi credentials to /run/secrets and all test cases passed except timesync test (in current state it assumes unchanged time on the machine running robot framework).
If running the tests from separate machine just set the target IP to DEVICE_IP_ADDRESS.
If running tests locally from ghaf-host of Lenovo-X1 the result files can be sent to chrome-vm after the tests have finished by
python ../lib/send_report.py password
and then opened with chrome app by typing /tmp/report.html to the url field.