aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor <grafnu@users.noreply.github.com>2019-07-30 22:42:32 +0200
committerGitHub <noreply@github.com>2019-07-30 22:42:32 +0200
commit95079e8775cfad303da5141519b8fd5abba1bd00 (patch)
tree01dbb566d0dbabc6686c426a5205d647dd2a384b
parent06b510053509f18712260cb19c7577e8fb1db820 (diff)
parent6b420f94b3c4f49ea4851c39e8d21c41d15bcc49 (diff)
downloaddaq-95079e8775cfad303da5141519b8fd5abba1bd00.tar.gz
daq-95079e8775cfad303da5141519b8fd5abba1bd00.tar.bz2
daq-95079e8775cfad303da5141519b8fd5abba1bd00.zip
Merge branch 'master' into master
-rwxr-xr-xbin/setup_base10
-rw-r--r--docs/device_report.md17
-rw-r--r--docs/integration_testing.md70
-rw-r--r--docs/pubber.md24
-rw-r--r--firebase/public/schema_device.json4
-rw-r--r--misc/test_site/report_template.md11
-rwxr-xr-xpubber/bin/run2
-rw-r--r--qualification/report_template.md43
-rw-r--r--testing/test_aux.out2
-rwxr-xr-xtesting/test_aux.sh2
10 files changed, 172 insertions, 13 deletions
diff --git a/bin/setup_base b/bin/setup_base
index 7020080..a9f36fe 100755
--- a/bin/setup_base
+++ b/bin/setup_base
@@ -45,3 +45,13 @@ $AG update
DOCKER_VERSION=${DOCKER_VERSION_BASE}~${distrib}
$AG install openvswitch-switch openvswitch-common docker-ce${DOCKER_VERSION}
+
+user=$(whoami)
+echo "Current user: $user"
+
+echo Adding your username to the docker group...
+sudo groupadd docker || true
+sudo usermod -aG docker $user
+
+echo Logout and log back in to run tutorials without sudo!
+printf '%d\n' $?
diff --git a/docs/device_report.md b/docs/device_report.md
index 400f2aa..d1a9a57 100644
--- a/docs/device_report.md
+++ b/docs/device_report.md
@@ -1,14 +1,19 @@
-# Device 9a02571e8f01, 2019-06-29 00:05:28+00:00 to 2019-06-29 00:11:06+00:00
+# Device 9a:02:57:1e:8f:01, *** Make *** *** Model ***
+
+## Test Roles
| Role | Name | Status |
|--------|------------------------|--------|
|Operator| *** Operator Name *** | |
|Approver| *** Approver Name *** | |
-| Test iteration | |
+## Test Iteration
+
+| Test | |
|------------------|------------------------|
-| Test report date | 2019-06-29T00:05:26.271Z |
-| DAQ version | 1.0.0 |
+| Test report start date | 2019-06-29 21:30:06+00:00 |
+| Test report end date | 2019-06-29 21:37:30+00:00 |
+| DAQ version | 1.0.1 |
| Attempt number | 1 |
## Device Identification
@@ -72,9 +77,9 @@ Overall device result FAIL
```
Baseline ping test report
-%% 42 packets captured.
+%% 107 packets captured.
RESULT skip base.switch.ping
-RESULT pass base.target.ping target %% 10.20.24.164
+RESULT pass base.target.ping target %% 10.20.96.164
```
## Module nmap
diff --git a/docs/integration_testing.md b/docs/integration_testing.md
new file mode 100644
index 0000000..7b86fcd
--- /dev/null
+++ b/docs/integration_testing.md
@@ -0,0 +1,70 @@
+# Integration Testing
+
+DAQ currently uses Travis CI for integration testing: https://travis-ci.org/
+
+## Configuration
+
+### GCP
+
+If you're running cloud tests using pubber, Travis will need to be able to connect to your GCP account via the service account you've set up.
+
+You'll need to add another environment variable to Travis for this to work:
+
+- GCP_SERVICE_ACCOUNT
+
+This variable is an string of your GCP account credentials file linked to the service account **with all spaces removed surrounded by single quotes**. If you've set everything up correctly, the json file you downloaded when you created the service account should be in your `local/` directory.
+
+There are infinite ways to stringify JSON Use something like https://www.freeformatter.com/json-escape.html to convert your json object to a string, write a script to do it yourself, or use JSON.stringify in your browser JavaScript console.
+
+Your new JSON string will look something like the below. Remember to *enclose the entire thing with single quotes*
+
+```
+'{"type":"service_account","project_id":"<here be a project id>","private_key_id":"<here be a private key>","private_key":"-----BEGINPRIVATEKEY-----\n<here be a key>\n-----ENDPRIVATEKEY-----\n","client_email":"<here be a sercret email>","client_id":"<here be a client id>","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"<here be another secret>"}'
+```
+
+#### YOUR TRAVIS BUILD MAY ALWAYS FAIL! Unless...
+
+**Note** that, by default, Travis will not use encrypted environment variables when testing against pull requests from foreign github repositories, even if you've forked from another repository that you have full control of via Github. Travis authorization != Github authorization, even if you sign into Travis using Github! This is as it should be.
+
+see the following for more info:
+
+- https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings
+- https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
+
+We're working on this...
+
+#### Other Travis caveats
+
+Take note the URL in your browser's address bar when running Travis. You might be on either:
+
+- travis-ci **.com** (this is where the **"build"** step happens)
+- travis-ci **.org** (this is where the **"ci"** step happens)
+
+<img width="800" alt="Screenshot 2019-07-03 at 19 26 42" src="https://user-images.githubusercontent.com/5684825/60616075-962c0c80-9dc8-11e9-9e99-2b649dc23661.png">
+
+
+There seem to be multiple places to add environment variables depending on which TLD you find yourself in. For personal Github accounts, there seems to be both **.com** _and_ **.org** addresses. For organizational Github accounts, only **.org** seems to be available.
+
+
+#### Is my Travis set up correctly?
+
+If Travis is set up correctly, you should see something like:
+
+```
+Setting environment variables from repository settings
+$ export DOCKER_USERNAME=[secure]
+$ export DOCKER_PASSWORD=[secure]
+$ export GCP_SERVICE_ACCOUNT=[secure]
+```
+
+At the start of your Travis test log.
+
+If your test is failing from a PR, you'll see something like in a similar log location:
+
+```
+Encrypted environment variables have been removed for security reasons.
+See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
+Setting environment variables from .travis.yml
+$ export DOCKER_STARTUP_TIMEOUT_MS=60000
+$ export DAQ_TEST=aux
+```
diff --git a/docs/pubber.md b/docs/pubber.md
index a90353c..f7df5cd 100644
--- a/docs/pubber.md
+++ b/docs/pubber.md
@@ -12,6 +12,27 @@ use [Cloud IoT](https://cloud.google.com/iot/docs/). The
section of the documentation describe how to create a simple device and key-pair (see next section for
a helper script). You can/should substitute the relevant values in the configuration below for your specific setup.
+### Required Pub/Sub topics
+
+**NOTE daq_runner NOT daq-runner (underscore not dash)**
+
+- daq_runner
+- events
+- registrar
+- state
+- target
+
+Your Pub/Sub config should look something like:
+
+<img width="500" alt="Screenshot 2019-07-05 at 12 48 32" src="https://user-images.githubusercontent.com/5684825/60720675-6ba29680-9f23-11e9-814f-25c39f11b3c1.png">
+
+### IoT Core Registry Set up
+
+`events` must be set as the default telemetry topic for the validator to work correctly
+
+TODO: add set up instructions for devices, since registrar isn't run during the aux test
+TODO: Need devices: AHU-1. AHU-22. GAT-123, SNS-4
+
## Key Generation
<pre>
@@ -31,7 +52,7 @@ After generating the key pair, you'll have to upload/associate the `pubber_cert.
with the device entry in the cloud console as an _RS256_cert_. (This can be done when the device is
created, or anytime after.)
-## Configuraiton
+## Configuration
The `local/pubber.json` file configures the key cloud parameters needed for operation
(the actual values in the file shold match your GCP setup):
@@ -61,3 +82,4 @@ The `local/pubber.json` file configures the key cloud parameters needed for oper
[pool-1-thread-1] INFO daq.pubber.Pubber - Sending test message for sensor_hub/GAT-001
[pool-1-thread-1] INFO daq.pubber.Pubber - Sending test message for sensor_hub/GAT-001
</pre>
+
diff --git a/firebase/public/schema_device.json b/firebase/public/schema_device.json
index 3a5c93e..49bcd2d 100644
--- a/firebase/public/schema_device.json
+++ b/firebase/public/schema_device.json
@@ -39,6 +39,10 @@
"type": "string",
"pattern": "^[^*]"
},
+ "device_type": {
+ "type": "string",
+ "pattern": "^[^*]"
+ },
"modules": {
"type": "object",
"additionalProperties": false,
diff --git a/misc/test_site/report_template.md b/misc/test_site/report_template.md
index 9239466..15325a9 100644
--- a/misc/test_site/report_template.md
+++ b/misc/test_site/report_template.md
@@ -1,13 +1,18 @@
-# Device {{ clean_mac }}, {{ start_time }} to {{ end_time }}
+# Device {{ run_info.mac_addr }}, {{ device_info.make }} {{ device_info.model }}
+
+## Test Roles
| Role | Name | Status |
|--------|------------------------|--------|
|Operator| {{ process.operator }} | |
|Approver| {{ process.approver }} | |
-| Test iteration | |
+## Test Iteration
+
+| Test | |
|------------------|------------------------|
-| Test report date | {{ run_info.started }} |
+| Test report start date | {{ start_time }} |
+| Test report end date | {{ end_time}} |
| DAQ version | {{ run_info.daq_version }} |
| Attempt number | {{ process.attempt_number }} |
diff --git a/pubber/bin/run b/pubber/bin/run
index 927c652..3cd6775 100755
--- a/pubber/bin/run
+++ b/pubber/bin/run
@@ -9,4 +9,4 @@ if [ -f $conf_file ]; then
java -jar pubber/build/libs/pubber-1.0-SNAPSHOT-all.jar $conf_file
else
echo Pubber config file not found: $(realpath $conf_file)
-fi \ No newline at end of file
+fi
diff --git a/qualification/report_template.md b/qualification/report_template.md
new file mode 100644
index 0000000..15325a9
--- /dev/null
+++ b/qualification/report_template.md
@@ -0,0 +1,43 @@
+# Device {{ run_info.mac_addr }}, {{ device_info.make }} {{ device_info.model }}
+
+## Test Roles
+
+| Role | Name | Status |
+|--------|------------------------|--------|
+|Operator| {{ process.operator }} | |
+|Approver| {{ process.approver }} | |
+
+## Test Iteration
+
+| Test | |
+|------------------|------------------------|
+| Test report start date | {{ start_time }} |
+| Test report end date | {{ end_time}} |
+| DAQ version | {{ run_info.daq_version }} |
+| Attempt number | {{ process.attempt_number }} |
+
+## Device Identification
+
+| Device | Entry |
+|-------------------|--------------------|
+| Name | {{ device_info.name }} |
+| GUID | {{ device_info.guid }} |
+| MAC addr | {{ run_info.mac_addr }} |
+| Hostname | {{ device_info.hostname }} |
+| Type | {{ device_info.type }} |
+| Make | {{ device_info.make }} |
+| Model | {{ device_info.model }} |
+| Serial Number | {{ device_info.serial }} |
+| Firmware Version | {{ device_info.firmware_version }} |
+
+## Device Description
+
+![Image of device]({{ device_image }})
+
+{{ device_description }}
+
+
+### Device documentation
+
+[Device datasheets]({{ device_datasheets_url }})
+[Device manuals]({{ device_manuals_url }})
diff --git a/testing/test_aux.out b/testing/test_aux.out
index 08fc751..006a57c 100644
--- a/testing/test_aux.out
+++ b/testing/test_aux.out
@@ -107,4 +107,4 @@ port-02 module_config modules
')
Redacted docs diff
No report diff
-Done with tests
+Done with tests \ No newline at end of file
diff --git a/testing/test_aux.sh b/testing/test_aux.sh
index bf57cf6..f289eb7 100755
--- a/testing/test_aux.sh
+++ b/testing/test_aux.sh
@@ -67,7 +67,7 @@ if [ -f $cred_file ]; then
make_pubber SNS-4 daq-faux-3 1234
else
echo No GCP_SERVICE_ACCOUNT cred defined.
- echo This varaiable should be defined in your online travis config.
+ echo This variable should be defined in your online travis config.
fi
more inst/faux/daq-faux-*/local/pubber.json | cat