summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2015-09-11 15:43:58 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2015-09-16 14:55:39 +0000
commit6d7b2bc0f1a62c786dab4f0ea3e61609de5988eb (patch)
treebe99976c6053edc2962a5f61b9ac20b19d6d6e16
parent6513e3c8c7426c3900334b640326d1549fbb0f21 (diff)
downloadciat-tester-6d7b2bc0f1a62c786dab4f0ea3e61609de5988eb.tar.gz
Improve test command running, and other review comments from Richard Maw.
-rwxr-xr-xopenstack/tester14
1 files changed, 6 insertions, 8 deletions
diff --git a/openstack/tester b/openstack/tester
index 5d8ed41..adc260e 100755
--- a/openstack/tester
+++ b/openstack/tester
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2014 Codethink Ltd
+# Copyright 2015 Codethink Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,17 +15,15 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-'''release-test
+'''openstack/tester
-This script deploys the set of systems in the cluster morphology it is
-instructed to read, to test that they work correctly.
+This script tests an image on openstack.
'''
import cliapp
import os
import pipes
-import shlex
import shutil
import socket
import tempfile
@@ -191,7 +189,7 @@ class Deployment(object):
time.sleep(20)
# Assign a floating IP address
- for retries in range(5, 0, -1):
+ for _ in xrange(5):
ip_list = nc.floating_ips.list()
free_ip = None
for ip in ip_list:
@@ -238,7 +236,7 @@ class ReleaseApp(cliapp.Application):
for test in tests:
with open(test, 'r') as stream:
- data=yaml.load(stream)
+ data = yaml.load(stream)
if data == None:
continue
@@ -252,7 +250,7 @@ class ReleaseApp(cliapp.Application):
print('Running test: ' + data['name'])
for cmd in data['commands']:
print('$ ' + cmd)
- instance.runcmd(shlex.split(cmd), stdout=self.output)
+ instance.runcmd(['sh', '-c', cmd], stdout=self.output)
def deploy_and_test_systems(self, tests):
"""Run the deployments and tests"""