Merge pull request #327 from quartiq/feature/hitl-support

HITL Support
This commit is contained in:
Ryan Summers 2021-04-07 15:52:52 +02:00 committed by GitHub
commit 009eb764bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 2 deletions

View File

@ -1,9 +1,9 @@
name: HITL name: HITL
on: on:
push:
branches: [ hitl ]
workflow_dispatch: workflow_dispatch:
pull_request:
branches: [ master ]
jobs: jobs:
hitl: hitl:

25
hitl/README.md Normal file
View File

@ -0,0 +1,25 @@
# Stabilizer HITL Testing
This directory contains tooling required for Stabilizer hardware-in-the-loop (HITL) testing.
There is a `Stabilizer` board connected at the Quartiq office that is accessible via a private HITL
repository in order to provide secure hardware testing of the stabilizer application in a public
repository.
**Note**: In order to ensure application security, all HITL runs must first be approved by a Quartiq
representative before execution.
# Configuration
* Stabilizer is configured with an ethernet connection to a router. The router runs a DHCP server for
the local network, and ensures that the Stabilizer used for these tests is available under the hostname `stabilizer-hitl`.
* An MQTT broker is running at the hostname `mqtt`.
# HITL Workflow
The private HITL repository does the following:
1. Check out this repository
2. Build firmware images using Cargo
3. Program stabilizer
4. Execute `hitl/run.sh`
In order to add new HITL tests, update `run.sh` to include the necessary tests.

25
hitl/run.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# Title:
# Stabilizer hardware-in-the-loop (HITL) test script.
#
# Description:
# This shell file is executed by the hardware runner in Quartiq's office to exercise the various
# hardware aspects of Stabilizer.
# Enable shell operating mode flags.
set -eux
# Set up python for testing
python3 -m venv --system-site-packages py
. py/bin/activate
python3 -m pip install -r requirements.txt
# Test pinging Stabilizer. This exercises that:
# * DHCP is functional and an IP has been acquired
# * Stabilizer's network is functioning as intended
# * The stabilizer application is operational
ping -c 5 -w 20 stabilizer-hitl
# Test the MQTT interface.
python3 miniconf.py dt/sinara/stabilizer afe/0 '"G2"'

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
gmqtt