From 8c49ae318fc450e7fa5561b9b11c1bc5d22c9b3e Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Sun, 9 Jun 2019 01:07:36 +0200
Subject: [PATCH] sdk-debos-image-building: Test docs about building images on
 SDK

Add a testcase to ensure that the sample image recipes can be built on the SDK
and that the commands in the documentation work correctly.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 test-cases/sdk-debos-image-building.yaml | 49 ++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 test-cases/sdk-debos-image-building.yaml

diff --git a/test-cases/sdk-debos-image-building.yaml b/test-cases/sdk-debos-image-building.yaml
new file mode 100644
index 0000000..177ba95
--- /dev/null
+++ b/test-cases/sdk-debos-image-building.yaml
@@ -0,0 +1,49 @@
+metadata:
+  name: sdk-debos-image-building
+  format: "Apertis Test Definition 1.0"
+  image-types:
+    basesdk: [ amd64 ]
+    sdk:     [ amd64 ]
+  image-deployment:
+    - APT
+  type: functional
+  exec-type: automated
+  priority: critical
+  maintainer: "Apertis Project"
+  description: >
+    Ensure that the sample image recipes can be built on the SDK and
+    that the commands in the documentation work.
+
+  pre-conditions:
+    - "Plenty of free storage space must be available as the test will consume up to 15GB"
+    - "Network connectivity on the DUT as these tests fetch packages and data over
+       the network."
+
+  expected:
+    - The automated test should succeed
+
+  notes:
+    - "Lots of debos messages will be logged on the standard output. Upon test fail,
+       the script will abort with:"
+    - |
+        >Job for generated-test-case-test-sample-documentation.service failed because the control process exited with error code.
+        >See "systemctl --user status generated-test-case-test-sample-documentation.service" and "journalctl --user -xe" for details.
+        >Command exited with non-zero status 1
+
+install:
+  git-repos:
+    - url: https://gitlab.apertis.org/infrastructure/apertis-tests.git
+      branch: 'apertis/v2019pre'
+    - url: https://gitlab.apertis.org/infrastructure/apertis-image-recipes.git
+      branch: 'apertis/v2019pre'
+
+run:
+  steps:
+    - "# add `run-test-in-systemd` to the PATH"
+    - "PATH=$(pwd)/apertis-tests/common/:$PATH"
+    - "# build under /home which has enough storage space"
+    - "sudo -u user cp -a ./apertis-image-recipes ~user/ && cd ~user/apertis-image-recipes"
+    - "# VirtualBox doesn't support nested KVM virtualization, so check that we don't have kvm as well"
+    - "# this should trigger the chroot-based Debos backend instead of the fakemachine one"
+    - "run-test-in-systemd --user=user --timeout=5min --name ensure-no-kvm test ! -e /dev/kvm"
+    - "run-test-in-systemd --user=user --timeout=120min --name test-sample-documentation test/test-sample-documentation"
-- 
GitLab