Skip to content
Snippets Groups Projects
Commit 64ebe94a authored by Ryan Gonzalez's avatar Ryan Gonzalez
Browse files

Add setup and tests for suite-connector on the IoT image

The tests need credentials to be passed to them, so a new LAVA group is
created that passes them down to the scripts. In order to avoid any
leakage, visibility controls are added to the job generation, so that
the IoT jobs can set the visibility to be internal-only.

https://phabricator.apertis.org/T8949



Signed-off-by: default avatarRyan Gonzalez <ryan.gonzalez@collabora.com>
parent 99f89493
No related branches found
No related tags found
1 merge request!493Add setup and tests for suite-connector on the IoT image
Pipeline #435960 passed
......@@ -33,6 +33,13 @@ render-pages:
variables:
type: fixedfunction
.iot:
variables:
type: iot
# IoT image jobs rely on passing credentials through the LAVA definition,
# so make sure that they're all private.
visibility: '{group: [Collabora]}'
.hmi:
variables:
type: hmi
......@@ -70,6 +77,11 @@ render-pages:
architecture: arm64
board: rpi64
.cloud2edge-vars:
variables:
TENANT: dev.apertis.test
C2E_DEVICE_ID: dev.apertis.test.ci:$CI_COMMIT_REF_SLUG-$CI_PIPELINE_IID-$architecture-$type-$board
.generate-tests-apt:
extends: .generate-tests
tags:
......@@ -166,6 +178,78 @@ run-tests-apt-arm64-fixedfunction-rpi64-rpi4:
- job: generate-tests-apt-arm64-fixedfunction-rpi64-rpi4
artifact: child-pipeline.yaml
generate-tests-apt-amd64-iot-uefi:
extends:
- .generate-tests-apt
- .amd64-uefi
- .iot
run-tests-apt-amd64-iot-uefi:
extends:
- .run-tests
- .amd64-uefi
- .iot
- .cloud2edge-vars
trigger:
strategy: depend
include:
- job: generate-tests-apt-amd64-iot-uefi
artifact: child-pipeline.yaml
generate-tests-apt-armhf-iot-uboot:
extends:
- .generate-tests-apt
- .armhf-uboot
- .iot
run-tests-apt-armhf-iot-uboot:
extends:
- .run-tests
- .armhf-uboot
- .iot
- .cloud2edge-vars
trigger:
strategy: depend
include:
- job: generate-tests-apt-armhf-iot-uboot
artifact: child-pipeline.yaml
generate-tests-apt-arm64-iot-uboot:
extends:
- .generate-tests-apt
- .arm64-uboot
- .iot
run-tests-apt-arm64-iot-uboot:
extends:
- .run-tests
- .arm64-uboot
- .iot
- .cloud2edge-vars
trigger:
strategy: depend
include:
- job: generate-tests-apt-arm64-iot-uboot
artifact: child-pipeline.yaml
generate-tests-apt-arm64-iot-rpi64-rpi4:
extends:
- .generate-tests-apt
- .arm64-rpi64
- .iot
run-tests-apt-arm64-iot-rpi64-rpi4:
extends:
- .run-tests
- .arm64-rpi64
- .iot
- .cloud2edge-vars
trigger:
strategy: depend
include:
- job: generate-tests-apt-arm64-iot-rpi64-rpi4
artifact: child-pipeline.yaml
generate-tests-apt-amd64-hmi-uefi:
extends:
- .generate-tests-apt
......
......@@ -21,6 +21,7 @@
# failures, and that in general the results should not impact the overall
# health of the project
source_wip: "true"
visibility: public
script:
- env --null | sort -z | tr '\0' '\n'
- ./generate-jobs.py
......@@ -43,6 +44,7 @@
-t "source_project:${source_project}"
-t "source_ref:${source_ref}"
-t "source_wip:${source_wip}"
-t "visibility:${visibility}"
--verbose
--metadata-file metadata.json
- ./generate-test-pipeline.py
......
......@@ -247,7 +247,7 @@ parser.add_argument('--deployment', choices=['ostree', 'apt', 'nfs', 'lxc'],
required=True,
help="set the deployment method of the image")
parser.add_argument('--type',
choices=['hmi', 'fixedfunction', 'basesdk', 'sdk', 'nfsroot', 'tiny-lxc'],
choices=['hmi', 'fixedfunction', 'iot', 'basesdk', 'sdk', 'nfsroot', 'tiny-lxc'],
required=True,
help="set the type of the image to be tested")
parser.add_argument('--release', type=str, required=True,
......
job_name: {{image_name}}-{{group}}
{% if device_type == 'qemu' %}
{% include 'common-qemu-boot-tpl.yaml' %}
{% else %}
{% include 'common-boot-tpl.yaml' %}
{% endif %}
- test:
timeout:
minutes: 180
namespace: system
definitions:
{%- for test_name in tests %}
- repository: https://gitlab.apertis.org/tests/apertis-test-cases.git
branch: 'apertis/v2023pre'
history: False
from: git
name: {{test_name}}
path: test-cases/{{test_name}}.yaml
params:
DIGITAL_TWIN_API_ADDRESS: {{ '{{ job.DIGITAL_TWIN_API_ADDRESS }}' }}
DIGITAL_TWIN_API_USER: {{ '{{ job.DIGITAL_TWIN_API_USER }}' }}
DIGITAL_TWIN_API_PASSWORD: {{ '{{ job.DIGITAL_TWIN_API_PASSWORD }}' }}
TENANT: {{ '{{ job.TENANT }}' }}
C2E_DEVICE_ID: {{ '{{ job.C2E_DEVICE_ID }}' }}
C2E_DEVICE_PASSWORD: {{ '{{ job.C2E_DEVICE_PASSWORD }}' }}
{%- endfor -%}
metadata:
name: iot-suite-connector
format: "Apertis Test Definition 1.0"
image-types:
iot: [ amd64, arm64, armhf ]
image-deployment:
- APT
group: "iot"
type: functional
exec-type: automated
priority: medium
maintainer: "Apertis Project"
description: "Ensure suite-connector can interact with cloud2edge."
expected:
- "If PASSED is displayed, the test has passed. The output should be
similar to:"
- |
--- PASS: TestConnectorSuite (10.29s)
--- PASS: TestConnectorSuite/TestCommand (0.74s)
--- PASS: TestConnectorSuite/TestConnectionStatus (0.51s)
--- PASS: TestConnectorSuite/TestEvent (5.32s)
--- PASS: TestConnectorSuite/TestTelemetry (3.01s)
PASS
install:
git-repos:
- url: https://gitlab.apertis.org/tests/suite-connector.git
branch: 'apertis/v2023pre'
run:
steps:
- "# Enter test directory:"
- cd suite-connector
- "# Execute the following command:"
- >
common/run-test-in-systemd --user=user --basename --
env
DIGITAL_TWIN_API_ADDRESS=$DIGITAL_TWIN_API_ADDRESS
DIGITAL_TWIN_API_USER=$DIGITAL_TWIN_API_USER
DIGITAL_TWIN_API_PASSWORD=$DIGITAL_TWIN_API_PASSWORD
TENANT=$TENANT
C2E_DEVICE_ID=$C2E_DEVICE_ID
C2E_DEVICE_PASSWORD=$C2E_DEVICE_PASSWORD
./suite-connector.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment