Update example script to be more scalable for e2e tests.

Roles list can be set by env variables and build timeout can
also be set according to the scale of the test.

Change-Id: I99b28b155b79842706e32cbf518bef5b6df48db1
This commit is contained in:
zhaoxinyu 2014-03-14 18:03:47 +00:00
parent edf083e303
commit f43c0898a0

View File

@ -69,13 +69,15 @@ STORAGE_PROMISC = 0
HOME_PERCENTAGE = 40
TMP_PERCENTAGE = 10
VAR_PERCENTAGE = 15
ROLES_LIST = [['os-dashboard']]
#ROLES_LIST = [['os-dashboard']]
PRESET_VALUES = {
'NAMESERVERS': '192.168.10.1',
'NTP_SERVER': '192.168.10.1',
'GATEWAY': '192.168.10.1',
'PROXY': 'http://192.168.10.1:3128',
'ROLES_LIST': [['os-dashboard']],
'BUILD_TIMEOUT': 60
}
print os.environ.get("NAMESERVERS")
for v in PRESET_VALUES:
@ -232,6 +234,7 @@ print 'set partition config to cluster %s status: %s, resp: %s' % (
# set each host config in cluster.
ROLES_LIST = PRESET_VALUES['ROLES_LIST']
for host_id in host_ids:
if ROLES_LIST:
roles = ROLES_LIST.pop(0)
@ -250,7 +253,8 @@ print 'deploy cluster %s status: %s, resp: %s' % (cluster_id, status, resp)
# get intalling progress.
timeout = time.time() + 60 * 60
BUILD_TIMEOUT = float(PRESET_VALUES['BUILD_TIMEOUT'])
timeout = time.time() + BUILD_TIMEOUT * 60
while True:
status, resp = client.get_cluster_installing_progress(cluster_id)
print 'get cluster %s installing progress status: %s, resp: %s' % (