rtig_param = dtest.Utils.getUserHostPath(a)
    if o in ("-f", "--federate"):
        federate_param = dtest.Utils.getUserHostPath(a)
    if o in ("-c", "--certi_home"):
        certi_home = a
        certi_home_defined = True

if not certi_home_defined:
    if os.environ.has_key("CERTI_HOME"):
        certi_home = os.environ["CERTI_HOME"]
    else:
        print "You must define CERTI_HOME environment variable"
        sys.exit(2)

rtig = dtest.DTester("RTIG",
                     session=dtest.SSHSessionHandler(rtig_param['user'],
                                                     host=rtig_param['host']))

firstFederate = dtest.DTester("test_TRTCCallbacks_First",
                              session=dtest.SSHSessionHandler(
                                  federate_param['user'],
                                  host=federate_param['host']))

lateFederate = dtest.DTester("test_TRTCCallbacks_LateJoiner",
                             session=dtest.SSHSessionHandler(
                                 federate_param['user'],
                                 host=federate_param['host']))

# you may change the default time out value
rtig.timeout = 40
# you add want to save the output of your dtester to a file.
rtig.stdout = file(rtig.name + ".out", 'w+')
Example #2
0
    if o in ("-c", "--certi_home"):
        certi_home = a
        certi_home_defined = True
    if o in ("--display"):
        display = a

if not certi_home_defined:
    if os.environ.has_key("CERTI_HOME"):
        certi_home = os.environ["CERTI_HOME"]
    else:
        print "You must define CERTI_HOME environment variable"
        sys.exit(2)

firstBillard = dtest.DTester("firstBillard",
                             session=dtest.SSHSessionHandler(
                                 billard_param['user'],
                                 host=billard_param['host']))

rtig = dtest.DTester("rtig",
                     session=dtest.SSHSessionHandler(rtig_param['user'],
                                                     host=rtig_param['host']))
# you may change the default time out value
rtig.timeout = 40
# you add want to save the output of your dtester to a file.
rtig.stdout = file(rtig.name + ".out", 'w+')
rtig.stdin = file(rtig.name + ".in", 'w+')
rtig.stderr = file(rtig.name + ".err", 'w+')

# describe RTIG run steps
rtig.addRunStep("ok", True, "CERTI RTIG and Billard Starts")
rtig.addRunStep("runCommand",
    print >> stderr, "opt = %s, msg = %s" % (err.opt, err.msg)
    usage()
    sys.exit(2)

if len(opts) < 2:
    usage()
    sys.exit(2)

for o, a in opts:
    if o in ("-p", "--provider"):
        stub_param = getUserHostPath(a)
    if o in ("-c", "--consumer"):
        stdout_param = getUserHostPath(a)

stdout = dtest.DTester("tsp_stdout",
                       session=dtest.SSHSessionHandler(
                           stdout_param['user'], host=stdout_param['host']))
stub = dtest.DTester("tsp_stubbed_server",
                     session=dtest.SSHSessionHandler(
                         stdout_param['user'], host=stdout_param['host']))
# you may change the default time out value
stub.timeout = 8
# you add want to save the output of your dtester to a file.
stub.stdout = file(stub.name + ".out", 'w+')
stub.stdin = file(stub.name + ".in", 'w+')
stdout.stdout = file(stdout.name + ".out", 'w+')
#stdout.stdin  = file(stdout.name + ".in",'w+')

dtest.DTester.logger.setLevel(level=logging.WARNING)

stub.addRunStep("ok", True, "TSP Stub and Stdout Starts")
stub.addRunStep("runCommand", command=stub_param['path'])
Example #4
0
resultfile1 = source_param['fich'] + "_result"

file2 = dest_param['user'] + "@" + dest_param['host'] + ":" + dest_param['fich']
resultfile2 = dest_param['fich'] + "_result"

md5scriptname = "md5sum.py"
md5command1 = getDir(
    source_param['fich']
) + md5scriptname + " " + source_param['fich'] + " " + resultfile1
md5command2 = getDir(
    dest_param['fich']
) + md5scriptname + " " + dest_param['fich'] + " " + resultfile2

# Create as many DTester as you need
tester1 = dtest.DTester("tester1",
                        session=dtest.SSHSessionHandler(
                            source_param['user'], source_param['host']))
tester2 = dtest.DTester("tester2",
                        session=dtest.SSHSessionHandler(
                            dest_param['user'], dest_param['host']))

# Setting up output files
tester1.stdout = file(tester1.name + ".out", 'w+')
tester1.stderr = file(tester1.name + ".err", 'w+')
tester1.stdin = file(tester1.name + ".in", 'w+')

tester2.stdout = file(tester2.name + ".out", 'w+')
tester2.stderr = file(tester2.name + ".err", 'w+')
tester2.stdin = file(tester2.name + ".in", 'w+')

#The goal of this script is to easily illustrate the functionnalities of dtest with a simple example
#so here we want to assure that a file has been correctly copied from a computer source_param['host'] to a computer dest_param['host']
Example #5
0
        controller_param = getUserHostPath(a)
    if o in ("--process"):
        process_param = getUserHostPath(a)
    if o in ("--certi_home"):
        certi_home = a
        certi_home_defined=True
        print "CERTI_HOME defined"
    
if not certi_home_defined:
    if os.environ.has_key("CERTI_HOME"):
        certi_home=os.environ["CERTI_HOME"]
    else: 
        print "You must define CERTI_HOME environment variable"
        sys.exit(2)                 
#---------------------------------------------------------- Describe rtig run steps --------------------------------
rtig = dtest.DTester("rtig",session=dtest.SSHSessionHandler(rtig_param['user'],host=rtig_param['host']))
# you may change the default time out value
rtig.timeout = 10
# you add want to save the output of your dtester to a file.
rtig.stdout    = file(rtig.name + ".out",'w+')
rtig.stdin     = file(rtig.name + ".in",'w+')
rtig.stderr    = file(rtig.name + ".err",'w+')
# describe RTIG run steps
rtig.addRunStep("ok",True,"HLA Tutorial functional test script version 0.3")
rtig.addRunStep("ok",True,"CERTI RTIG Starts")
#we source myCERTI_env.sh to set environment variables - the first parameter sets the rtig host
rtig.addRunStep("runCommand",command=". "+certi_home+"/share/scripts/myCERTI_env.sh "+rtig_param['host'])
rtig.addRunStep("runCommand",command=rtig_param['path'])
rtig.addRunStep("expectFromCommand",pattern="CERTI RTIG up and running",timeout=5)
rtig.addRunStep("barrier","RTIG started")
rtig.addRunStep("barrier","End of simulation",timeout=150)