Skip to contentSkip to conversation

labgrid-trini: Update for labgrid 26.0 support

PATCH In review Tom Rini 1 participant 2 messages Oct 9 – Oct 12

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 labgrid-trini: Update for labgrid 26.0 support

As part of the development for labgrid 26.0, the behavior was changed[1] such that if you specify an environment file, all resources in it will be locked on acquire, not just the named place. Given that power control in this lab is not available in a supported regular driver, we must have an environment file for that. So, change to having an environment file per hardware device, which also means the environment file says the location of the coordinator.

[1]: https://github.com/labgrid-project/labgrid/commit/a9b59e4e

---
This is a medium-term solution. The long term solution is replacing the PDU with one that's fully supported in upstream labgrid, or being able to move to a version of labgrid that's integrated full support for this PDU. For the latter, https://github.com/labgrid-project/labgrid/pull/1789

---
 README.md                                |   4 +-
 bin/common.labgrid-trini                 |   5 -
 bin/sage/bbb-1-env.yaml                  |  29 ++++
 bin/sage/hb-1-env.yaml                   |  29 ++++
 bin/sage/labgrid-sage-env.yaml           | 175 -----------------------
 bin/sage/pine64-1-env.yaml               |  29 ++++
 bin/sage/rpi3-1-env.yaml                 |  29 ++++
 bin/sage/rpi4-1-env.yaml                 |  29 ++++
 bin/sage/sage-exporter-bbb-1-env.yaml    |  14 ++
 bin/sage/sage-exporter-hb-1-env.yaml     |  14 ++
 bin/sage/sage-exporter-pine64-1-env.yaml |  14 ++
 bin/sage/sage-exporter-rpi3-1-env.yaml   |  14 ++
 bin/sage/sage-exporter-rpi4-1-env.yaml   |  14 ++
 13 files changed, 217 insertions(+), 182 deletions(-)
 create mode 100644 bin/sage/bbb-1-env.yaml
 create mode 100644 bin/sage/hb-1-env.yaml
 delete mode 100644 bin/sage/labgrid-sage-env.yaml
 create mode 100644 bin/sage/pine64-1-env.yaml
 create mode 100644 bin/sage/rpi3-1-env.yaml
 create mode 100644 bin/sage/rpi4-1-env.yaml
 create mode 100644 bin/sage/sage-exporter-bbb-1-env.yaml
 create mode 100644 bin/sage/sage-exporter-hb-1-env.yaml
 create mode 100644 bin/sage/sage-exporter-pine64-1-env.yaml
 create mode 100644 bin/sage/sage-exporter-rpi3-1-env.yaml
 create mode 100644 bin/sage/sage-exporter-rpi4-1-env.yaml
README.md +2 -2
index 6171669228cf..9958e21bcf77 100644
@@ -253,9 +253,9 @@ That should be all that is needed.
 An alternate implementation requires setting the following environment
 variables must be set as per your lab:
 
-- `LG_COORDINATOR` must point at the labgrid coordinator service.
 - `LG_PLACE` must point at the device under test.
-- `LG_ENV` must point at the labgrid yaml file that describes your lab.
+- `LG_ENV` must point at the labgrid yaml file that describes your lab
+  including the coordinator.
 
 In order for a given platform to be tested, it must be acquired before starting
 tests and then released once complete. See the bin/konsulko-labgrid directory
bin/common.labgrid-trini +0 -5
index b3c7d07ca7f0..0fe5ffcf300a 100644
@@ -19,11 +19,6 @@
 # DEALINGS IN THE SOFTWARE.
 
 # Ensure we have all environment variables set
-if [ -z "${LG_COORDINATOR}" ]; then
-	echo "LG_COORDINATOR is unset";
-	exit 1;
-fi
-
 if [ -z "${LG_PLACE}" ]; then
 	echo "LG_PLACE is unset";
 	exit 1;
bin/sage/bbb-1-env.yaml new file +29 -0
new file mode 100644
index 000000000000..9f79759b92ea
@@ -0,0 +1,29 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  bbb-1:
+    resources:
+      RemotePlace:
+        name: bbb-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.9 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.9 i 2
+      mux:
+        cls: USBSDMuxDriver
+      storage:
+        cls: USBStorageDriver
+      serial:
+        cls: SerialDriver
+      shell:
+        cls: ShellDriver
+        prompt: 'root@.*:~# '
+        login_prompt: 'login: '
+        username: root
+      uboot:
+        cls: UBootDriver
+        prompt: 'U-Boot> '
+        autoboot: Hit any key to stop autoboot
+      strategy:
+        cls: UBootStrategy
bin/sage/hb-1-env.yaml new file +29 -0
new file mode 100644
index 000000000000..6858213d619c
@@ -0,0 +1,29 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  hb-1:
+    resources:
+      RemotePlace:
+        name: hb-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.3 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.3 i 2
+      mux:
+        cls: USBSDMuxDriver
+      storage:
+        cls: USBStorageDriver
+      serial:
+        cls: SerialDriver
+      shell:
+        cls: ShellDriver
+        prompt: 'root@.*:~# '
+        login_prompt: 'login: '
+        username: root
+      uboot:
+        cls: UBootDriver
+        prompt: 'U-Boot> '
+        autoboot: Hit any key to stop autoboot
+      strategy:
+        cls: UBootStrategy
bin/sage/labgrid-sage-env.yaml deleted +0 -175

175 lines not on this page · raw message

bin/sage/pine64-1-env.yaml new file +29 -0
new file mode 100644
index 000000000000..9ad5a56c6396
@@ -0,0 +1,29 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  pine64-1:
+    resources:
+      RemotePlace:
+        name: pine64-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.4 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.4 i 2
+      mux:
+        cls: USBSDMuxDriver
+      storage:
+        cls: USBStorageDriver
+      serial:
+        cls: SerialDriver
+      shell:
+        cls: ShellDriver
+        prompt: 'root@.*:~# '
+        login_prompt: 'login: '
+        username: root
+      uboot:
+        cls: UBootDriver
+        prompt: 'U-Boot> '
+        autoboot: Hit any key to stop autoboot
+      strategy:
+        cls: UBootStrategy
bin/sage/rpi3-1-env.yaml new file +29 -0
new file mode 100644
index 000000000000..ced8c46b05b0
@@ -0,0 +1,29 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  rpi3-1:
+    resources:
+      RemotePlace:
+        name: rpi3-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.1 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.1 i 2
+      mux:
+        cls: USBSDMuxDriver
+      storage:
+        cls: USBStorageDriver
+      serial:
+        cls: SerialDriver
+      shell:
+        cls: ShellDriver
+        prompt: 'root@.*:~# '
+        login_prompt: 'login: '
+        username: root
+      uboot:
+        cls: UBootDriver
+        prompt: 'U-Boot> '
+        autoboot: Hit any key to stop autoboot
+      strategy:
+        cls: UBootStrategy
bin/sage/rpi4-1-env.yaml new file +29 -0
new file mode 100644
index 000000000000..24b81bc4571d
@@ -0,0 +1,29 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  rpi4-1:
+    resources:
+      RemotePlace:
+        name: rpi4-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.2 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.2 i 2
+      mux:
+        cls: USBSDMuxDriver
+      storage:
+        cls: USBStorageDriver
+      serial:
+        cls: SerialDriver
+      shell:
+        cls: ShellDriver
+        prompt: 'root@.*:~# '
+        login_prompt: 'login: '
+        username: root
+      uboot:
+        cls: UBootDriver
+        prompt: 'U-Boot> '
+        autoboot: Hit any key to stop autoboot
+      strategy:
+        cls: UBootStrategy
bin/sage/sage-exporter-bbb-1-env.yaml new file +14 -0
new file mode 100644
index 000000000000..be82a5e58bf5
@@ -0,0 +1,14 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  sage-exporter-bbb-1:
+    resources:
+      RemotePlace:
+        name: sage-exporter-bbb-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.13 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.13 i 2
+      ssh:
+        cls: SSHDriver
bin/sage/sage-exporter-hb-1-env.yaml new file +14 -0
new file mode 100644
index 000000000000..1b5bd3f1c45e
@@ -0,0 +1,14 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  sage-exporter-hb-1:
+    resources:
+      RemotePlace:
+        name: sage-exporter-hb-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.7 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.7 i 2
+      ssh:
+        cls: SSHDriver
bin/sage/sage-exporter-pine64-1-env.yaml new file +14 -0
new file mode 100644
index 000000000000..34b3409904b4
@@ -0,0 +1,14 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  sage-exporter-pine64-1:
+    resources:
+      RemotePlace:
+        name: sage-exporter-pine64-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.8 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.8 i 2
+      ssh:
+        cls: SSHDriver
bin/sage/sage-exporter-rpi3-1-env.yaml new file +14 -0
new file mode 100644
index 000000000000..b6d1b0bd7e41
@@ -0,0 +1,14 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  sage-exporter-rpi3-1:
+    resources:
+      RemotePlace:
+        name: sage-exporter-rpi3-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.5 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.5 i 2
+      ssh:
+        cls: SSHDriver
bin/sage/sage-exporter-rpi4-1-env.yaml new file +14 -0
new file mode 100644
index 000000000000..79b4fb9d9c5c
@@ -0,0 +1,14 @@
+options:
+  coordinator_address: 192.168.1.10:20408
+targets:
+  sage-exporter-rpi4-1:
+    resources:
+      RemotePlace:
+        name: sage-exporter-rpi4-1
+    drivers:
+      power:
+        cls: ExternalPowerDriver
+        cmd_on: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.6 i 1
+        cmd_off: snmpset -v1 -c private 192.168.1.254 .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.6 i 2
+      ssh:
+        cls: SSHDriver
Signature · 1 line
2.43.0
author
#1 lore raw
Quoted 9 lines · Tom Rini

As part of the development for labgrid 26.0, the behavior was changed[1] such that if you specify an environment file, all resources in it will be locked on acquire, not just the named place. Given that power control in this lab is not available in a supported regular driver, we must have an environment file for that. So, change to having an environment file per hardware device, which also means the environment file says the location of the coordinator.

[...]

Applied to u-boot/u-boot-test-hooks.git/main, thanks!

[1/1] labgrid-trini: Update for labgrid 26.0 support

      commit: 59437fd1c7a6a84da05efe5cefde47264f78dcbe
Signature · 1 line
Tom