network_WiFi_AttenuatedPerf: Remove suffix ".cros"
The hostname mappings in the attenuator_hosts.py don't contain the
".cros" suffix and running the test with the hostname
"chromeos1-dev-host4-attenuator.cros" would raise an unexpected RvR host
name error even though the hostname "chromeos1-dev-host4-attenuator"
exists.
BUG=chromium:827829
TEST=run the test network_WiFi_AttenuatedPerf.ht40_ch001
Change-Id: I08cf9025a727bc6cf8bde9c2e8533c45ce23e59b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2015613
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Harpreet Grewal <harpreet@chromium.org>
Tested-by: Arowa Suliman <arowa@chromium.org>
diff --git a/server/cros/network/attenuator_controller.py b/server/cros/network/attenuator_controller.py
index 3a44bf3..90d91f3 100644
--- a/server/cros/network/attenuator_controller.py
+++ b/server/cros/network/attenuator_controller.py
@@ -37,9 +37,10 @@
"""
self.hostname = hostname
super(AttenuatorController, self).__init__()
- if hostname not in HOST_TO_FIXED_ATTENUATIONS.keys():
+ part = hostname.split('.', 1)[0]
+ if part not in HOST_TO_FIXED_ATTENUATIONS.keys():
raise error.TestError('Unexpected RvR host name %r.' % hostname)
- self._fixed_attenuations = HOST_TO_FIXED_ATTENUATIONS[hostname]
+ self._fixed_attenuations = HOST_TO_FIXED_ATTENUATIONS[part]
num_atten = len(self.supported_attenuators)
self._attenuator = attenuator.Attenuator(hostname, num_atten)