diff --git a/atc_renderer/renderer.py b/atc_renderer/renderer.py index 447ae1e1ee0badb25bd2b6d878a0b0a99140e2ac..1c2cfa467a7bd108d6c57cf7bd949ba8f3e7dcc7 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 943f42bde9d3916afa2b208446007ab289eba657..3814ed49b7d78b04707d29296a9c96a9e9ce8315 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 a1226cb0c3eb79399332afdfea5ba65f83526b24..66a2f5e970a256d72a920784821adf16b8ba8dee 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 94bfc63a483ea10c2c5225fbae082302f801a33c..2464e43185add95091d1f1e7e00517ae21b0de89 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 170a1e3235d43633ef85001bd91e5206af041531..c5abb5534e26fb08be33c05d045fc0f4a264c8ed 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 f225388f700e9b014924e69ad68f312bbb51be9a..1e820347ae080f7b0a7b4cdd7c24ec5479b99f53 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 64404b315ea24174b70a946e243243b04d64b2ac..213f0fa3f18c1e5d801e7a23aa09392b70a33542 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 d4f1f218513b8e35ab47286722a363b49f3fb194..c368bbc8527e22d64b9ea913f045e5bc30f7fac9 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 a62479d5cdef9133ff9a17bc7e7cb6ff974a4bc6..cc05cfe3aa1b1e6ffd8cafdd97c2b2385f36d02a 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:"