This repository has been archived by the owner on Sep 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
|
||
import pexpect | ||
import sys | ||
import os | ||
|
||
tst_image_name = os.environ['NIMBUS_TEST_IMAGE'] | ||
tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE'] | ||
to=int(os.environ["NIMBUS_TEST_TIMEOUT"]) | ||
cc_home=os.environ['CLOUD_CLIENT_HOME'] | ||
logfile = sys.stdout | ||
|
||
cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src) | ||
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to) | ||
|
||
cmd = "%s/bin/cloud-client.sh --kernel notthere --run --name %s --hours .5" % (cc_home, tst_image_name) | ||
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to) | ||
if rc == 0: | ||
print "a bad kernel was submitted, should have failed" | ||
sys.exit(1) | ||
|
||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
|
||
import pexpect | ||
import sys | ||
import os | ||
|
||
tst_image_name = os.environ['NIMBUS_TEST_IMAGE'] | ||
tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE'] | ||
to=int(os.environ["NIMBUS_TEST_TIMEOUT"]) | ||
cc_home=os.environ['CLOUD_CLIENT_HOME'] | ||
logfile = sys.stdout | ||
|
||
cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src) | ||
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to) | ||
|
||
cmd = "%s/bin/cloud-client.sh --kernel default --run --name %s --hours .5" % (cc_home, tst_image_name) | ||
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile) | ||
rc = child.expect ('Running:') | ||
if rc != 0: | ||
print "%s not found in the list" % (tst_image_name) | ||
sys.exit(1) | ||
handle = child.readline().strip().replace("'", "") | ||
rc = child.expect(pexpect.EOF) | ||
if rc != 0: | ||
print "run" | ||
sys.exit(1) | ||
|
||
cmd = "%s/bin/cloud-client.sh --terminate --handle %s" % (cc_home, handle) | ||
print cmd | ||
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to) | ||
print x | ||
if rc != 0: | ||
print "failed to terminate" | ||
sys.exit(1) | ||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters