From af842fba0c0c6953aa593d8cb0d004c264bf53bd Mon Sep 17 00:00:00 2001
From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Thu, 28 Mar 2019 12:46:36 +0300
Subject: [PATCH] Add test case for checking improper meta info during offline
 updates

Check if update file with any combination of incorrect Collection ID,
binding refs and timestamp couldn't be used in running system.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
---
 .../aum-offline-upgrade-collection_id.yaml    | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 test-cases/aum-offline-upgrade-collection_id.yaml

diff --git a/test-cases/aum-offline-upgrade-collection_id.yaml b/test-cases/aum-offline-upgrade-collection_id.yaml
new file mode 100644
index 0000000..ca333df
--- /dev/null
+++ b/test-cases/aum-offline-upgrade-collection_id.yaml
@@ -0,0 +1,32 @@
+metadata:
+  name: aum-offline-upgrade-collection_id
+  format: "Apertis Test Definition 1.0"
+  image-types:
+    minimal: [ armhf-internal, armhf, arm64, amd64 ]
+    target:  [ armhf-internal, amd64 ]
+  image-deployment:
+    - OSTree
+  type: functional
+  exec-type: automated
+  priority: critical
+  maintainer: "Apertis Project"
+  description: "Apertis update manager: test of update failure with invalid update file.
+    This test ensures that the update manager refuses to install an update with improper Collection ID, refs or timestamps."
+
+  expected:
+    - "The automated test should succeed."
+
+install:
+  git-repos:
+    - url: https://gitlab.apertis.org/tests/aum-offline-upgrade.git
+      branch: apertis/v2019dev0
+
+run:
+  steps:
+    - "# Enter test directory:"
+    - cd aum-offline-upgrade
+    - "# Execute the following command:"
+    - common/run-test-in-systemd --timeout=900 --name=offline-upgrade env DEBUG=2 RELEASE=$RELEASE ARCH=$ARCH BASEURL=$BASEURL IMGPATH=$IMGPATH IMGDATE=$IMGDATE IMGTYPE=$IMGTYPE IMGNAME=$IMGNAME BOARD=$BOARD ./run-test-wrong-collection_id.sh
+
+parse:
+  pattern: ^(?P<test_case_id>[a-zA-Z0-9_\-\./]+):\s*(?P<result>pass|fail|skip|unknown)$
-- 
GitLab