From 2a8f26c31ba01a607d66a5e249cab6e43a36e468 Mon Sep 17 00:00:00 2001 From: Emanuele Aina <emanuele.aina@collabora.com> Date: Wed, 29 Apr 2020 12:18:26 +0200 Subject: [PATCH] Point the OSTree preconditions to the right branch The templates hardcoded the `master` branch for the repositories shipping the actual test scripts and binaries, but we use release-coded branch names like `apertis/v2021dev2` there so the links in the instructions pointed to the wrong place. Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com> --- atc_renderer/renderer.py | 2 ++ atc_renderer/templates/macros.html | 12 ++++++------ test-cases/apparmor-bluez-setup.yaml | 4 +++- test-cases/apparmor-bluez.yaml | 4 +++- test-cases/bluez-avrcp-volume.yaml | 4 +++- test-cases/bluez-phone.yaml | 4 +++- test-cases/bluez-setup.yaml | 4 +++- test-cases/ofono-sms-send.yaml | 4 +++- test-cases/rfkill-toggle.yaml | 4 +++- 9 files changed, 29 insertions(+), 13 deletions(-) diff --git a/atc_renderer/renderer.py b/atc_renderer/renderer.py index 447ae1e..1c2cfa4 100644 --- a/atc_renderer/renderer.py +++ b/atc_renderer/renderer.py @@ -185,6 +185,8 @@ def get_template_values(testcase_data): # Macros variables ostree_preconditions = metadata.get('macro_ostree_preconditions') if ostree_preconditions: + if isinstance(ostree_preconditions, str): + ostree_preconditions = { 'reponame': ostree_preconditions, 'branch': 'master' } template_values.update({ 'ostree_preconditions' : ostree_preconditions }) packages_list = metadata.get('macro_install_packages_preconditions') diff --git a/atc_renderer/templates/macros.html b/atc_renderer/templates/macros.html index 943f42b..3814ed4 100644 --- a/atc_renderer/templates/macros.html +++ b/atc_renderer/templates/macros.html @@ -8,17 +8,17 @@ <p><kbd>$ ssh user@$DUT_IP</kbd></p> {% endmacro %} -{% macro ostree_preconditions(pkgname) %} +{% macro ostree_preconditions(precondition) %} <li class="mb-sm-2">From a PC, download and unpack the test data tarball from the gitlab test repository:</li> - <p><kbd>$ wget https://gitlab.apertis.org/tests/{{ pkgname }}/-/archive/master/{{ pkgname }}.tar.gz</kbd></p> - <p><kbd>$ tar -xvf {{ pkgname }}.tar.gz</kbd></p> - <li class="mb-sm-2">Copy the {{ pkgname }}-master-* to the target device:</li> + <p><kbd>$ wget https://gitlab.apertis.org/tests/{{ precondition.reponame }}/-/archive/{{ precondition.branch }}/{{ precondition.reponame }}.tar.gz</kbd></p> + <p><kbd>$ tar -xvf {{ precondition.reponame }}.tar.gz</kbd></p> + <li class="mb-sm-2">Copy the {{ precondition.reponame }}-* folder to the target device:</li> <p><kbd>$ DUT_IP=<device-ip></kbd></p> - <p><kbd>$ scp -r {{ pkgname }}-master-* user@$DUT_IP:</kbd></p> + <p><kbd>$ scp -r {{ precondition.reponame }}-* user@$DUT_IP:</kbd></p> <li class="mb-sm-2">Log into the target device:</li> <p><kbd>$ ssh user@$DUT_IP</kbd></p> <li class="mb-sm-2">After log into the DUT, enter the test directory</li> - <p><kbd>$ cd {{ pkgname }}-master-*</kbd></p> + <p><kbd>$ cd {{ precondition.reponame }}-*</kbd></p> <li class="mb-sm-2">Note that the tarball may change depending on the release/branch being tested, please make sure to download the correct tarball for the release in question.</li> {% endmacro %} diff --git a/test-cases/apparmor-bluez-setup.yaml b/test-cases/apparmor-bluez-setup.yaml index a1226cb..66a2f5e 100644 --- a/test-cases/apparmor-bluez-setup.yaml +++ b/test-cases/apparmor-bluez-setup.yaml @@ -19,7 +19,9 @@ metadata: - "A Bluetooth adapter." - "A Bluetooth device." - macro_ostree_preconditions: apparmor-bluez-setup + macro_ostree_preconditions: + reponame: apparmor-bluez-setup + branch: apertis/v2021dev2 pre-conditions: - "Additionnally, it is necessary to get a copy of bluez-setup test:" - $ cd $HOME diff --git a/test-cases/apparmor-bluez.yaml b/test-cases/apparmor-bluez.yaml index 94bfc63..2464e43 100644 --- a/test-cases/apparmor-bluez.yaml +++ b/test-cases/apparmor-bluez.yaml @@ -16,7 +16,9 @@ metadata: resources: - "Two Bluetooth adapters." - macro_ostree_preconditions: apparmor-bluez + macro_ostree_preconditions: + reponame: apparmor-bluez + branch: apertis/v2021dev2 pre-conditions: - "Please note that connman disables bluetooth by default on a fresh image." diff --git a/test-cases/bluez-avrcp-volume.yaml b/test-cases/bluez-avrcp-volume.yaml index 170a1e3..c5abb55 100644 --- a/test-cases/bluez-avrcp-volume.yaml +++ b/test-cases/bluez-avrcp-volume.yaml @@ -21,7 +21,9 @@ metadata: - "Note that you do not need to play any music on the phone; nor do you need to have headphones or a speaker plugged into the Apertis device." - macro_ostree_preconditions: bluez-phone + macro_ostree_preconditions: + reponame: bluez-phone + branch: apertis/v2021dev2 pre-conditions: - "If running the test on an SDK image, kill the blueman-applet process, as it prevents the test from installing its own pairing agent." diff --git a/test-cases/bluez-phone.yaml b/test-cases/bluez-phone.yaml index f225388..1e82034 100644 --- a/test-cases/bluez-phone.yaml +++ b/test-cases/bluez-phone.yaml @@ -25,7 +25,9 @@ metadata: new BT implementation in Android 4.2. Android 6 phones and iPhone>5 should work well)" - macro_ostree_preconditions: bluez-phone + macro_ostree_preconditions: + reponame: bluez-phone + branch: apertis/v2021dev2 pre-conditions: - "If running the test on an SDK image, kill the blueman-applet process, as it prevents the test from installing its own pairing agent." diff --git a/test-cases/bluez-setup.yaml b/test-cases/bluez-setup.yaml index 64404b3..213f0fa 100644 --- a/test-cases/bluez-setup.yaml +++ b/test-cases/bluez-setup.yaml @@ -22,7 +22,9 @@ metadata: - "A Bluetooth adapter." - "A Bluetooth device." - macro_ostree_preconditions: bluez-setup + macro_ostree_preconditions: + reponame: bluez-setup + branch: apertis/v2021dev2 pre-conditions: - "Please note that connman disables bluetooth by default on a fresh image. If it's already enabled, connmanctl will give an \"In progress\" error that diff --git a/test-cases/ofono-sms-send.yaml b/test-cases/ofono-sms-send.yaml index d4f1f21..c368bbc 100644 --- a/test-cases/ofono-sms-send.yaml +++ b/test-cases/ofono-sms-send.yaml @@ -19,7 +19,9 @@ metadata: - "A modem plugged into the Apertis system with a SIM card (SIM card should not have a PIN configured)." - macro_ostree_preconditions: ofono + macro_ostree_preconditions: + reponame: ofono + branch: apertis/v2021dev2 pre-conditions: - Connect modem with SIM card into the Apertis System. - Do not connect more then one modem. diff --git a/test-cases/rfkill-toggle.yaml b/test-cases/rfkill-toggle.yaml index a62479d..cc05cfe 100644 --- a/test-cases/rfkill-toggle.yaml +++ b/test-cases/rfkill-toggle.yaml @@ -15,7 +15,9 @@ metadata: resources: - "A bluetooth dongle is installed." - macro_ostree_preconditions: rfkill-toggle + macro_ostree_preconditions: + reponame: rfkill-toggle + branch: apertis/v2021dev2 expected: - "The test script show should PASSED:" -- GitLab