cros-test: add cellular info, hwid info to dut labels
BUG=b:254687972
TEST=sudo emerge cros-test, cq
Change-Id: If3b5a5b65c3f1443e1de01cb9851094a05059aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/4023994
Reviewed-by: Azizur Rahman <azrahman@google.com>
Commit-Queue: Azizur Rahman <azrahman@google.com>
Tested-by: Derek Beckett <dbeckett@chromium.org>
diff --git a/src/chromiumos/test/execution/cmd/cros-test/internal/device/dut_info.go b/src/chromiumos/test/execution/cmd/cros-test/internal/device/dut_info.go
index 02a7c8d..f973429 100644
--- a/src/chromiumos/test/execution/cmd/cros-test/internal/device/dut_info.go
+++ b/src/chromiumos/test/execution/cmd/cros-test/internal/device/dut_info.go
@@ -36,6 +36,8 @@
TouchMimo bool // If the DUT has a TouchMimo label
CameraboxFacing string // The direction the camerabox is facing, ie "front" or "back"
CableList []string // The list of cables attached
+ CarrierList []string // the list of carriers
+ HwIDList []string // HwIDlist
}
// joinHostAndPort joins host and port to a single address.
@@ -164,6 +166,28 @@
}
}
+ var carriers []string
+ if car := chromeOS.Cellular; car != nil {
+ if len(car.Operators) > 0 {
+ for _, v := range car.Operators {
+ lv := "carrier:" + strings.ToLower(v.String())
+ carriers = append(carriers, lv)
+
+ }
+
+ }
+ }
+
+ var hwids []string
+ if hwid := chromeOS.HwidComponent; len(hwid) > 0 {
+ for _, v := range hwid {
+ // TODO: Figure out why this proto has an empty space at end
+ // eg. USBAUDIO is returning "USBAUDIO "
+ lv := "hwid_component:" + strings.ToLower(v)
+ hwids = append(hwids, lv)
+ }
+ }
+
return &DutInfo{
Addr: addr,
Role: role,
@@ -183,5 +207,7 @@
TouchMimo: touchMimo,
CameraboxFacing: cameraboxFacing,
CableList: cableList,
+ CarrierList: carriers,
+ HwIDList: hwids,
}, nil
}
diff --git a/src/chromiumos/test/execution/cmd/cros-test/internal/driver/tauto_driver.go b/src/chromiumos/test/execution/cmd/cros-test/internal/driver/tauto_driver.go
index de5e566..8390851 100644
--- a/src/chromiumos/test/execution/cmd/cros-test/internal/driver/tauto_driver.go
+++ b/src/chromiumos/test/execution/cmd/cros-test/internal/driver/tauto_driver.go
@@ -292,6 +292,14 @@
labels = append(labels, dut.CableList...)
}
+ if len(dut.CarrierList) > 0 {
+ labels = append(labels, dut.CarrierList...)
+ }
+
+ if len(dut.HwIDList) > 0 {
+ labels = append(labels, dut.HwIDList...)
+ }
+
return attrMap, labels, nil
}