-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
850 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash -e | ||
|
||
ROOT_DIR=$(realpath $(dirname $0)/..) | ||
cd $ROOT_DIR | ||
|
||
SEQUENCE_MD=docs/specs/sequences/generated.md | ||
|
||
# Create doc of generated sequence steps | ||
prefix=sites/udmi_site_model/out/devices/AHU-1/tests | ||
if [[ -d $prefix ]]; then | ||
echo Updating $SEQUENCE_MD from $prefix: | ||
|
||
# Clear out existing generated sequences | ||
sed -i '/<!-- START GENERATED,/q' $SEQUENCE_MD | ||
|
||
sequences=$(cd $prefix; find . -name sequence.md | sort) | ||
|
||
# Generate table of contents | ||
for sequence in $sequences; do | ||
directory=${sequence%/sequence.md} | ||
name=${directory##.*/} | ||
header=$(fgrep \#\# $prefix/$sequence) || true | ||
if [[ -z $header ]]; then | ||
echo " $name: Invalid or missing header." | ||
continue | ||
fi | ||
description=": $(sed -n -n '/^1\./q;p' $prefix/$sequence | fgrep -v \#\# | xargs echo)" | ||
echo "* [${name}](#${name})${description%: }" >> $SEQUENCE_MD | ||
done | ||
|
||
# Add in specific test sequences | ||
for sequence in $sequences; do | ||
directory=${sequence%/sequence.md} | ||
name=${directory##.*/} | ||
header=$(fgrep \#\# $prefix/$sequence) || true | ||
if [[ -z $header ]]; then | ||
continue | ||
fi | ||
echo " $name" | ||
cat $prefix/$sequence >> $SEQUENCE_MD | ||
done | ||
else | ||
echo $prefix not found, skipping sequence generation. | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
[**UDMI**](../../../) / [**Docs**](../../) / [**Specs**](../) / [**Sequences**](./) / [Generated](#) | ||
|
||
# Generated sequences | ||
|
||
These are the exact sequences being checked by the sequence tool. They are programaticaly generated | ||
so maybe a bit cryptic, but they accurately represent the specific steps required for each test. | ||
|
||
<!-- To regenerate the contents of this file below, use bin/test_sequencer and bin/gencode_seq --> | ||
|
||
<!-- START GENERATED, do not edit anything after this line! --> | ||
* [broken_config](#broken_config): Check that the device correctly handles a broken (non-json) config message. | ||
* [device_config_acked](#device_config_acked): Check that the device MQTT-acknowledges a sent config. | ||
* [extra_config](#extra_config): Check that the device correctly handles an extra out-of-schema field | ||
* [periodic_scan](#periodic_scan) | ||
* [self_enumeration](#self_enumeration) | ||
* [single_scan](#single_scan) | ||
* [system_last_update](#system_last_update): Check that last_update state is correctly set in response to a config update. | ||
* [system_min_loglevel](#system_min_loglevel): Check that the min log-level config is honored by the device. | ||
* [valid_serial_no](#valid_serial_no) | ||
* [writeback_states](#writeback_states) | ||
|
||
## broken_config | ||
|
||
Check that the device correctly handles a broken (non-json) config message. | ||
|
||
1. Update config: | ||
* Set `system.min_loglevel` = `100` | ||
1. Wait for no interesting status | ||
1. Wait for clean config/state synced | ||
1. Wait for state synchronized | ||
1. initial stable_config matches last_config | ||
1. Wait for log category `system.config.receive` level `DEBUG` | ||
1. Wait for has interesting status | ||
1. Wait for log category `system.config.parse` level `ERROR` | ||
1. Check has not logged category `system.config.apply` level `NOTICE` (**incomplete!**) | ||
1. Force reset config | ||
1. Wait for log category `system.config.receive` level `DEBUG` | ||
1. Wait for no interesting status | ||
1. Wait for last_config updated | ||
1. Wait for log category `system.config.apply` level `NOTICE` | ||
1. Wait for log category `system.config.parse` level `DEBUG` | ||
|
||
## device_config_acked | ||
|
||
Check that the device MQTT-acknowledges a sent config. | ||
|
||
1. Wait for config acked | ||
|
||
## extra_config | ||
|
||
Check that the device correctly handles an extra out-of-schema field | ||
|
||
1. Update config: | ||
* Set `system.min_loglevel` = `100` | ||
1. Wait for last_config not null | ||
1. Wait for system operational | ||
1. Wait for no interesting status | ||
1. Wait for log category `system.config.receive` level `DEBUG` | ||
1. Wait for last_config updated | ||
1. Wait for system operational | ||
1. Wait for no interesting status | ||
1. Wait for log category `system.config.parse` level `DEBUG` | ||
1. Wait for log category `system.config.apply` level `NOTICE` | ||
1. Wait for log category `system.config.receive` level `DEBUG` | ||
1. Wait for last_config updated again | ||
1. Wait for system operational | ||
1. Wait for no interesting status | ||
1. Wait for log category `system.config.parse` level `DEBUG` | ||
1. Wait for log category `system.config.apply` level `NOTICE` | ||
|
||
## periodic_scan | ||
|
||
1. Update config: | ||
* Add `discovery` = { "families": { } } | ||
1. Wait for all scans not active | ||
1. Wait for scan iterations | ||
|
||
## self_enumeration | ||
|
||
1. Wait for enumeration not active | ||
1. Update config to discovery generation: | ||
* Add `discovery` = { "enumeration": { "generation": _generation start time_ } } | ||
1. Wait for enumeration generation | ||
1. Wait for enumeration still not active | ||
|
||
## single_scan | ||
|
||
1. Update config: | ||
* Add `discovery` = { "families": { } } | ||
1. Wait for all scans not active | ||
1. Wait for scheduled scan start | ||
1. Wait for scan activation | ||
1. Wait for scan completed | ||
|
||
## system_last_update | ||
|
||
Check that last_update state is correctly set in response to a config update. | ||
|
||
1. Wait for state last_config matches config timestamp | ||
|
||
## system_min_loglevel | ||
|
||
Check that the min log-level config is honored by the device. | ||
|
||
1. Check has not logged category `system.config.apply` level `NOTICE` (**incomplete!**) | ||
1. Update config: | ||
* Set `system.min_loglevel` = `400` | ||
1. Update config: | ||
* Set `system.min_loglevel` = `200` | ||
1. Wait for log category `system.config.apply` level `NOTICE` | ||
|
||
## valid_serial_no | ||
|
||
|
||
## writeback_states | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[**UDMI**](../../) / [**Docs**](../) / [**Tools**](./) / [Registrar](#) | ||
|
||
Various notes and tips and tricks for working with GCP. These are more or less hints as to what can be done, but don't expect | ||
them to work out-of-the-box without a deeper understanding of what's going on! | ||
|
||
# Viewing subscription | ||
|
||
bin/pull_message:gcloud --format=json --project=$project_id pubsub subscriptions pull $subscription --auto-ack | ||
|
||
# View cloud function logs | ||
|
||
gcloud --project=bos-peringknife-ci functions logs read udmi_config --sort-by=time_utc --limit=1000 | ||
|
||
# Update devices' GCP IoT Core configuration (sent down to the device) | ||
|
||
bin/reset_config |
Oops, something went wrong.