Quickstart¶
Let’s put it all together and run an automated end-to-end functional test!
You’ll need the following for this quickstart tutorial:
Account on Knilb
Laptop with
knilb
Raspberry Pi with ExplorerHAT Pro as an Automated Test Equipment
Raspberry Pi with AutomationHAT as a Device Under Test
Start the Automated Test Equipment¶
The Pimoroni ExplorerHAT Pro provides easy access to the GPIO pins. For example, wires to connect the GPIO digital input pins to output relays on a Device Under Test.
Let’s SSH from the laptop into the RaspberryPi with Pimoroni ExplorerHAT Pro and start an ATE:
pi@raspberrypi:~/try-pimo $ source venv/bin/activate
(venv) pi@raspberrypi:~/try-pimo $ pimo ate
pimoscope
automatically detects the ExplorerHAT. The ExplorerHAT Pro must be present.
pimoscope
starts a web app with a simple RESTful API for Automated Test Equipment to inspect the digital input lines on the Pimoroni ExplorerHAT Pro.
Let’s use a different laptop terminal to inspect the RESTful resources on the RaspberryPi:
$ curl http://<ipaddress_of_ate>:8080/ate/input
{'four': 0, 'three': 0, 'two': 0, 'one': 0}
Start the Device Under Test¶
The Pimoroni AutomationHAT provides convenient hardware to prototype and demo an actuator using its builtin electromechanical relays and output pins.
Let’s SSH from the laptop into into the RaspberryPi with Pimoroni AutomationHAT and start a DUT:
pi@raspberrypi:~/try-pimo $ source venv/bin/activate
(venv) pi@raspberrypi:~/try-pimo $ pimo dut
pimoscope
automatically detects the AutomationHAT. The AutomationHAT must be present.
pimoscope
starts a web app with a simple RESTful API for Device Under Test to control each individual (of three) relays. RESTful resources return the software-defined logics relay states. The logical response by the application software can be validated with the physical response from Automated Test Equipment.
Let’s use a different laptop terminal to inspect the RESTful resources on the RaspberryPi:
# READ RELAY STATE
$ curl http://<ipaddress_of_dut>:8080/dut/relay
{"three": false, "two": false, "one": false}
# SET RELAY STATE
$ curl -H "Content-Type: application/json" -X POST -d '{"state": 1}' http://<ipaddress_of_dut>:8080/dut/relay/one
{"state": true, "relay": "one"}
Prepare the Cloud Service¶
On the Cloud Service let’s create each step shown below, then create a case and plan. Finally, create the deployment making sure to specify the correct URL each RaspberryPi.
Knilb > Create > Step |
My Step 1 |
My Step 2 |
---|---|---|
Description |
Activate Relay One |
Sense Relay One |
Location |
DUT |
ATE |
Endpoint |
relay/one |
ate/input |
After |
0 |
0 |
Command |
state |
|
Condition |
Is True |
Is True |
Parameter |
state |
one |
Value |
true |
true |
Launch the Agent¶
Let’s use a laptop terminal to launch the knilb
. Replace <passkey>
with the API Passkey from your account on the Cloud Service.:
$ knilb http://app.knilb.com <passkey> -v -s
Get Test Results¶
Congratulations! Let’s check out the test results on the Cloud Service.