Skip to content

T25987 kernelci.lab.lava: fix and simplify logic to handle LAVA aliases#590

Merged
gctucker merged 3 commits into
kernelci:mainfrom
gctucker:T25987-fix-lava-aliases
Feb 3, 2021
Merged

T25987 kernelci.lab.lava: fix and simplify logic to handle LAVA aliases#590
gctucker merged 3 commits into
kernelci:mainfrom
gctucker:T25987-fix-lava-aliases

Conversation

@gctucker
Copy link
Copy Markdown
Collaborator

The code to get the list of aliases did not work as expected, all the
entries looked like this:

    "aliases": [
        {
            "device_type": "",
            "name": "am57xx-beagle-x15"
        },

Fix it by using the scheduler.device_types.aliases XMLRPC entry point
for each device type present in the lab, and create a plain dictionary
to map the aliases with the standard device type names used by
KernelCI.

Drop the legacy standalone function get_device_type_by_name and use a
local method in the LAVA class instead to look up the device type used
in a lab if it's present in the aliases dictionary.

Signed-off-by: Guillaume Tucker guillaume.tucker@collabora.com

The code to get the list of aliases did not work as expected, all the
entries looked like this:

        "aliases": [
            {
                "device_type": "",
                "name": "am57xx-beagle-x15"
            },

Fix it by using the scheduler.device_types.aliases XMLRPC entry point
for each device type present in the lab, and create a plain dictionary
to map the aliases with the standard device type names used by
KernelCI.

Also fix the call to LabAPI.device_type_online() to pass the device
type name rather than the device_type config object.

Drop the legacy standalone function get_device_type_by_name and use a
local method in the LAVA class instead to look up the device type used
in a lab if it's present in the aliases dictionary.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
The code has been simplified so there is no need for a unit test.
Aliases are now handled in the LAVA class with a plain dictionary.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Add missing docstrings to the public methods of the LabAPI class.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
@gctucker gctucker force-pushed the T25987-fix-lava-aliases branch from c550b06 to cbb8052 Compare January 26, 2021 20:49
@gctucker
Copy link
Copy Markdown
Collaborator Author

Tested OK on staging, for example with lab-linaro-lkft:

    "devices": {
        "aliases": {
            "am57xx-beagle-x15": "x15",
            "i386": "x86",
            "qemu_arm": "qemu-arm",
            "qemu_arm64": "qemu-arm",
            "qemu_i386": "qemu",
            "qemu_x86_64": "qemu",
            "x86_64": "x86"
        },
        "device_type_online": {
            "dragonboard-410c": false,
            "dragonboard-845c": false,
            "hi6220-hikey-r2": false,
            "juno-r2": false,
            "qcom-qdf2400": false,
            "qemu": true,
            "qemu-arm": false,
            "x15": false,
            "x86": false
        }
    },

@gctucker
Copy link
Copy Markdown
Collaborator Author

gctucker commented Feb 3, 2021

Tested also OK in LKFT lab: https://lkft.validation.linaro.org/scheduler/job/2213008

@gctucker gctucker merged commit 379b753 into kernelci:main Feb 3, 2021
@gctucker gctucker deleted the T25987-fix-lava-aliases branch February 3, 2021 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant