how to run lava-test in qemu

Asked by vinay hunachyal

hello, all
I add qemu device according documentation (http://lava.readthedocs.org/en/latest/qemu-deploy.html)
I Run command
$ lava-dispatch /tmp/qemu.json
some errors show and how to resolve it ?

(tests)vinay@vinay-VirtualBox:~$ lava-dispatch /tmp/qemu.json Traceback (most recent call last):
  File "/srv/lava/instances/tests/code/r75/bin/lava", line 56, in <module>
    lava.tool.main.LavaDispatcher.run()
  File "/srv/lava/.cache/eggs/lava_tool-0.5-py2.7.egg/lava/tool/dispatcher.py", line 147, in run
    raise SystemExit(cls().dispatch(args))
  File "/srv/lava/.cache/eggs/lava_tool-0.5-py2.7.egg/lava/tool/dispatcher.py", line 137, in dispatch
    return command.invoke()
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.20.1-py2.7.egg/lava/dispatcher/commands.py", line 91, in invoke
    job = LavaTestJob(jobdata, oob_file, config)
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.20.1-py2.7.egg/lava_dispatcher/job.py", line 110, in __init__
    self.load_job_data(job_json)
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.20.1-py2.7.egg/lava_dispatcher/job.py", line 115, in load_job_data
    self.job_data = json.loads(job_json)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

# /tmp/qemu.json
{
  "timeout": 18000,
  "job_name": "qemu-test",
  "device_type": "qemu",
  "target": "qemu01",
  "actions": [
    {
      "command": "deploy_linaro_image",
      "parameters": {
        "image": "file:///tmp/beagle-nano.img.gz"
        }
    },
    {
      "command": "boot_linaro_image"
    }
  ]
}

Question information

Language:
English Edit question
Status:
Solved
For:
LAVA Dashboard (deprecated) Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Doan
Solved:
Last query:
Last reply:
Revision history for this message
Andy Doan (doanac) said :
#1

Can you add the contents of /tmp/qemu.json ?

Revision history for this message
vinay hunachyal (vinayhunachyal) said :
#2

# /tmp/qemu.json
{
  "timeout": 18000,
  "job_name": "qemu-test",
  "device_type": "qemu",
  "target": "qemu01",
  "actions": [
    {
      "command": "deploy_linaro_image",
      "parameters": {
        "image": "file:///tmp/beagle-nano.img.gz"
        }
    },
    {
      "command": "boot_linaro_image"
    }
  ]
}

Revision history for this message
Best Andy Doan (doanac) said :
#3

I think the problem is because the first line of your file is "# /tmp/qemu.json". That line is more of an instructive comement and is not valid JSON. Sorry, I see how the documenation can be confusing in that place.

Revision history for this message
vinay hunachyal (vinayhunachyal) said :
#7

Thanks Andy Doan, that solved my question.

Revision history for this message
Kostya (kpelex) said :
#8

Hello All,

To continue the previous subject. I am getting the follwing error while running "lava-dispatch /tmp/qemu.json":

  File "/srv/lava/.cache/eggs/lava_dispatcher-0.24.1-py2.7.egg/lava_dispatcher/config.py", line 189, in get_device_config
    _get_config("devices/%s" % name, config_dir, initial_config)
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.24.1-py2.7.egg/lava_dispatcher/config.py", line 158, in _get_config
    raise Exception("no config files named %r found" % (name + ".conf"))
Exception: no config files named u'devices/qemu01.conf' found

I do defently nave the /srv/lava/instances/<INST>/etc/lava-dispatcher/devices/qemu01.conf inplace and it looks all permissions
are correct. Please advise. Thank you.

Kostya

Revision history for this message
Senthil Kumaran S (stylesen) said :
#9

What is the name of your instance? Can you paste the contents of qemu01.conf ?

Revision history for this message
Kostya (kpelex) said :
#10

Instance name is test. Content is following:

device_type = qemu
hostname = qemu01

thanks

Revision history for this message
Senthil Kumaran S (stylesen) said :
#11

I hope you have the conf file in the following location?

/srv/lava/instances/test/etc/lava-dispatcher/devices/qemu01.conf

Revision history for this message
Kostya (kpelex) said :
#12

Also when I do "lava devices" I am getting the following error:

..
 File "./lava", line 59, in <module>
    lava.tool.main.LavaDispatcher.run()
  File "/srv/lava/.cache/eggs/lava_tool-0.6-py2.7.egg/lava/tool/dispatcher.py", line 147, in run
    raise SystemExit(cls().dispatch(args))
  File "/srv/lava/.cache/eggs/lava_tool-0.6-py2.7.egg/lava/tool/dispatcher.py", line 137, in dispatch
    return command.invoke()
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.24.1-py2.7.egg/lava/dispatcher/commands.py", line 37, in invoke
    for d in get_devices(self.args.config_dir):
  File "/srv/lava/.cache/eggs/lava_dispatcher-0.24.1-py2.7.egg/lava_dispatcher/config.py", line 208, in get_devices
    devices_dir = os.path.join(config_dir, 'devices')
  File "/srv/lava/instances/test/var/lib/bootstrap-venv/lib/python2.7/posixpath.py", line 68, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Revision history for this message
Kostya (kpelex) said :
#13

Sending outptput of the ll command.

kpelex@ubuntu-VirtualBox:/srv/lava/instances/test/etc/lava-dispatcher/devices$ ll
total 12
drwxrwxrwx 2 kpelex kpelex 4096 Dec 10 11:09 ./
drwxrwxr-x 3 kpelex kpelex 4096 Dec 10 10:32 ../
-rw-rw-rw- 1 kpelex kpelex 37 Dec 10 11:09 qemu01.conf

Thanks

Revision history for this message
Kostya (kpelex) said :
#14

It works fine only if I specify the --config-dir /srv/lava/instances/test/etc/lava-dispatcher parameter.
Any ideas why? Thanks in advance.

Revision history for this message
Andy Doan (doanac) said :
#15

On 12/10/2012 06:41 AM, Kostya wrote:
> Question #212823 on LAVA Dashboard changed:
> https://answers.launchpad.net/lava-dashboard/+question/212823
>
> Kostya posted a new comment:
> It works fine only if I specify the --config-dir /srv/lava/instances/test/etc/lava-dispatcher parameter.
> Any ideas why? Thanks in advance.
>

You must set up your instance's environment properly with:

  . /srv/lava/instances/test/bin/activate

Then you don't need the "--config-dir"

Revision history for this message
Kostya (kpelex) said :
#16

Thank you Andy and Senthil.
I have followed the Tutorial and basically have run the command above.
Probably I did something else wrong, but the root cause is identified and I can handle it.
Have a good day.