From 8b3f7ce8a7414ea65eab8cc16221f1f1469a1800 Mon Sep 17 00:00:00 2001
From: Luis Araujo <luis.araujo@collabora.co.uk>
Date: Mon, 17 Dec 2018 17:38:27 +0800
Subject: [PATCH] Update the modules macro

This commit improves the modules macro to avoid redundant information
in the test cases using such a macro.

Signed-off-by: Luis Araujo <luis.araujo@collabora.co.uk>
---
 atc_renderer/templates/macros.html    | 12 ++++--------
 atc_renderer/templates/test_case.html |  2 +-
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/atc_renderer/templates/macros.html b/atc_renderer/templates/macros.html
index 24fd3dd..688590c 100644
--- a/atc_renderer/templates/macros.html
+++ b/atc_renderer/templates/macros.html
@@ -1,10 +1,10 @@
 {% macro git_repo(git_repo_url, git_repo_dir) %}
   <li class="mb-sm-2">Clone the tests repository from another computer <i>(Note that the branch being tested may change depending on the release, please make sure to clone the correct branch for the release in question)</i>:</li>
   <p><kbd>$ git clone {{ git_repo_url }}</kbd></p>
-  <li class="mb-sm-2">Copy the test directory {{ git_repo_dir }} to the device:</li>
+  <li class="mb-sm-2">Copy the test directory {{ git_repo_dir }} to the target device:</li>
   <p><kbd>$ DUT_IP=&ltdevice-ip&gt</kbd></p>
   <p><kbd>$ scp -r {{ git_repo_dir }} user@$DUT_IP:</kbd></p>
-  <li class="mb-sm-2">Log into the target:</li>
+  <li class="mb-sm-2">Log into the target device:</li>
   <p><kbd>$ ssh user@$DUT_IP</kbd></p>
 {% endmacro %}
 
@@ -12,10 +12,10 @@
   <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 device</li>
+  <li class="mb-sm-2">Copy the {{ pkgname }}-master-* to the target device:</li>
   <p><kbd>$ DUT_IP=&ltdevice-ip&gt</kbd></p>
   <p><kbd>$ scp -r {{ pkgname }}-master-* user@$DUT_IP:</kbd></p>
-  <li class="mb-sm-2">Log into the target</li>
+  <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>
@@ -36,8 +36,4 @@
   <p><kbd>$ cd /tmp/</kbd></p>
   <p><kbd>$ apt source {{ libname }}</kbd></p>
   <p><kbd>$ chown user:user -R /tmp/{{ libname }}-*</kbd></p>
-  <li class="mb-sm-2">Clone the apertis-tests git repository:</li>
-  <p><kbd>$ git clone https://gitlab.apertis.org/infrastructure/apertis-tests.git</kbd></p>
-  <li class="mb-sm-2">Enter the tests directory and follow the execution steps.</li>
-  <p><kbd>$ cd apertis-tests/</kbd></p>
 {% endmacro %}
diff --git a/atc_renderer/templates/test_case.html b/atc_renderer/templates/test_case.html
index e94d22e..ec53cc4 100644
--- a/atc_renderer/templates/test_case.html
+++ b/atc_renderer/templates/test_case.html
@@ -42,8 +42,8 @@
       <ol>
       {% if pkgname %}{{ macros.ostree_preconditions(pkgname) }}{% endif %}
       {% if packages_list %}{{ macros.install_packages(packages_list) }}{% endif %}
-      {% if git_repo_url and not pkgname %}{{ macros.git_repo(git_repo_url, git_repo_dir) }}{% endif %}
       {% if libname %}{{ macros.modules_preconditions(libname) }}{% endif %}
+      {% if git_repo_url and not pkgname %}{{ macros.git_repo(git_repo_url, git_repo_dir) }}{% endif %}
       {% for comment, command, output, _, link in pre_conditions %}
       {% if comment %}<li class="mb-sm-2">{{ comment|e }}</li>{% endif %}
       {% if command %}<p><kbd>{{ command|e }}</kbd></p>{% endif %}
-- 
GitLab