Permalink
Browse files

breaking out the image name from the image location

  • Loading branch information...
1 parent 239fffd commit f3cd495664b87c649e3f4b03c53b045e15c898dd @buzztroll buzztroll committed Jun 13, 2011
View
@@ -4,13 +4,16 @@
import sys
import os
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
os.mkdir("%s/history/vm-999" % (cc_home))
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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)
View
@@ -4,19 +4,19 @@ backf=`mktemp`
rm $backf
cd $CLOUD_CLIENT_HOME
./bin/grid-proxy-init.sh
-./bin/cloud-client.sh --transfer --sourcefile $NIMBUS_TEST_IMAGE
+./bin/cloud-client.sh --transfer --sourcefile $NIMBUS_SOURCE_TEST_IMAGE
if [ $? -ne 0 ]; then
rm $backf
echo "upload failed"
exit 1
fi
-./bin/cloud-client.sh --delete --name group
+./bin/cloud-client.sh --delete --name $NIMBUS_TEST_IMAGE
if [ $? -ne 0 ]; then
rm $backf
echo "delete failed"
exit 1
fi
-./bin/cloud-client.sh --download --name group --localfile $backf
+./bin/cloud-client.sh --download --name $NIMBUS_TEST_IMAGE --localfile $backf
if [ $? -eq 0 ]; then
rm $backf
echo "download should have failed"
@@ -7,13 +7,17 @@
import tempfile
import filecmp
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
+
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -31,7 +35,7 @@
print "Download of the common image failed"
sys.exit(1)
-rc = filecmp.cmp(outFileName, os.environ['NIMBUS_TEST_IMAGE'])
+rc = filecmp.cmp(outFileName, tst_image_src)
os.remove(outFileName)
if not rc:
sys.exit(1)
@@ -7,6 +7,9 @@
import tempfile
import filecmp
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
+
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
@@ -16,7 +19,7 @@
os.system("cp /bin/bash /tmp/%s" % (common_image))
print "upload common image %s" % (common_image)
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -41,9 +44,9 @@
print "Down load of the common image failed"
sys.exit(1)
-rc = filecmp.cmp(common_file, os.environ['NIMBUS_TEST_IMAGE'])
+rc = filecmp.cmp(common_file, tst_image_src)
if not rc:
- print "The common file download was wrong %s != %s %s" % (common_file, os.environ['NIMBUS_TEST_IMAGE'], str(rc))
+ print "The common file download was wrong %s != %s %s" % (common_file, tst_image_src, str(rc))
sys.exit(1)
os.remove(common_file)
@@ -6,13 +6,15 @@
import uuid
to=90
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
View
@@ -3,6 +3,8 @@
import pexpect
import sys
import os
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
@@ -11,7 +13,7 @@
(x, rc)=pexpect.run("%s/bin/cloud-client.sh --delete --name group" % (cc_home), withexitstatus=1)
print x
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1)
print x
if rc != 0:
View
@@ -8,14 +8,16 @@
to=90
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
newname=str(uuid.uuid1()).replace("-", "")
try:
os.remove(newname)
except:
pass
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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 --newname %s" % (cc_home, newname)
@@ -47,7 +49,7 @@
print "failed to terminate"
sys.exit(1)
-rc = filecmp.cmp(newname, os.environ['NIMBUS_TEST_IMAGE'])
+rc = filecmp.cmp(newname, tst_image_src)
os.remove(newname)
if rc:
sys.exit(0)
View
@@ -6,6 +6,8 @@
import filecmp
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
@@ -14,7 +16,7 @@
os.remove(newname)
except:
pass
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
@@ -46,7 +48,7 @@
print "failed to terminate"
sys.exit(1)
-rc = filecmp.cmp(newname, os.environ['NIMBUS_TEST_IMAGE'])
+rc = filecmp.cmp(newname, tst_image_src)
os.remove(newname)
if rc:
sys.exit(0)
@@ -7,14 +7,16 @@
to=180
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
newname="XXXX"
try:
os.remove(newname)
except:
pass
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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)
@@ -4,11 +4,13 @@
import sys
import os
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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 --networks" % (cc_home)
@@ -4,11 +4,13 @@
import sys
import os
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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)
@@ -5,14 +5,16 @@
import os
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
newname = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -5,13 +5,15 @@
import os
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -5,13 +5,15 @@
import os
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -5,13 +5,15 @@
import os
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-cmd = "%s/bin/nimbus-public-image %s %s" % (nh, os.environ['NIMBUS_TEST_IMAGE'], common_image)
+cmd = "%s/bin/nimbus-public-image %s %s" % (nh, tst_image_src, common_image)
(x, rc)=pexpect.run(cmd, withexitstatus=1, logfile=logfile)
if rc != 0:
print "failed create the public image"
@@ -5,13 +5,15 @@
import os
import uuid
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
nh=os.environ['NIMBUS_HOME']
logfile = sys.stdout
common_image = str(uuid.uuid1()).replace("-", "")
-src_file = os.environ['NIMBUS_TEST_IMAGE']
+src_file = tst_image_src
sfa = src_file.split("/")
image_name = sfa[len(sfa) - 1]
size=os.path.getsize(src_file)
View
@@ -4,11 +4,13 @@
import sys
import os
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
-cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, os.environ['NIMBUS_TEST_IMAGE'])
+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)
@@ -8,6 +8,8 @@
import uuid
import datetime
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
bkname=os.path.join(os.environ['HOME'], ".s3cfg.common")
s3cfg=os.path.join(os.environ['HOME'], ".s3cfg")
s3cfguser=os.path.join(os.environ['HOME'], ".s3cfg.reg")
@@ -20,7 +22,7 @@
newname=str(uuid.uuid1()).replace("-", "")
localfile=str(uuid.uuid1()).replace("-", "")
- src_file = os.environ['NIMBUS_TEST_IMAGE']
+ src_file = tst_image_src
sfa = src_file.split("/")
image_name = sfa[len(sfa) - 1]
size=os.path.getsize(src_file)
@@ -7,12 +7,14 @@
import uuid
import datetime
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
newname=str(uuid.uuid1()).replace("-", "")
-src_file = os.environ['NIMBUS_TEST_IMAGE']
+src_file = tst_image_src
sfa = src_file.split("/")
image_name = sfa[len(sfa) - 1]
@@ -7,12 +7,14 @@
import uuid
import datetime
+tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
+tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
to=90
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
newname=str(uuid.uuid1()).replace("-", "")
-src_file = os.environ['NIMBUS_TEST_IMAGE']
+src_file = tst_image_src
sfa = src_file.split("/")
image_name = sfa[len(sfa) - 1]
size=os.path.getsize(src_file)
Oops, something went wrong.

0 comments on commit f3cd495

Please sign in to comment.