1# Copyright 2022 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from autotest_lib.client.common_lib import error 6from autotest_lib.server import test 7 8 9class infra_DutServers(test.test): 10 """ 11 Verify the dutserver dut flag reaches a test. 12 """ 13 version = 1 14 15 def run_once(self, host, dut_servers): 16 """ 17 Starting point of this test. 18 Note: base class sets host as self._host. 19 20 @param host: The host address of the DUT 21 @param dut_servers: A list of server specified by --dut_servers flag. 22 23 @returns: Nothing but will raise an error if the dut_servers is empty. 24 """ 25 self.host = host 26 if not dut_servers: 27 raise error.TestError("DUT Server list is empty") 28 for c in dut_servers: 29 if not c: 30 raise error.TestError("DUT Server list %s has empty elements", 31 dut_servers) 32