1# Copyright 2020 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""" 5Test utilities for the Apollo kit Chromebox and IP peripherals 6""" 7 8import logging 9 10from autotest_lib.client.bin import utils 11 12 13def ectool_pse_status(port): 14 result = utils.run('ectool pse {0}'.format(port)).stdout.strip() 15 logging.debug("ectool pse output for port {0}: {1}".format(port, result)) 16 17 # Strip stdout to return only the status 18 prefix = 'Port {0}: '.format(port) 19 if not result.startswith(prefix): 20 return error 21 22 return result[len(prefix):] 23 24 25def ectool_pse_enable(port): 26 utils.run('ectool pse {port} enable'.format(port=port)) 27 28 29def ectool_pse_disable(port): 30 utils.run('ectool pse {port} disable'.format(port=port)) 31