Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
breaking out the image name from the image location
Browse files Browse the repository at this point in the history
  • Loading branch information
buzztroll committed Jun 13, 2011
1 parent 239fffd commit f3cd495
Show file tree
Hide file tree
Showing 30 changed files with 93 additions and 42 deletions.
5 changes: 4 additions & 1 deletion tests/cc-1000-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/cc-delete-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions tests/cc-download-common-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions tests/cc-download-user-common-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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"
Expand All @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion tests/cc-list-common-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-list-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions tests/cc-prop-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions tests/cc-prop2-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-propsamename-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-simple-network-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-simple-status-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-common-save-exists-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-common-save-submit-own.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-common-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-common-twice-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-common-unprop-size-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-submit-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-unprop-md5test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cc-unprop-readwrite-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 3 additions & 1 deletion tests/cc-unprop-size-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit f3cd495

Please sign in to comment.