Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 50 lines (41 sloc) 1.24 kB
3184a2f simple test on status option
BuzzTroll authored
1 #!/usr/bin/env python
2
3 import pexpect
4 import sys
5 import os
6
b354f65 changing timeouts in cloud-client tests. NMI is exceeding
BuzzTroll authored
7 to=90
3184a2f simple test on status option
BuzzTroll authored
8 cc_home=os.environ['CLOUD_CLIENT_HOME']
9 logfile = sys.stdout
10
11 cmd = "%s/bin/cloud-client.sh --transfer --sourcefile /etc/group" % (cc_home)
12 (x, rc)=pexpect.run(cmd, withexitstatus=1)
13
14 cmd = "%s/bin/cloud-client.sh --run --name group --hours .25" % (cc_home)
b354f65 changing timeouts in cloud-client tests. NMI is exceeding
BuzzTroll authored
15 child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
3184a2f simple test on status option
BuzzTroll authored
16 rc = child.expect ('Running:')
17 if rc != 0:
18 print "group not found in the list"
19 sys.exit(1)
20 handle = child.readline().strip().replace("'", "")
21 rc = child.expect(pexpect.EOF)
22 if rc != 0:
23 print "run"
24 sys.exit(1)
25
26 cmd = "%s/bin/cloud-client.sh --status" % (cc_home)
b354f65 changing timeouts in cloud-client tests. NMI is exceeding
BuzzTroll authored
27 child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
e68c8dd simple status test. just tests that some state is reported for some …
BuzzTroll authored
28 rc = child.expect ('State:')
3184a2f simple test on status option
BuzzTroll authored
29 if rc != 0:
30 print "group not found in the list"
31 sys.exit(1)
32
33 cmd = "%s/bin/cloud-client.sh --terminate --handle %s" % (cc_home, handle)
34 print cmd
35 (x, rc)=pexpect.run(cmd, withexitstatus=1)
36 print x
37 if rc != 0:
38 print "failed to terminate"
39 sys.exit(1)
40
41 cmd = "%s/bin/cloud-client.sh --delete --name group" % (cc_home)
42 print cmd
43 (x, rc)=pexpect.run(cmd, withexitstatus=1)
44 print x
45 if rc != 0:
46 print "failed to terminate"
47 sys.exit(1)
48 sys.exit(0)
49
Something went wrong with that request. Please try again.