1 # Copyright (c) 2012 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 import ConfigParser 5 import threading 6 import xmlrpclib 7 8 CONFIG_FILE = 'rpm_config.ini' 9 CONFIG = ConfigParser.ConfigParser() 10 CONFIG.read(CONFIG_FILE) 11 remote_uri = CONFIG.get('RPM_INFRASTRUCTURE', 'frontend_uri') 12 13 14 def queue_request(dut_hostname, state): 15 client = xmlrpclib.ServerProxy(remote_uri, verbose=False) 16 result = client.queue_request(dut_hostname, state) 17 print dut_hostname, result 18 19 20 def test(): 21 """ 22 Simple Integration Testing of RPM Infrastructure. 23 """ 24 threading.Thread(target=queue_request, 25 args=('chromeos1-rack8e-hostbs1', 'ON')).start() 26 threading.Thread(target=queue_request, 27 args=('chromeos1-rack8e-hostbs2.cros', 'OFF')).start() 28 threading.Thread(target=queue_request, 29 args=('chromeos1-rack8e-hostbs3', 'OFF')).start() 30 threading.Thread(target=queue_request, 31 args=('chromeos-rack1-hostbs1', 'ON')).start() 32 threading.Thread(target=queue_request, 33 args=('chromeos-rack1-hostbs2', 'OFF')).start() 34 35 36 if __name__ == "__main__": 37 test() 38