Hi, There are mcu and soc on my board, two serial port for them( ttyusb0:mcu, ttyusb1:soc), the hostpc ( it is used for lava worker) connected to the two serial ports, and reboot soc cmd is echo "soc boot" > /dev/ttyUSB0 . then we can see boot log at ttyUSB1. We want to use lava to test soc system, it is arm64 with linux , without uboot . and we hope to add build action in the device. So the deploy and boot steps should be: 1. run build.sh on hostpc (it should be lava worker) and check the result (failed and pass) 2. run echo "soc burn" > /dev/ttyUSB0 on hostpc to change the soc to burn mode, and check the result (failed and pass) 3. run burn.sh on hostpc to burn to soc , and check the result (failed and pass) 4. run echo "soc boot" > /dev/ttyUSB0 to reboot soc , and check the result (failed and pass) 5. connect to /dev/ttyUSB1 to get soc boot log, and check the result (failed and pass) 6. ssh to the linux of soc.
What I want to know is: 1. Is the above design feasible on lava? 2. What do I need to do for this? Are there any device type templets that I can refer to?
The following is my lava system, I can run the test job with qemu device now.
~/work/src/lava $ dpkg -l |grep lava ii lava 2022.11.1+10+buster all Linaro Automated Validation Architecture metapackage ii lava-common 2022.11.1+10+buster all Linaro Automated Validation Architecture common ii lava-coordinator 2022.11.1+10+buster all LAVA coordinator daemon ii lava-dev 2022.11.1+10+buster all Linaro Automated Validation Architecture developer support ii lava-dispatcher 2022.11.1+10+buster all Linaro Automated Validation Architecture dispatcher ii lava-dispatcher-host 2022.11.1+10+buster all LAVA dispatcher host tools ii lava-server 2022.11.1+10+buster all Linaro Automated Validation Architecture server ii lava-server-doc 2022.11.1+10+buster all Linaro Automated Validation Architecture documentation ii lava-tool 0.25-2 all deprecated command line utility for LAVA ii lavacli 0.9.7+buster all LAVA XML-RPC command line interface ~/work/src/lava $
Hi,
Your scenario is possible, but will require a bit of creativity.
On Wed, Sep 20, 2023 at 7:37 AM irreallich@126.com wrote:
Hi, There are mcu and soc on my board, two serial port for them( ttyusb0:mcu, ttyusb1:soc), the hostpc ( it is used for lava worker) connected to the two serial ports, and reboot soc cmd is echo "soc boot" > /dev/ttyUSB0 . then we can see boot log at ttyUSB1. We want to use lava to test soc system, it is arm64 with linux , without uboot . and we hope to add build action in the device. So the deploy and boot steps should be:
- run build.sh on hostpc (it should be lava worker) and check the result (failed and pass)
I would advise against it. LAVA is meant to automate software/firmware deployment and testing. Building inside lava job is possible but it's not a good idea.
- run echo "soc burn" > /dev/ttyUSB0 on hostpc to change the soc to burn mode, and check the result (failed and pass)
- run burn.sh on hostpc to burn to soc , and check the result (failed and pass)
steps above are part of "deployment" in LAVA naming convention. There is no method that can do that out of the box. You'll probably need to use "flasher" deployment and write these steps in your script. Lava will execute the script for you.
- run echo "soc boot" > /dev/ttyUSB0 to reboot soc , and check the result (failed and pass)
This looks like "power on" action. Although I'm not 100% sure. LAVA will require you to provide "power on", "power off" and "reset" actions. These are used throughout the job in various places.
- connect to /dev/ttyUSB1 to get soc boot log, and check the result (failed and pass)
This looks like "boot" step in LAVA convention. The only thing you need to do for this to work is to define a serial connection. ttyusb1 should be the serial in your case.
- ssh to the linux of soc.
I would avoid that if possible. To ssh into the DUT you'll need something on the other end of the connection. This usually implies either "secondary connection" or "multinode" in LAVA convention. IMHO both are a bit too advanced for this scenario. By default LAVA uses serial to interact with the DUT.
What I want to know is:
- Is the above design feasible on lava?
yes, see above.
- What do I need to do for this? Are there any device type templets that I can refer to?
A bit of creativity for sure :) I have similar devices setup in my LAB. They require switching to "download" mode with HW switches. If you replace HW switches with your serial commands to ttyusb0, it looks fairly similar. Here is example device dictionary: https://lava.infra.foundries.io/scheduler/device/imx8mm-evk-01/devicedict example health check job: https://lava.infra.foundries.io/scheduler/job/28279/definition
In theory you can perform your build in the "postprocess" step, but as I mentioned above I would avoid that and use some external builders (github, jenkins, etc.) When deploying to flasher flasher_deploy_commands is called. You can place almost anything there. Some variables in curly brackets can be replaced with proper values on the worker.
Best Regards, Milosz
The following is my lava system, I can run the test job with qemu device now.
~/work/src/lava $ dpkg -l |grep lava ii lava 2022.11.1+10+buster all Linaro Automated Validation Architecture metapackage ii lava-common 2022.11.1+10+buster all Linaro Automated Validation Architecture common ii lava-coordinator 2022.11.1+10+buster all LAVA coordinator daemon ii lava-dev 2022.11.1+10+buster all Linaro Automated Validation Architecture developer support ii lava-dispatcher 2022.11.1+10+buster all Linaro Automated Validation Architecture dispatcher ii lava-dispatcher-host 2022.11.1+10+buster all LAVA dispatcher host tools ii lava-server 2022.11.1+10+buster all Linaro Automated Validation Architecture server ii lava-server-doc 2022.11.1+10+buster all Linaro Automated Validation Architecture documentation ii lava-tool 0.25-2 all deprecated command line utility for LAVA ii lavacli 0.9.7+buster all LAVA XML-RPC command line interface ~/work/src/lava $ _______________________________________________ lava-users mailing list -- lava-users@lists.lavasoftware.org To unsubscribe send an email to lava-users-leave@lists.lavasoftware.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Hi, Milosz, I'm so excited to see your reply, i am a newer of lava and it is the first time for me to ask help on the mailing lists, I didn't expect to get a reply so quickly, it gave me great confidence . Thank you very much. 1. About using lava to compile code Before asking a question I took the time to look through the list of previous questions, just like you, most people do not recommend compiling with lava, I also think this is not a good idea, my requirement is to build an automated testing system that integrates our limited hardware board. Users can create a job to execute tests after modifying their own code, so building code is a necessary step. Do you have any better suggestions for this problem?
2. I installed lava using apt install, it is already working, but there are some problem. e.g the following will be failed python3 -m unittest -vcf tests.lava_scheduler_app.test_base_templates.TestBaseTemplates.test_all_templates because lava test is not be installed. I tried downloading the source code and fixing the problem, but it doesn't look like the right way to do it What is the most appropriate way to install lava?
Thanks
On Wed, Sep 20, 2023 at 11:11 AM irreallich@126.com wrote:
Hi, Milosz, I'm so excited to see your reply, i am a newer of lava and it is the first time for me to ask help on the mailing lists, I didn't expect to get a reply so quickly, it gave me great confidence . Thank you very much.
- About using lava to compile code
Before asking a question I took the time to look through the list of previous questions, just like you, most people do not recommend compiling with lava, I also think this is not a good idea, my requirement is to build an automated testing system that integrates our limited hardware board. Users can create a job to execute tests after modifying their own code, so building code is a necessary step. Do you have any better suggestions for this problem?
Not really. I don't quite understand your proposed workflow, so it's hard to give any suggestions.
- I installed lava using apt install, it is already working, but there are some problem.
e.g the following will be failed python3 -m unittest -vcf tests.lava_scheduler_app.test_base_templates.TestBaseTemplates.test_all_templates because lava test is not be installed. I tried downloading the source code and fixing the problem, but it doesn't look like the right way to do it What is the most appropriate way to install lava?
It looks like your version is pretty old. Did you use http://apt.lavasoftware.org/ as package repository? The packages in debian repositories were not updated for some time it seems.
Best Regards, Milosz
Thanks _______________________________________________ lava-users mailing list -- lava-users@lists.lavasoftware.org To unsubscribe send an email to lava-users-leave@lists.lavasoftware.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
My lava version is 2022.11.1+10+buster , it is a stable version in the doc , actually i am a embedded software engineer, my main experience are bsp and linux kernel, I never use python and web technology before, even though I'm learning this, it's not easy for me, especially some python code error problems, every problem requires a lot of time to solve, that is the reason I choose 2022.11.1+10+buster. I got the lava code from https://gitlab.com/lava/lava/ with tag tag: 2022.11.1, it is same version with my installed by apt on debain 10. So ,if I want to upgrade to a higher version 1. Do I need to compile and install it myself from source code? 2. How do I configure the database and web server?
My current state is to evaluate if and how to use lava , Please give me some suggestions for version selection and how to use.
Thanks
On Wed, Sep 20, 2023 at 1:08 PM irreallich@126.com wrote:
My lava version is 2022.11.1+10+buster , it is a stable version in the doc , actually i am a embedded software engineer, my main experience are bsp and linux kernel, I never use python and web technology before, even though I'm learning this, it's not easy for me, especially some python code error problems, every problem requires a lot of time to solve, that is the reason I choose 2022.11.1+10+buster.
hmm, this sounds wrong. The last tag I can see is 2023.08 https://gitlab.com/lava/lava/-/tags
I got the lava code from https://gitlab.com/lava/lava/ with tag tag: 2022.11.1, it is same version with my installed by apt on debain 10. So ,if I want to upgrade to a higher version
- Do I need to compile and install it myself from source code?
No. I would just use the apt.lavasoftware.org repository and install from packages. As I understand you're already running on debian. It also works on Ubuntu at least for server. https://master.lavasoftware.org/static/docs/v2/installing_on_debian.html#deb...
- How do I configure the database and web server?
Basic stuff is configured automatically when you install. IIRC the worker autoregisters and autoregistration is enabled on the server. For devices there are several ways. I prefer to 'sync' from dictionaries, but you can configure devices from admin UI as well. My workflow is: - prepare device dictionary - push to server (with ansible) - run "lava-server manage sync"
Best Regards, Milosz
My current state is to evaluate if and how to use lava , Please give me some suggestions for version selection and how to use.
Thanks _______________________________________________ lava-users mailing list -- lava-users@lists.lavasoftware.org To unsubscribe send an email to lava-users-leave@lists.lavasoftware.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Yes, the demo worked on my side. the version is old and this is a potential problem , I will try to upgrade the version first. I can't install into ubuntu 20.04, Ubuntu is better than Debian on my side, since it is the default of my teams. 1. Since It also works on Ubuntu at least for server, could you give me for the update steps to install it to ubuntu20.04 or 22.04? 2. my steps below, it works, but I don't know it is correct steps . I don't the types of it, and I couldn't configure device from UI, because the UI only has very simple options. copy jinja2 files to device-types , devices and health-checks to /etc/lava-server/dispatcher-config , add dev, dev-types, worker by lava-server manage cmd, and submit the test from web ui. 3. I couldn't use device-dictionary , since 2022.11.1+10+buster without it, I think using bash cmd to config the system is a good way, which is beneficial to integration, now the settings is at /etc/lava-server/dispatcher-config, do you know how to change it to other path, e.g /home/mylava/lavaconfig ?
Thank you very much for your attention.
On Thu, Sep 21, 2023 at 3:23 AM irreallich@126.com wrote:
Yes, the demo worked on my side. the version is old and this is a potential problem , I will try to upgrade the version first. I can't install into ubuntu 20.04, Ubuntu is better than Debian on my side, since it is the default of my teams.
- Since It also works on Ubuntu at least for server, could you give me for the update steps to install it to ubuntu20.04 or 22.04?
I'm using 22.04. Just add the repository to /etc/apt/sources.list.d/lava.source and apt-get update apt-get install lava-server
- my steps below, it works, but I don't know it is correct steps . I don't the types of it, and I couldn't configure device from UI, because the UI only has very simple options.
copy jinja2 files to device-types , devices and health-checks to /etc/lava-server/dispatcher-config , add dev, dev-types, worker by lava-server manage cmd, and submit the test from web ui.
sounds about right
- I couldn't use device-dictionary , since 2022.11.1+10+buster without it, I think using bash cmd to config the system is a good way, which is beneficial to integration, now the settings is at /etc/lava-server/dispatcher-config, do you know how to change it to other path, e.g /home/mylava/lavaconfig ?
no, I never tried that. I guess it's possible but why would you do that?
Best Regards, Milosz
Thank you very much for your attention. _______________________________________________ lava-users mailing list -- lava-users@lists.lavasoftware.org To unsubscribe send an email to lava-users-leave@lists.lavasoftware.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Hey,
regarding your compile question: Yes as Milosz already pointed out, it's no good idea to use LAVA to compile the code. Usually there are better systems for that, and there the compile can be separated into different steps/stages - and there will be a separate test step. So if you want to automate the whole process, your build system should have a test step which will send a test job to LAVA, and afterwards read back the results.
See https://validation.linaro.org/static/docs/v2/contents.html#ci-with-lava in general for documentation on how to achieve this. This will end in XML-RPC to submit jobs: https://validation.linaro.org/static/docs/v2/lavacli.html and in https://validation.linaro.org/static/docs/v2/data-export.html for exporting the test results.
As LAVA uses a standard format for exporting test results (forgot about the details, I think it was JUnit), visualizing the results in your build system shouldn't be a problem.
One upside for taking this approach: Your device is only occupied during test step, not during the whole build process.
Best regards Stefan
On 2023-09-20 12:10, irreallich@126.com wrote:
Hi, Milosz, I'm so excited to see your reply, i am a newer of lava and it is the first time for me to ask help on the mailing lists, I didn't expect to get a reply so quickly, it gave me great confidence . Thank you very much.
- About using lava to compile code
Before asking a question I took the time to look through the list of previous questions, just like you, most people do not recommend compiling with lava, I also think this is not a good idea, my requirement is to build an automated testing system that integrates our limited hardware board. Users can create a job to execute tests after modifying their own code, so building code is a necessary step. Do you have any better suggestions for this problem?
- I installed lava using apt install, it is already working, but there are some problem.
e.g the following will be failed python3 -m unittest -vcf tests.lava_scheduler_app.test_base_templates.TestBaseTemplates.test_all_templates because lava test is not be installed. I tried downloading the source code and fixing the problem, but it doesn't look like the right way to do it What is the most appropriate way to install lava?
Thanks _______________________________________________ lava-users mailing list -- lava-users@lists.lavasoftware.org To unsubscribe send an email to lava-users-leave@lists.lavasoftware.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Hi, @Milosz Wasilewski and @Stefan , Thanks for your suggestion and I am sorry for late reply. I have made some attempts to build the contents of gitlab or nfs through lava, but I think your suggestion are good idea, I will try it in the future. Now I try to make a device template to connect to serial or ssh to run some case, but i am failed. My system don't have the part about uboot, kernel , we don't need to download thand flasher them. There are mcu and soc on my board, two serial port for them( ttyusb0:mcu, ttyusb1:soc), the hostpc ( it is used for lava worker) connected to the two serial ports, and reboot soc cmd is echo "soc boot" > /dev/ttyUSB0 . then we can see boot log at ttyUSB1. I hope to create a device template and job use to run some command on the soc shell , e.g dmesg. I seems sample but hard for me , the following is the code , the job can't be started, the state always submitted.
/tmp/test.sh with one cmd echo "soc boot" > /dev/ttyUSB0 telnet localhost 10009 works on the shell.
divice template:
/etc/lava-server/dispatcher-config $ cat devices/orinshort-test.jinja2 {# orin test short #} {% extends 'orinshort.jinja2' %}
{% set connection_list = ['usb1'] %} {% set connection_tags = {'usb1': ['primary', 'telnet']} %} {% set connection_commands = {'usb1': 'telnet localhost 10009'} %}
{% set flasher_reset_commands = ['/tmp/test.sh'] %}
{% block body %}
actions: deploy: methods: flasher: commands: {{ flasher_reset_commands }}
connections: serial:
{% endblock body %} /etc/lava-server/dispatcher-config $
Job yaml:
device_type: orinshort job_name: for orinshort device
timeouts: job: minutes: 20 action: minutes: 15 priority: medium visibility: public
actions: - deploy: timeout: minutes: 10 to: flasher images: kernel: url: http://10.19.207.190/static/docs/v2/contents.html#contents-first-steps-using
- boot: timeout: minutes: 10 method: fastboot
lava-users@lists.lavasoftware.org