• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4import ConfigParser
5import threading
6import xmlrpclib
7
8CONFIG_FILE = 'rpm_config.ini'
9CONFIG = ConfigParser.ConfigParser()
10CONFIG.read(CONFIG_FILE)
11remote_uri = CONFIG.get('RPM_INFRASTRUCTURE', 'frontend_uri')
12
13
14def 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
20def 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
36if __name__ == "__main__":
37    test()
38