Permalink
Browse files

adding in real image option

  • Loading branch information...
1 parent 9c735f4 commit 503f2b21b242343d3151614d4a79cba432ca0472 @buzztroll buzztroll committed Nov 21, 2011
Showing with 26 additions and 17 deletions.
  1. +8 −5 tests/cc-nimbusAdmin-test.py
  2. +10 −7 tests/cc-nimbusAdminList-test.py
  3. +8 −5 tests/cc-nimbusAdminShutdown-test.py
@@ -4,7 +4,10 @@
import sys
import os
-to=90
+to=int(os.environ["NIMBUS_TEST_TIMEOUT"])
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
cc_home=os.environ['CLOUD_CLIENT_HOME']
nimbus_home=os.environ['NIMBUS_HOME']
logfile = sys.stdout
@@ -15,14 +18,14 @@
print "The directory already exists"
pass
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile /etc/group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
-cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --run --name %s --hours .25" % (cc_home, tst_image_name)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Running:')
if rc != 0:
- print "group not found in the list"
+ print "%s not found in the list" % (tst_image_name)
sys.exit(1)
handle = child.readline().strip().replace("'", "")
rc = child.expect(pexpect.EOF)
@@ -40,6 +43,6 @@
(x, rc)=pexpect.run(cmd, withexitstatus=1)
print x
-cmd = "%s/bin/cloud-client.sh --delete --name group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --delete --name %s" % (cc_home, tst_image_name)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
sys.exit(0)
@@ -5,7 +5,10 @@
import os
import re
-to=90
+to=int(os.environ["NIMBUS_TEST_TIMEOUT"])
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
cc_home=os.environ['CLOUD_CLIENT_HOME']
nimbus_home=os.environ['NIMBUS_HOME']
nimbus_user=os.environ['NIMBUS_TEST_USER']
@@ -21,14 +24,14 @@
(x, rc)=pexpect.run(cmd, withexitstatus=1)
print x
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile /etc/group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
-cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --run --name %s --hours .25" % (cc_home, tst_image_name)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Running:')
if rc != 0:
- print "group not found in the list"
+ print "%s not found in the list" % (tst_image_name)
sys.exit(1)
handle = child.readline().strip().replace("'", "")
rc = child.expect(pexpect.EOF)
@@ -84,11 +87,11 @@
print "error"
sys.exit(1)
-cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --run --name %s --hours .25" % (cc_home, tst_image_name)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Running:')
if rc != 0:
- print "group not found in the list"
+ print "%s not found in the list" % (tst_image_name)
sys.exit(1)
handle = child.readline().strip().replace("'", "")
rc = child.expect(pexpect.EOF)
@@ -118,7 +121,7 @@
print "error"
sys.exit(1)
-cmd = "%s/bin/cloud-client.sh --delete --name group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --delete --name %s" % (cc_home, tst_image_name)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
if rc != 0:
print "error"
@@ -5,7 +5,10 @@
import os
import re
-to=90
+to=int(os.environ["NIMBUS_TEST_TIMEOUT"])
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
cc_home=os.environ['CLOUD_CLIENT_HOME']
nimbus_home=os.environ['NIMBUS_HOME']
nimbus_user=os.environ['NIMBUS_TEST_USER']
@@ -26,11 +29,11 @@ def id_from_handle(handle):
return id
def start_vm():
- cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
+ cmd = "%s/bin/cloud-client.sh --run --name %s --hours .25" % (cc_home, tst_image_name)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Running:')
if rc != 0:
- print "group not found in the list"
+ print "%s not found in the list" % (tst_image_name)
sys.exit(1)
handle = child.readline().strip().replace("'", "")
rc = child.expect(pexpect.EOF)
@@ -64,7 +67,7 @@ def assert_vms():
print "The directory already exists"
pass
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile /etc/group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
id = start_vm()
@@ -165,7 +168,7 @@ def assert_vms():
assert_no_vms()
-cmd = "%s/bin/cloud-client.sh --delete --name group" % (cc_home)
+cmd = "%s/bin/cloud-client.sh --delete --name %s" % (cc_home, tst_image_name)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
if rc != 0:
print "error"

0 comments on commit 503f2b2

Please sign in to comment.