tsp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tsp-devel] dtest: a distributed test framework


From: Eric Noulard
Subject: Re: [Tsp-devel] dtest: a distributed test framework
Date: Mon, 21 May 2007 17:00:45 +0200

2007/4/25, Frederik Deweerdt <address@hidden>:
So, I'm anxiously waiting for a first ssh based distributed test framework
then :).

I cannot afford having a friend anxious for too long :))
Here comes a beta*beta (i.e. beta-square you are warned)
ssh-based dtest.

!!! BEWARE this version is not as user friendly as it will be !!!

Here are the prerequisite for testing dtest-ssh

1) have a working python installation

2) have python crypto kit installed
   http://www.amk.ca/python/code/crypto.html

3) have an ssh server running on the target hosts
   and all public key deployed which authorize
   ssh connection with no passwd/key prompt

Now that you are warned you may proceed:

a) tar zxvf dtest-0.3-21mai2007-16h15.tgz
b) cd dtest-0.3

Now you can run the autotest (no SSH needed)

c) ./autotest.py

you'll get something like:
## OK not adding the run step: <function myInvalidCustomStep at 0xb7bb26f4>
## Since it raises :  <dtest.DTester.StepFirstArgNotDTesterNorSelf
instance at 0xb7b9d4cc>
1..9
ok 1 - Barrier <aBarrier> crossed by all <2> registered DTester(s)
ok 2 - myCustomStep
ok 3 # SKIP --SKIPPED step--
not ok 4 - here is a failure
ok 5 - Barrier <anotherBarrier> crossed by all <1> registered DTester(s)
ok 6 # TODO --TODO step--
ok 7 - Barrier <wait4me4ever> crossed by all <2> registered DTester(s)
not ok 8 - Barrier <timedBarrier> timed-out for DTester <DTester2>
waiting no more than <1.500000 seconds>
ok 9 - --END step--

then you may go on with ssh test for tsp:

d) deploy your key + [ssh-agent+] ssh-add

d) ./tsp_stub_and_stdout_test.py
       --provider=<user>@<host>:<path_to_stub>
       --consumer=<user>@<host>:<path_to_stdout>

    if user is not specified then environ["USER"] is used
    if host is not specified then 'localhost' is used
    path_to_xxxx should be the path on HOST where
    the command will be launched

an example:

   ./tsp_stub_and_stdout_test.py
--provider=hyeres:$HOME/TSP/build_i386/Linux/Debug/bin/tsp_stub_server
--consumer=toulon:$HOME/TSP/build_i386/Linux/Debug/bin/tsp_stdout_client

output should be something like:

1..5
ok 1 - TSP Stub and Stdout Starts
ok 2 - Barrier <provider started> crossed by all <2> registered DTester(s)
ok 3 - Barrier <consumer started> crossed by all <1> registered DTester(s)
ok 4 - Barrier <consumer ended> crossed by all <2> registered DTester(s)
ok 5 - TSP Stub and Stdout Ends

For the more adventurous, the idea of dtest-ssh is to be able
to launch command over an SSH connection and to monitor
stdin/stdout of the command.

Each "tested" element is a DTester:

stdout  = 
dtest.DTesterSSH("tsp_stdout",stdout_param['user'],host=stdout_param['host'])
stub    = 
dtest.DTesterSSH("tsp_stubbed_server",stub_param['user'],host=stub_param['host'])


And each DTester specify its "run steps":

stub.addRunStep("ok",True,"TSP Stub and Stdout Starts")
stub.addRunStep("runCommand",command=stub_param['path'])
stub.addRunStep("expectFromCommand",pattern="TSP Provider on
PID",timeout=global_timeout)
stub.addRunStep("barrier","provider started",timeout=global_timeout)

...
stdout.addRunStep("barrier","provider started",timeout=global_timeout)
stdout.addRunStep("runCommand",command=stdout_param['path']+" -u
rpc://"+stub.host)
stdout.addRunStep("expectFromCommand",pattern="tsp_stdout_client:
Using provider URL",timeout=5)
stdout.addRunStep("barrier","consumer started",timeout=global_timeout)

afterwards every DTesters which participate to the Distributed test should
register in the DTestMaster:

myDTestMaster = dtest.DTestMaster()
myDTestMaster.register(stdout)
myDTestMaster.register(stub)

Then the DTestMaster run the (distributed) test

myDTestMaster.startTestSequence()
myDTestMaster.waitTestSequenceEnd()


This is FAR from complete
(DTesters are SSH only even on localhost)
and certainly not as user friendly as it should be
but it should be sufficient to illustrate the idea.

Any comment are welcomed.


--
Erk

Attachment: dtest-0.3-21mai2007-16h15.tgz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]