Linux Foundation Wiki

project collaboration site

User Tools

Site Tools


civilinfrastructureplatform:ciptestingboardatdesksingledevsetup

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 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 jessie 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) 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.
 You have new mail.
 Last login: Tue May 16 08:21:43 2017 from 10.0.2.2
 vagrant@jessie:~$ 

2. If you downloaded and imported the cip_board_at_desk_v0.9.1.box pre-provisioned VM box, unless you wish to configure emailed notifications (in which case first consult Setting up Notifications), please go to the Beaglebone Black Setup & Configuration wiki page to setup the Beaglebone Black 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@jessie:~$ sudo lava-server manage createsuperuser --username lavauser --email=lavauser@lava.co.uk

Password: mylava1234

Password (again): mylava1234

Superuser created successfully.

Note: Replace <lavauser> with your desired username and replace lavauser@lava.co.uk with that user’s email address. Select a password and enter it twice.

Configure the LAVA Health Check Jobs for both Devices

4. On your host machine, open a web browser and enter the following in the address box:

http://localhost:8080

5. 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

6. 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”

7. Click on the qemu device type

8. 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.

9. 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.

10. Click on the bbb01 device type

11. Copy and paste the contents of the file /vagrant/tests/bbb_debian_ramdisk_test.yaml into the Health check job textbox.

12. 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.

13. Once the health checks have completed we recommend a reboot of the vagrant instance to free resources used in the provision.

  user@host:$ vagrant halt
  user@host:$ vagrant 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 7.

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
<Press Control-D when finished composing email body>

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.

6. Note that the current version of LAVA used in B@D does not support finished as a status, so that an email will only be received if the health check is successful. To be notified about failures change complete to incomplete. See Help in B@D's VM for further information - for this link to work the VM needs to be running.

7. Amend site settings so that the site is localhost - otherwise the link to the results in the email will reference example.com.

7. Next, go to the Beaglebone Black Setup & Configuration wiki page to setup the Beaglebone Black for use with the B@D Virtual Machine.

Back to the B@D Virtual Machine Deployment wiki page

civilinfrastructureplatform/ciptestingboardatdesksingledevsetup.txt · Last modified: 2017/09/15 11:02 by rajmarshall