1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3# 4# Copyright 2020 The Chromium OS Authors. All rights reserved. 5# Use of this source code is governed by a BSD-style license that can be 6# found in the LICENSE file. 7 8"""Timeout test for command_executer.""" 9 10from __future__ import print_function 11 12__author__ = 'asharif@google.com (Ahmad Sharif)' 13 14import argparse 15import sys 16 17from cros_utils import command_executer 18 19 20def Usage(parser, message): 21 print('ERROR: %s' % message) 22 parser.print_help() 23 sys.exit(0) 24 25 26def Main(argv): 27 parser = argparse.ArgumentParser() 28 _ = parser.parse_args(argv) 29 30 command = 'sleep 1000' 31 ce = command_executer.GetCommandExecuter() 32 ce.RunCommand(command, command_timeout=1) 33 return 0 34 35 36if __name__ == '__main__': 37 Main(sys.argv[1:]) 38