Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions framework/python/src/core/testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ async def stop(self):
# First, change the status to stopping
self.get_session().stop()

# First, change the status to stopping
self.get_session().stop()

# Prevent discovering new devices whilst stopping
if self.get_net_orc().get_listener() is not None:
self.get_net_orc().get_listener().stop_listener()
Expand Down
2 changes: 1 addition & 1 deletion make/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Testrun
Version: 2.2
Version: 2.2.1
Architecture: amd64
Maintainer: Google <boddey@google.com>
Homepage: https://github.com/google/testrun
Expand Down
2 changes: 1 addition & 1 deletion modules/test/dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Within the ```python/src``` directory, the below tests are executed.
|---|---|---|---|
| dns.network.hostname_resolution | Verifies that the device resolves hostnames | The device sends DNS requests | Required |
| dns.network.from_dhcp | Verifies that the device allows for a DNS server to be provided by the DHCP server | The device sends DNS requests to the DNS server provided by the DHCP server | Informational |
| dns.mdns | Does the device has MDNS | Device may send MDNS requests | Informational |
| dns.mdns | Does the device has MDNS | Device may send MDNS requests | Informational |
14 changes: 7 additions & 7 deletions modules/test/ntp/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dependencies to user defined packages
# Package dependencies should always be defined before the user defined
# packages to prevent auto-upgrades of stable dependencies
# User defined packages
scapy==2.6.0
pyshark==0.6
# Dependencies to user defined packages
# Package dependencies should always be defined before the user defined
# packages to prevent auto-upgrades of stable dependencies

# User defined packages
scapy==2.6.0
pyshark==0.6
2 changes: 1 addition & 1 deletion modules/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions testing/device_configs/bacnet_compliant/device_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"mac_addr": "02:42:aa:00:00:01",
"manufacturer": "Google",
"model": "BACnet Compliant",
"type": "IoT Gateway",
"technology": "Hardware - Access Control",
"test_pack": "Pilot Assessment",
"additional_info": [
{
"question": "What type of device is this?",
"answer": "IoT Gateway"
},
{
"question": "Please select the technology this device falls into",
"answer": "Hardware - Access Control"
},
{
"question": "Does your device process any sensitive information?",
"answer": "Yes"
},
{
"question": "Can all non-essential services be disabled on your device?",
"answer": "Yes"
},
{
"question": "Is there a second IP port on the device?",
"answer": "Yes"
},
{
"question": "Can the second IP port on your device be disabled?",
"answer": "Yes"
}
],
"test_modules": {
"protocol": {
"enabled": true
},
"services": {
"enabled": false
},
"ntp": {
"enabled": false
},
"tls": {
"enabled": false
},
"connection": {
"enabled": false
},
"dns": {
"enabled": false
}
}
}
24 changes: 24 additions & 0 deletions testing/docker/ci_test_device1/bacnet_compliant/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use Ubuntu base image
FROM ubuntu@sha256:e6173d4dc55e76b87c4af8db8821b1feae4146dd47341e4d431118c7dd060a74

# Set non-interactive mode for apt
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && \
apt-get install -y isc-dhcp-client dnsutils netcat-openbsd arping python3 python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Install dependencies (BAC0)
RUN pip install BAC0==23.7.3 pytz==2024.2 netifaces==0.11.0

# Copy scripts
WORKDIR /app
COPY entrypoint.sh /entrypoint.sh
COPY entrypoint.py /entrypoint.py

# Make script executable
RUN chmod +x /entrypoint.sh /entrypoint.py

# Start BACnet device
ENTRYPOINT ["/entrypoint.sh"]
26 changes: 26 additions & 0 deletions testing/docker/ci_test_device1/bacnet_compliant/entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
BACnet/IP Virtual Device that Starts Without an IP (Waits for DHCP Assignment)
"""

import time
import BAC0


def start_bacnet_device():
"""Starts the BACnet/IP virtual device with no pre-assigned IP."""

print("Starting BACnet Virtual Device...")

bacnet = BAC0.lite(deviceId=999)

bacnet.iam()

while True:
time.sleep(10)


if __name__ == "__main__":
start_bacnet_device()
28 changes: 28 additions & 0 deletions testing/docker/ci_test_device1/bacnet_compliant/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash -x

# Display network interfaces
ip a

INTF=eth0

# DHCP
ip addr flush dev $INTF
PID_FILE=/var/run/dhclient.pid
if [ -f $PID_FILE ]; then
kill -9 $(cat $PID_FILE) || true
rm -f $PID_FILE
fi
dhclient -v $INTF
DHCP_TPID=$!
echo $DHCP_TPID

# Start BACnet device
exec python3 /entrypoint.py

# Keep network monitoring (can refactor later for other network modules)
(while true; do arping 10.10.10.1; sleep 10; done) &
(while true; do ip a | cat; sleep 10; done) &

# Keep the script running
tail -f /dev/null

Loading