Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (26 sloc) 0.683 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/env python

import pexpect
import sys
import os

to=int(os.environ["NIMBUS_TEST_TIMEOUT"])
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout

cmd = "%s/bin/cloud-client.sh --security" % (cc_home)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Identity:')
if rc != 0:
    print "Identity: not found in the list"
    sys.exit(1)
rc = child.expect ('Subject:')
if rc != 0:
    print "Subject: not found in the list"
    sys.exit(1)
rc = child.expect ('Issuer:')
if rc != 0:
    print "Issuer: not found in the list"
    sys.exit(1)
rc = child.expect(pexpect.EOF)
if rc != 0:
    print "run"
    sys.exit(1)
sys.exit(0)
Something went wrong with that request. Please try again.