Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
fe10e73
Implement test orchestrator (#4)
jhughesoti Apr 25, 2023
6f3a7fe
Add issue report templates (#7)
jboddey Apr 26, 2023
e05c383
Discover devices on the network (#5)
jboddey Apr 26, 2023
823709e
Test run sync (#8)
jhughesoti Apr 28, 2023
ba6afc4
Quick refactor (#9)
jboddey Apr 28, 2023
c87a976
Fix duplicate sleep calls
jhughesoti Apr 28, 2023
34ce211
Add net orc (#11)
jhughesoti May 2, 2023
ceba453
Add the DNS test module (#12)
jhughesoti May 4, 2023
0837a9c
Add baseline and pylint tests (#25)
noursaidi May 16, 2023
4171e5f
Discover devices on the network (#22)
jboddey May 16, 2023
be829a3
Build dependencies first (#21)
jboddey May 16, 2023
84d9ff9
Port scan test module (#23)
jhughesoti May 17, 2023
07432ee
Fix device configs
jboddey May 17, 2023
7b27e23
Remove unecessary files
jhughesoti May 17, 2023
5ac8726
Cleanup duplicate properties
jhughesoti May 17, 2023
2c4efe8
Cleanup install script
jhughesoti May 17, 2023
25fd8a5
Formatting (#26)
jhughesoti May 22, 2023
41aaaf7
Test results (#27)
jhughesoti May 23, 2023
ea60b41
Test results (#28)
jhughesoti May 25, 2023
b6a6cdc
Fix pylint test and skip internet tests so CI passes (#29)
noursaidi May 25, 2023
3d53ecb
Increase pylint score (#31)
jboddey May 25, 2023
b91fff5
Pylint (#32)
jhughesoti May 30, 2023
b84a026
Add license header (#36)
jhughesoti May 30, 2023
622b12d
merge main
jhughesoti May 31, 2023
38d71aa
Ovs (#35)
jhughesoti May 31, 2023
00be9cb
remove ovs files added back in during merge
jhughesoti May 31, 2023
f331239
Nmap (#38)
jhughesoti Jun 5, 2023
2a68fba
Create startup capture (#37)
jboddey Jun 5, 2023
8e8e154
Connection (#40)
jhughesoti Jun 7, 2023
6ff220b
Conn mac oui (#42)
jhughesoti Jun 8, 2023
4ca8f44
Con mac address (#43)
jhughesoti Jun 8, 2023
ff04f43
Dns (#44)
jhughesoti Jun 8, 2023
752f701
File permissions (#45)
jhughesoti Jun 9, 2023
f6e4e93
Add connection single ip test (#47)
jhughesoti Jun 12, 2023
bca0db8
Nmap results (#49)
jhughesoti Jun 15, 2023
5b56a79
Framework restructure (#50)
jboddey Jun 15, 2023
7bb9366
Ip control (#51)
jhughesoti Jun 20, 2023
b0d14c2
Move config to /local (#52)
jboddey Jun 23, 2023
94e937f
Add documentation (#53)
jboddey Jun 23, 2023
098de20
Sync dev to main (#56)
jboddey Jun 28, 2023
f185bb1
Fix missing results on udp tests when tcp ports are also defined (#59)
jhughesoti Jun 29, 2023
355c838
Add licence header (#61)
jboddey Jul 3, 2023
d374640
Resolve merge conflicts
jboddey Jul 3, 2023
8d65386
Resolve merge conflict
jboddey Jul 3, 2023
26f8c5b
Add network docs (#63)
jboddey Jul 4, 2023
4a5c1ea
Dhcp (#64)
jhughesoti Jul 5, 2023
af8367c
Dhcp (#67)
jhughesoti Jul 6, 2023
7dd5772
Add connection.dhcp_address test (#68)
jhughesoti Jul 6, 2023
9ef0d4f
Add NTP tests (#60)
jboddey Jul 12, 2023
2ae337d
Add ipv6 tests (#65)
jboddey Jul 12, 2023
59ab65f
Merge branch 'main' into dev
jboddey Jul 12, 2023
fe4bf43
Connection private address (#71)
jhughesoti Jul 13, 2023
0c550c8
fix windows line ending
jhughesoti Jul 13, 2023
2df6b4a
Fix python import
jboddey Jul 13, 2023
bfae1e0
move isc-dhcp service commands to their own class
jhughesoti Jul 13, 2023
4bdacf3
fix dhcp1
jhughesoti Jul 13, 2023
a57393b
Merge branch 'main' into dev
jboddey Jul 14, 2023
d376655
Initial CI testing for tests (#72)
noursaidi Jul 14, 2023
01761dd
Fix radvd conf
jboddey Jul 14, 2023
c23f258
Fix individual test disable
jhughesoti Jul 14, 2023
97c4c65
Merge branch 'dev' of https://github.com/auto-iot/test-run into dev
jhughesoti Jul 14, 2023
5d24497
Add NTP Pass CI test (#76)
noursaidi Jul 17, 2023
006aa11
add shared address test (#75)
jhughesoti Jul 17, 2023
153de19
Fix single ip test (#58)
jhughesoti Jul 17, 2023
e2c934e
Merge API into dev (#70)
jboddey Jul 24, 2023
0023003
Dhcp tests (#81)
jhughesoti Aug 2, 2023
4b1d69c
Merge tls tests into dev (#80)
jboddey Aug 2, 2023
4ce26a1
Test output restructure (#79)
jhughesoti Aug 3, 2023
c78f2de
Keep test results in memory (#82)
jboddey Aug 3, 2023
11c9740
Result descriptions (#92)
jhughesoti Aug 11, 2023
9046ffd
Misc cleanup (#93)
jhughesoti Aug 11, 2023
fca08ce
Resolve merge conflicts
jboddey Aug 15, 2023
5c9c7cc
Allow CORS (#91)
jboddey Aug 16, 2023
29242c4
Add /history and device config endpoints (#88)
jboddey Aug 16, 2023
290ba50
Re-enable actions, fix conn module (#89)
jboddey Aug 16, 2023
38792e8
Add required result to module configs (#95)
jboddey Aug 16, 2023
6afd9ea
Fix DNS test name (#110)
jboddey Aug 31, 2023
2cbc343
Clear runtime folder on start (#111)
jboddey Aug 31, 2023
f98ea18
Initial work on pdf report output and format via html (#103)
jhughesoti Sep 1, 2023
8d7c6f7
Add user interface (#98)
jboddey Sep 1, 2023
13ec5b8
Add some documentation
jboddey Sep 4, 2023
702147c
Save test modules (#115)
jboddey Sep 9, 2023
5d41edb
Expand testing to include API and more testing (#96)
noursaidi Sep 11, 2023
b4dd440
Create Testrun package (#114)
jboddey Sep 12, 2023
87367ab
Merge conflicts
jboddey Sep 12, 2023
78e2d92
Remove merge conflicts
jboddey Sep 12, 2023
30baa40
Add extra validation (#118)
jboddey Sep 14, 2023
e7c2906
Refactor nmap module (#102)
jboddey Sep 14, 2023
a57080e
Add protocol module (#107)
jhughesoti Sep 15, 2023
3c10ba1
Hotfix
jboddey Sep 15, 2023
1d1719f
bug fixes (#119)
jboddey Sep 18, 2023
b42b31d
Chronyd (#116)
jhughesoti Sep 18, 2023
6bad0dd
Test fixes (#123)
jhughesoti Sep 21, 2023
62c95e1
Update README.md
jboddey Sep 21, 2023
0472605
Resolve 2 bugs (#121)
jboddey Sep 26, 2023
9975341
Bug/test count nmap check (#124)
jboddey Sep 26, 2023
9746a13
Report styling (#122)
jhughesoti Sep 26, 2023
129870b
Update UI (#125)
jboddey Sep 26, 2023
fe4275d
Test fixes (#127)
jhughesoti Sep 27, 2023
1be60c3
Add docs, disable network validation by default (#126)
jboddey Sep 28, 2023
61a184d
Implement delete device endpoint (#129)
jboddey Oct 2, 2023
b3242d9
Sync dev with main (#156)
jboddey Oct 16, 2023
b4afc7d
Delete report (#157)
jboddey Oct 16, 2023
da9f771
Ipv6 updates (#131)
jhughesoti Oct 20, 2023
b652479
Update UI
jboddey Oct 24, 2023
d5888a2
Bug fixes (#166)
jhughesoti Oct 27, 2023
74cf624
Merge main hotfix into dev (#165)
jboddey Oct 31, 2023
9b38941
Conn test fixes (#167)
jhughesoti Nov 6, 2023
982c1b9
Add workflow for UI test (#177)
jboddey Nov 9, 2023
8445bbb
Fix duplicate port number (#175)
jboddey Nov 10, 2023
0104bb5
Check all packet captures for SLAAC address (#173)
jboddey Nov 13, 2023
c6bcda4
Remove interfaces which should not be chosen (#161)
jboddey Nov 13, 2023
31b2c36
Fix device search issue (#176)
jboddey Nov 13, 2023
86a1d1f
Add hotfix to dev (#181)
jboddey Nov 13, 2023
9fa6f03
Bug fixes
jboddey Nov 13, 2023
811a623
Increase connection timeout to 30 minutes (#185)
jhughesoti Dec 1, 2023
9d327bc
Add new testrun statuses (#195)
jboddey Dec 3, 2023
aa5edc5
Resolve some bugs (#193)
jboddey Dec 3, 2023
d463e5e
Check that Docker is installed (#178)
jboddey Dec 3, 2023
a1d5e8c
Add version endpoint (#196)
jboddey Dec 3, 2023
357fc49
Fix bugs and update UI (#198)
jboddey Dec 8, 2023
905be03
Update UI and API to allow for remote connections (#202)
jhughesoti Dec 8, 2023
4de04da
Add device configuration to PDF report (#203)
jboddey Dec 9, 2023
c8a78ba
Add separate error message if config not completed (#197)
jboddey Dec 9, 2023
0ffef4a
Resolve merge conflicts with main (#208)
jboddey Dec 14, 2023
bf14ce8
Add instruction for local CA cert (#204)
jboddey Dec 14, 2023
d36c0d0
Add UI and update README (#207)
jboddey Dec 14, 2023
19d044a
Fix remote ui (#205)
jhughesoti Dec 14, 2023
bc1830a
Resolve merge conflicts
jboddey Dec 15, 2023
5ef25aa
Remove unused docker file
jboddey Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: Tests
runs-on: ubuntu-20.04
needs: testrun_baseline
timeout-minutes: 40
timeout-minutes: 45
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
Expand All @@ -44,13 +44,12 @@ jobs:
- name: Install Testrun
shell: bash {0}
run: sudo dpkg -i testrun*.deb
timeout-minutes: 10
- name: Run tests
shell: bash {0}
run: testing/tests/test_tests
- name: Archive runtime results
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/ /usr/local/testrun/local/
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/
- name: Upload runtime results
uses: actions/upload-artifact@v3
if: ${{ always() }}
Expand All @@ -69,16 +68,26 @@ jobs:
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
- name: Package Testrun
- name: Package Testrun
shell: bash {0}
run: cmd/package
- name: Install Testrun
shell: bash {0}
run: sudo dpkg -i testrun*.deb
timeout-minutes: 10
timeout-minutes: 30
- name: Run tests
shell: bash {0}
run: testing/api/test_api
- name: Archive runtime results
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/ /usr/local/testrun/local/
- name: Upload runtime results
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: runtime_${{ github.workflow }}_${{ github.run_id }}
path: runtime.tgz

pylint:
name: Pylint
Expand All @@ -105,4 +114,26 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: Testrun Installer
path: testrun*.deb
path: testrun*.deb

testrun_ui:
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18.10.0
- name: Install Chromium Browser
run: sudo apt install chromium-browser
- name: Install dependencies
run: npm install && npm ci
working-directory: ./modules/ui
- name: Run tests
run: |
export CHROME_BIN=/usr/bin/chromium-browser
CI=true npm run test-headless
env:
CI: true
working-directory: ./modules/ui
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,35 @@
[![Testrun test suite](https://github.com/google/testrun/actions/workflows/testing.yml/badge.svg?branch=main&event=push)](https://github.com/google/testrun/actions/workflows/testing.yml)

## Introduction :wave:
Testrun automates specific test cases to verify network and security functionality in IoT devices. It is an open source tool which allows external manufacturers to test their devices for the purposes of Device Qualification within the BOS program.
Testrun automates specific test cases to verify network and security functionality in IoT devices. It is an open source tool which allows manufacturers of IP capable devices to test their devices for the purposes of Device Qualification within the BOS program.

## Motivation :bulb:
Without tools like Testrun, testing labs may be maintaining a large and complex network using equipment such as: A managed layer 3 switch, an enterprise-grade network router, virtualized or physical servers to provide DNS, NTP, 802.1x etc. With this amount of moving parts, all with dynamic configuration files and constant software updates, more time is likely to be spent on preparation and clean up of functinality or penetration testing - not forgetting the number of software tools required to perform the testing. The major issues which can and should be solved:
Without tools like Testrun, test labs and engineers may need to maintain a large and complex network coupled with dynamic configuration files and constant software updates. The major issues which can and should be solved are:
1) The complexity of managing a testing network
2) The time required to perform testing of network functionality
3) The accuracy and consistency of testing network functionality

## How it works :triangular_ruler:
Testrun creates an isolated and controlled network environment to fully simulate enterprise network deployments in your device testing lab.
This removes the necessity for complex hardware, advanced knowledge and networking experience whilst enabling semi-technical engineers to validate device
behaviour against industry cyber standards.
Testrun creates an isolated and controlled network environment on a linux machine. This removes the necessity for complex hardware, advanced knowledge and networking experience whilst enabling test engineers to validate device behaviour against Google’s Building Operating System requirements.

Two runtime modes are supported by Testrun:
Two modes are supported by Testrun:

1) <strong>Automated testing</strong>

Once the device has become operational (steady state), automated testing of the device under test will begin. Containerized test modules will then execute against the device (one module at a time). Once all test modules have completed execution, a final test report will be produced - presenting the results and further description of findings.
Once the device has become operational (steady state), automated testing of the DUT (device under test) will begin. Containerized test modules will then execute against the device, one module at a time. Once all test modules have been executed, a report will be produced - presenting the results.

2) <strong>Lab network</strong>

Testrun cannot automate everything, and so additional manual testing may be required (or configuration changes may be required on the device). Rather than having to maintain a separate but idential lab network, Testrun will provide the network and some tools to assist an engineer performing the additional testing. At the same time, packet captures of the device behaviour will be recorded, alongside logs for each network service, for further debugging.
When manual testing or configuration changes are required, Testrun will provide the network and some tools to assist an engineer performing the additional testing. This reduces the need to maintain a separate but identical lab network. Testrun will take care of packet captures and logs for each network service for further debugging.

## Minimum requirements :computer:
### Hardware
- PC running Ubuntu LTS (laptop or desktop)
- PC running Ubuntu LTS 20.04 or 22.04 (laptop or desktop)
- 2x USB ethernet adapter (One may be built in ethernet)
- Internet connection
### Software
- Docker - installation guide: [https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
### Device
### Device under test (DUT)
- DHCP client - The device must be able to obtain an IP address via DHCP

## Get started ▶️
Expand Down Expand Up @@ -68,8 +66,7 @@ The contributing requirements can be found in [CONTRIBUTING.md](CONTRIBUTING.md)

3) Can I run Testrun on a virtual machine?

Probably. Provided that the required 2x USB ethernet adapters are passed to the virtual machine as USB devices rather than network adapters, Testrun should
still work. We will look to test and approve the use of virtualisation to run Testrun in the future.
Testrun can be virtualized if the 2x ethernet adapters are passed through to a Virtual Box VM as a USB device rather than managed network adapters. A full guide will be provided once virtualization of Testrun has been fully tested.

4) Can I connect multiple devices to Testrun?

Expand Down
19 changes: 19 additions & 0 deletions cmd/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Check if Docker is installed
if [[ $(which docker) && $(docker --version) ]]; then
# Docker is installed
echo Using $(docker --version)
else
# Docker is not installed
echo Docker is not installed. Please follow the Get Started guide at https://github.com/google/testrun
exit 1
fi

# Stop any running containers
echo Stopping any running containers
running_containers=$(docker container ls -q --filter name=tr-*)
if [ -n "$running_containers" ]; then
docker container kill $running_containers
else
echo No containers were found running
fi

# Builds all docker images
echo Building docker images

Expand Down
4 changes: 2 additions & 2 deletions cmd/package
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mkdir -p $MAKE_SRC_DIR/usr/local/testrun/local/devices

# Copy root_certs folder
mkdir -p local/root_certs
cp -r local/root_certs $MAKE_SRC_DIR/usr/local/testrun/local/root_certs
cp -r local/root_certs $MAKE_SRC_DIR/usr/local/testrun/local/

# Copy framework and modules into testrun folder
cp -r {framework,modules} $MAKE_SRC_DIR/usr/local/testrun
Expand All @@ -53,4 +53,4 @@ cp -r {framework,modules} $MAKE_SRC_DIR/usr/local/testrun
dpkg-deb --build --root-owner-group make

# Rename the .deb file
mv make.deb testrun_1-0-3_amd64.deb
mv make.deb testrun_1-1_amd64.deb
2 changes: 1 addition & 1 deletion cmd/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@

echo Installing system dependencies

sudo apt-get install openvswitch-common openvswitch-switch python3 libpangocairo-1.0-0
sudo apt-get update && sudo apt-get install openvswitch-common openvswitch-switch python3 libpangocairo-1.0-0

echo Finished installing system dependencies
29 changes: 29 additions & 0 deletions docs/configure_device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Device Configuration

The device configuration file allows you to customize the testing behavior for a specific device. This file is located at `local/devices/{Device Name}/device_config.json`. Below is an overview of how to configure the device tests.

## Device Information

The device information section includes the manufacturer, model, and MAC address of the device. These details help identify the specific device being tested.

## Test Modules

Test modules are groups of tests that can be enabled or disabled as needed. You can choose which test modules to run on your device.

### Enabling and Disabling Test Modules

To enable or disable a test module, modify the `enabled` field within the respective module. Setting it to `true` enables the module, while setting it to `false` disables the module.

## Customizing the Device Configuration

To customize the device configuration for your specific device, follow these steps:

1. Copy the default configuration file provided in the `resources/devices/template` folder.
- Create a new folder for your device under `local/devices` directory.
- Copy the `device_config.json` file from `resources/devices/template` to the newly created device folder.

This ensures that you have a copy of the default configuration file, which you can then modify for your specific device.

> Note: Ensure that the device configuration file is properly formatted, and the changes made align with the intended test behavior. Incorrect settings or syntax may lead to unexpected results during testing.

If you encounter any issues or need assistance with the device configuration, refer to the Testrun documentation or ask a question on the Issues page.
4 changes: 3 additions & 1 deletion docs/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ However, to achieve a compliant test outcome, your device must be configured cor
- Testing data will be available in the ``local/devices/{device}/reports`` folders
- Additional configuration options are available in the ``local/system.json`` file

**NOTE: Place your local CA certificate in local/root_certs (any name with a .crt extension) to perform TLS server tests**

## Start Testrun

1. Attach network interfaces:
Expand Down Expand Up @@ -105,4 +107,4 @@ If you encounter any issues or need assistance, consider the following:
- Refer to the Testrun documentation or ask for assistance in the issues page: https://github.com/google/testrun/issues

# Uninstall
To uninstall Testrun, use the built-in dpkg uninstall command to remove Testrun correctly. For Testrun, this would be: ```sudo apt-get remove testrun```
To uninstall Testrun, use the built-in dpkg uninstall command to remove Testrun correctly. For Testrun, this would be: ```sudo apt-get remove testrun```
Loading