-
Notifications
You must be signed in to change notification settings - Fork 15
docs: add aparcar lab #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,14 +7,21 @@ real. Using [`labgrid`](https://labgrid.readthedocs.io/en/latest/) to control | |||||
| the devices, the framework offers a simple way to write tests and run them on | ||||||
| different hardware. | ||||||
|
|
||||||
| ## Requirements | ||||||
| ## Testing | ||||||
|
|
||||||
| This section provides information on how to run tests using OpenWrt Testing, | ||||||
| either on real or emulated devices. If you want to deploy real devices for | ||||||
| testing, please see the *Lab Setup* section.. | ||||||
|
|
||||||
| ### Requirements | ||||||
|
|
||||||
| There are multiple ways to run tests, on real or emulated devices. | ||||||
|
|
||||||
| - An OpenWrt firmware image | ||||||
| - Python and [`uv`](https://docs.astral.sh/uv/) | ||||||
| - QEMU | ||||||
| - QEMU (for emulated devices) | ||||||
|
|
||||||
|
|
||||||
| ## Setup | ||||||
| ### Setup | ||||||
|
|
||||||
| For maximum convenience, clone the repository inside the `openwrt.git` | ||||||
| repository as `tests/`: | ||||||
|
|
@@ -51,8 +58,6 @@ You can run tests via the Makefile or directly using `pytest`. | |||||
|
|
||||||
| You can start runtime and shell tests via the Makefile. | ||||||
|
|
||||||
| #### Runtime tests | ||||||
|
|
||||||
| ```shell | ||||||
| cd /path/to/openwrt.git | ||||||
| make tests/x86-64 V=s | ||||||
|
|
@@ -145,3 +150,50 @@ Lastly, unlock your device when you're done: | |||||
| ```shell | ||||||
| uv run labgrid-client unlock | ||||||
| ``` | ||||||
|
|
||||||
| ## Lab Setup | ||||||
|
|
||||||
| Setting up a new lab involves several steps and is a fun and curious process, | ||||||
| however some precise and forward thinking is required to ensure a successful | ||||||
| setup. This section describes a low-cost setup usable for network communities | ||||||
| and individuals. Larger setups will be added in the future. | ||||||
|
|
||||||
| ### Concept | ||||||
|
|
||||||
| The general idea is to have independent labs (i.e. coordinator and exporter) and | ||||||
| connect them over a global coordinator, which has access to all labs. Developers | ||||||
| and CI can access individual labs over the global coordinator, the graphic below | ||||||
| gives an idea. | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| This decentralized approach allows labs to function even if the global | ||||||
| coordinator is down. Also access management can be individually controlled, i.e. | ||||||
| which developer may access which lab or at what time automated CIs run tests. | ||||||
|
|
||||||
| ### Requirements | ||||||
|
|
||||||
| * Coordinator/Exporter (i.e **RaspberryPi 5**) | ||||||
| * PoE switch (i.e. **Zyxel GS1900-8HP**) | ||||||
| * PoE Splitter (12v, 5v, etc.) | ||||||
| * Devices-Under-Test (DUTs) | ||||||
| * Some cables | ||||||
| * A guest wifi | ||||||
|
|
||||||
| ### Setup | ||||||
|
|
||||||
| For a minimal setup, a single device runs the coordinator and exporter at the | ||||||
| same time, from now on called controller. The controller is connected to a PoE | ||||||
| switch, managing network and power. A serial to USB-to-serial converter is | ||||||
| needed for each *Device Under Test* (DUT) as well as a PoE splitter. | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > Larger setups may run multiple exporters, each connected to a separate PoE | ||||||
| > switch. | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| ### Conroller | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The controller should be setup via Ansible, which install `labgrid` as well as | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| all required tools. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @aparcar ! I have a question that came to mind while looking at tihis diagram. Each lab has a "Lab Coordinator." How are these coordinators different from the Global Coordinator / what are they needed for? My guess is that the green lab coordinators are only involved in local testing of each lab. Otherwise, the interaction is directly between the global coordinator and each lab's exporter.. is this right? |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| # Devices in LeineLab Testlab | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be Aparcar lab, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Coordinator/Exporter | ||||||
|
|
||||||
| ### Raspberry Pi 5 | ||||||
|
|
||||||
| - Ethernet (eth0): Connection to Switch | ||||||
| - Hardware serial: Not connected | ||||||
| - GPIO: Not connected | ||||||
| - USB: Connected to USB Serial converters and a USB hub | ||||||
|
|
||||||
| ## Switch | ||||||
|
|
||||||
| ### Zyxel GS1900-10HP Switch | ||||||
|
|
||||||
| - Ethernet Ports: | ||||||
| - Port 1 (eth): Connected to managed switch untagged VLAN 101 | ||||||
| - Port 2 (eth): Connected to managed switch untagged VLAN 102 | ||||||
| - Port 3 (eth): Connected to managed switch untagged VLAN 103 | ||||||
| - Port 4 (eth): Connected to managed switch untagged VLAN 104 | ||||||
| - Port 5 (eth): Connected to managed switch untagged VLAN 105 | ||||||
| - Port 6 (eth): Connected to managed switch untagged VLAN 106 | ||||||
| - Port 7 (eth): Connected to managed switch untagged VLAN 107 | ||||||
| - Port 8 (eth): Connected to managed switch untagged VLAN 108 | ||||||
| - Port 9 (sfp): Connected to unmanaged switch untagged VLAN 200 | ||||||
| - Port 10 (sfp): Connected to Raspberry Pi 5 | ||||||
|
|
||||||
| ## DUT | ||||||
|
|
||||||
| ### genexis_pulse-ex400 | ||||||
|
|
||||||
| - WAN Port: Connected to unmanaged switch | ||||||
| - LAN-Port 1: Connected to managed switch VLAN 101 | ||||||
|
|
||||||
| ### tplink_tl-wdr3600-v1 | ||||||
|
|
||||||
| - WAN Port: Connected to unmanaged switch | ||||||
| - LAN-Port 1: Connected to managed switch VLAN 102 | ||||||
|
|
||||||
| ### openwrt_one | ||||||
|
|
||||||
| - WAN Port: Connected to managed switch VLAN 103 | ||||||
| - LAN-Port 1: Connected to managed switch VLAN 104 | ||||||
|
|
||||||
| ### bananapi_bpi-r4 | ||||||
|
|
||||||
| - WAN Port: Connected to unmanaged switch | ||||||
| - LAN-Port 1: Connected to managed switch VLAN 105 | ||||||
|
|
||||||
| ### glinet_gl-mt6000 | ||||||
|
|
||||||
| - WAN Port: Connected to unmanaged switch | ||||||
| - LAN-Port 1: Connected to managed switch VLAN 107 | ||||||
|
|
||||||
| ### rpi-4 | ||||||
|
|
||||||
| - LAN-Port 1: Connected to managed switch VLAN 108 | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that all labs use PoE for power control, right?. Maybe it would be nice to have a "Power Control Options" subsection that mentions more approaches. I'm thinking something like this: