====== B@D Setup and Configuration (2/5) ====== This set of instructions assumes you have already deployed B@D. If that is not the case please go back to the [[ciptestingboardatdeskdingledevdeployment|B@D Virtual Machine Deployment wiki page]]. This wiki page will guide you through the configuration process of the Virtual Machine (VM) that contains Kernel CI and LAVA. Kernel CI is used to build, boot and report results whereas LAVA is used to offer a robust automated testing language, a testing engine and the reporting of results. ===== Vagrant Setup ===== 1. Connect to the Virtual Machine '' user@host:board-at-desk-single-dev$ **vagrant ssh** '' Linux stretch 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Fri Oct 13 08:37:41 2017 from 10.0.2.2 vagrant@stretch:~$ 2. If you downloaded and imported the ''cip_board_at_desk_v1.0.box'' pre-provisioned VM box, unless you wish to configure emailed notifications (in which case first consult [[ciptestingboardatdesksingledevsetup#setting-up-notifications|Setting up Notifications]]), please go to the [[beagleboneblackboard|Beaglebone Black Setup & Configuration wiki page]] to setup the Beaglebone Black or the [[renesasboard|Renesas Set up and configuration page]] (if you are using that board) for use with the B@D Virtual Machine since the rest of this page has already been done for you! If you are building the VM from scratch using Vagrant, please continue to the next step. ===== Create a LAVA Superuser Account ===== 3. Set up a Superuser for Lava Job maintenance. ''vagrant@stretch:~$ **sudo lava-server manage createsuperuser --username lavauser --email=lavauser@lava.co.uk**'' ''Password: **mylava1234**'' ''Password (again): **mylava1234**'' ''Superuser created successfully.'' //Note: Replace with your desired username and replace with that user’s email address. Select a password and enter it twice.// ===== Configure the LAVA Health Check Jobs for your Devices ===== 4. // Note that (only) if you are using a recent provision of B@D from the git repos - and therefore LAVA v 2018.4 - you need to create health checks by copying these yaml files to /etc/lava-server/dispatcher-config/health-checks/ - // vagrant@guest:~$ sudo cp /vagrant/tests/qemu-health-check.yaml /etc/lava-server/dispatcher-config/health-checks/qemu.yaml # if using a Beaglebone Black board vagrant@guest:~$ sudo cp /vagrant/tests/bbb_debian_local.yaml /etc/lava-server/dispatcher-config/health-checks/beaglebone-black.yaml # if using a Renesas iwg20m board vagrant@guest:~$ sudo cp /vagrant/tests/iwg20m-test-ramdisk.yaml /etc/lava-server/dispatcher-config/health-checks/renesas-iwg20m.yaml Once the files have been moved the health checks will automatically run and, in all but the case of QEMU, fail as other configuration is still necessary. You can then skip to the end of this page - [[ciptestingboardatdesksingledevsetup#setting-up-notifications|Setting up Notifications]] If you are using an earlier version of LAVA than 2018.4 then continue with point 5. 5. On your host machine, open a web browser and enter the following in the address box: ''http://localhost:8080'' 6. The LAVA Home Page is displayed in your web browser. Log in to the web server as the superuser: * Click the login link in the upper right-hand corner of the Lava Server website * Enter the username: **lavauser** * Enter the password: **mylava1234** 7. From the LAVA homepage, click on your username in the upper right-hand corner of the page. This displays a menu of actions. * Click on Administration * Scroll down to section labelled "LAVA_SCHEDULER_APP" and click on "Device types" 8. Click on the **qemu** device type 9. Copy and paste the contents of the file ''/vagrant/tests/qemu-health-check.yaml'' into the Health check job textbox. Unless you are using QEMU tests regularly we suggest that you change the pull down 'Initiate health checks by hours or by jobs.' to use 'jobs', as the health check incurs a heavy system load as well as using lots of disk space. 10. Click on the **Save** button in the lower right-hand corner of the page // Note: Once the health-check job is saved to the device type, the job is automatically started by LAVA. // 11. If you have a Beaglebone Black, click on the **bbb01** device type (otherwise move to section 14). 12. Copy and paste the contents of the file ''/vagrant/tests/bbb_debian_local.yaml'' into the Health check job textbox. 13. Click on the **Save** button in the lower right-hand corner of the page. //Note that this health check, which will now run automatically, will fail - i.e. it will be marked as incomplete - because the Beaglebone Black has not yet been fully set up.// 14. If you have a Renesas IWG20M board, click on the **iwg20m01** device type otherwise move to the end of this section. 15. Copy and paste the contents of the file ''/vagrant/tests/iwg20m-test-ramdisk.yaml'' into the Health check job textbox. 16. Click on the **Save** button in the lower right-hand corner of the page. //Note that this health check, which will now run automatically, will fail - i.e. it will be marked as incomplete - because the IWG20M has not yet been fully set up.// ===== Setting up notifications ===== If you wish to set up emailed notifications - to yourself or to the Cip-testing-results list, if you have appropriate permissions, proceed as follows. Inevitably you will need information as to how to send email within your setup and the address of your SMTP server. If you don't need these settings then continue to step 9. 1. If you are comfortable with configuring exim the VM initially has an exim installation and you should modify appropriate files within /etc/exim4 to match your configuration. Then proceed to point 5 after checking that your setup works. Alternatively: 2. If you would prefer a lighter setup, install SSMTP Server vagrant@guest:~$ sudo apt-get install ssmtp 3. Configure SSMTP Server vagrant@guest:~$ sudo nano /etc/ssmtp/ssmtp.conf mailhub=your smtp server:port UseSTARTTLS=YES AuthUser=yourSMTPServerLogin AuthPass=yourPassword #TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt - This may be needed - see below Where: UseSTARTTLS: Set it Yes if SMTP server uses TLS else No. (Gmail wants this to be Yes) \\ TLS_CA_File: This may be required at some point, if you face issues like //send-mail: Cannot open smtp.gmail.com:587// 4. Test sending mail using SSMTP vagrant@guest:~$ /usr/sbin/ssmtp destinationAddress \\ Subject: This is Subject Line \\ Email content line 1 \\ Email content line 2 \\ Email content line 3 \\ 5. If the email is received, modify your health check with the following section: notify: criteria: status: complete recipients: - to: method: irc handle: yourIRCHandle server: irc.freenode.net # change if required - to: method: email email: desiredRecipientEmailAddress If you don't wish to be notified via IRC then just remove that first //to:// section - but otherwise change the yourIRCHandle appropriately! Note that, at the moment due to spam problems, IRC pinging on Freenode will not work. 6. Note that the current version of LAVA used in B@D also supports ''finished'' as a status, so that an email will be received whatever the status of the health check. To be notified about failures change complete to incomplete. See [[http://localhost:8080/static/docs/v2/user-notifications.html|Help in B@D's VM]] for further information - for this link to work the VM needs to be running. 7. Amend [[http://localhost:8080/admin/sites/site/|site settings]] so that the site is localhost:8080 - otherwise the link to the results in the email/IRC will reference example.com. You will need to restart the VM after making this change. Clearly the link to the results will only work when reading the email on the host machine for the VM. 8. The test description is included as part of the email - it is suggested that this should include the path to the kernel thus including the tag and branch details. This will be set automatically if you use the create_test.sh script to generate a health check. See the [[https://wiki.linuxfoundation.org/civilinfrastructureplatform/ciptestingreferencetestcases#test-5use-lava-tool-utility|Reference Test Cases]] page for this procedure. 9. Next, go to the [[beagleboneblackboard|Beaglebone Black Setup & Configuration wiki page]] to setup the Beaglebone Black for use with the B@D Virtual Machine. If you are using the Renesas IWG20M you will need to set up using [[renesasboard|Renesas Setup & Configuration wiki page]]. Back to the [[ciptestingboardatdeskdingledevdeployment|B@D Virtual Machine Deployment wiki page]]