Merge lp:~terceiro/lava-dispatcher/device-version into lp:lava-dispatcher
Proposed by
Antonio Terceiro
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | 404 |
Merged at revision: | 418 |
Proposed branch: | lp:~terceiro/lava-dispatcher/device-version |
Merge into: | lp:lava-dispatcher |
Diff against target: |
313 lines (+173/-17) 9 files modified
lava_dispatcher/context.py (+3/-0) lava_dispatcher/device/fastmodel.py (+16/-0) lava_dispatcher/device/qemu.py (+10/-0) lava_dispatcher/device/target.py (+14/-2) lava_dispatcher/job.py (+1/-0) lava_dispatcher/tests/__init__.py (+4/-1) lava_dispatcher/tests/helper.py (+52/-0) lava_dispatcher/tests/test_config.py (+4/-14) lava_dispatcher/tests/test_device_version.py (+69/-0) |
To merge this branch: | bzr merge lp:~terceiro/lava-dispatcher/device-version |
Related bugs: | |
Related blueprints: |
Device Version Support
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle (community) | Approve | ||
Review via email: mp+130404@code.launchpad.net |
Description of the change
This is the dispatcher part of the device version support implementation.
You will notice that the master image part is not done, since I could not get my board to work yet. In the current state of the code, master image devices will always return 'unknown' as their device versions.
To post a comment you must log in.
Antonio Terceiro <email address hidden> writes:
> This is the dispatcher part of the device version support implementation.
>
> You will notice that the master image part is not done, since I could
> not get my board to work yet. In the current state of the code, master
> image devices will always return 'unknown' as their device versions.
This looks mostly fine, thanks! Just a couple of comments.
> === modified file 'lava_dispatche r/device/ qemu.py' --- /device/ qemu.py 2012-10-17 16:52:05 +0000 +++ /device/ qemu.py 2012-10-18 17:49:26 +0000 @@ -20,6 .device. target import ( spawn(qemu_ cmd, logfile=self.sio, timeout=1200) version( self): check_output( ["dpkg- query", "--showformat= ${Version} ", "--show", "qemu-system"]) CalledProcessEr ror:
> lava_dispatcher
> lava_dispatcher
> +20,7 @@
>
> import contextlib
> import logging
> +import subprocess
>
> from lava_dispatcher
> Target
> @@ -76,4 +77,10 @@
> proc = logging_
> return proc
>
> + def get_device_
> + try:
> + return subprocess.
> + except subprocess.
> + return "unknown"
Not sure this is the right thing to do -- should we not parse the
-version of the qemu binary we actually use, which might not be the
packaged version?
> target_class = QEMUTarget
>
> === added file 'lava_dispatche r/tests/ test_device_ version. py' /tests/ test_device_ version. py 1970-01-01 00:00:00 +0000 /tests/ test_device_ version. py 2012-10-18 17:49:26 +0000 www.gnu. org/licenses>. .tests. helper import LavaDispatcherT estCase, create_ device_ config .device. target import Target .device. qemu import QEMUTarget .device. fastmodel import FastModelTarget fastmodel( ): device_ config( 'fastmodel01' , { 'device_type': 'fastmodel', 'simulator_binary': '/path/ to/fastmodel' , 'license_server': 'foo.local' }) (None, config)
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -0,0 +1,59 @@
> +# Copyright (C) 2012 Linaro Limited
> +#
> +# Author: Antonio Terceiro <email address hidden>
> +#
> +# This file is part of LAVA Dispatcher.
> +#
> +# LAVA Dispatcher is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# LAVA Dispatcher is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, see <http://
> +
> +from unittest import TestCase
> +import re
> +from lava_dispatcher
> +
> +from lava_dispatcher
> +from lava_dispatcher
> +from lava_dispatcher
> +
> +def _create_
> + config = create_
> + target = FastModelTarget
> + return target
Could you call this _create_ fastmodel_ target( ) do you think?
> +class TestDeviceVersi on(LavaDispatch erTestCase) : type(target. get_device_ version( )) is str)
> +
> + def test_base(self):
> + target = Target(None, None)
> + assert(
It would be more Pyt...