Hi, I have trouble with using multiple devices under one device type.


https://validation.linaro.org/scheduler/device_type/beaglebone-black

I want to test devices using same device type like above.


To do this, I did below steps.

1) Add device type

$ lava-server manage device-types s5p4418-navi-type

2) Add device type

$ lava-server manage devices add --device-types s5p4418-navi-type --worker new_lava_slave s5p4418-navi-ref-qt
$ lava-server manage devices add --device-types s5p4418-navi-type --worker new_lava_slave s5p4418-navi-ref-ref

3) Add device dictionary

import xmlrpc.client
import sys

username = "admin"
token = "bpexdhlth2sckkst1pslnklklw9enis92oe0ncqc4n7yby6mb5bxapof9ll503gqcqaq3rbq6o1765njgtydwozsjudur9bee8escj4zblqmbds0el0ud10qclbbn2hs"
hostname = "192.168.1.20:9099"
server = xmlrpc.client.ServerProxy("http://%s:%s@%s/RPC2" % (username, token, hostname), allow_none=True)

# s5p4418-navi-ref-qt
file = open('/home/lava/bin/nexell-device-dic/s5p4418-navi-ref-qt.jinja2','r')
jinja_string = file.read()
file.close()
server.scheduler.import_device_dictionary("s5p4418-navi-ref-qt", jinja_string)

# s5p4418-navi-ref
file = open('/home/lava/bin/nexell-device-dic/s5p4418-navi-ref.jinja2','r')
jinja_string = file.read()
file.close()
server.scheduler.import_device_dictionary("s5p4418-navi-ref", jinja_string)

updated device dictionary using above python code.

4) Submit job

import xmlrpc.client
import sys
import argparse

username = "admin"
token = "bpexdhlth2sckkst1pslnklklw9enis92oe0ncqc4n7yby6mb5bxapof9ll503gqcqaq3rbq6o1765njgtydwozsjudur9bee8escj4zblqmbds0el0ud10qclbbn2hs"
hostname = "192.168.1.20:9099"

def args_parser():
    """ args parser.
    """
    parser = argparse.ArgumentParser()
    parser.add_argument('job_file', help="job_file", type=argparse.FileType('r'))

    return parser.parse_args()

def loadJob():
    return args.job_file.read()

def process():
    print ("Submitting test job to LAVA server")
    global args
    args = args_parser()

    server = xmlrpc.client.ServerProxy("http://%s:%s@%s/RPC2" % (username, token, hostname), allow_none=True)
    yamlfile = loadJob()
    #print(yamlfile)

    server.scheduler.submit_job(yamlfile)

process()
$ python3 submit.py test.yaml

When I submitted test job using above python code, lava server did test on device named s5p4418-navi-ref.

I wanted test device named 's5p4418-navi-ref-qt'.  But test is run under the device named 's5p4418-navi-ref'.

This is test yaml file I submitted.

device_type: s5p4418-navi-type
job_name: s5p4418-navi-ref-qt-deploy-test
timeouts:
  job:
    minutes: 60
  action:
    minutes: 30
  connection:
    minutes: 20
priority: medium
visibility: public

protocols:
  lava-lxc:
    name: s5p4418-test
    template: debian
    distribution: debian
    release: jessie
    arch: amd64

actions:
  - deploy:
      failure_retry: 3
      namespace: s5p4418-deploy
      timeout:
        minutes: 10
      to: fastboot
      images:
        nexell_ext:
          url: /home/lava-slave/LAVA-TEST/
          dir_name: result-s5p4418-navi-ref-qt
          deploy_script: /home/lava/bin/nexell-lava-commands.sh
          deploy_command1: reboot-bootloader
          deploy_command2: fastboot-download
          #deploy_command1: test1
          #deploy_command2: test2
          device_path: '/dev/ttyUSB0'
          afterdeploy_command1: 'False'
          afterdeploy_command2: 'False'
          test: nothing
      os: oe
  - boot:
      namespace: s5p4418-deploy
      method: fastboot
      prompts:
      - 'root@s5p4418-navi-ref:~#'
      auto_login:
        login_prompt: 's5p4418-navi-ref login:'
        username: root
      parameters:
        shutdown-message: "reboot: Restarting system"
      timeout:
        minutes: 10
      nexell_ext:
          command: /home/lava/bin/nexell-lava-commands.sh
          dir_name: result-s5p4418-navi-ref-qt
          command_param: boot
          command_param2: enter
          device_path: '/dev/ttyUSB0'
  - test:
      namespace: s5p4418-deploy
      connection: serial
      timeout:
        minutes: 3
      failure_retry: 3
      name: s5p4418-navi-qt-test
      definitions:
          - repository: http://git.linaro.org/lava-team/lava-functional-tests.git
            from: git
            path: lava-test-shell/smoke-tests-basic.yaml
            name: smoke-tests