On 03/14/2012 03:35 AM, mitts daki wrote:
> Hi,
> I want to run 2000 functional tests in parallel on 4 linux systems (
> all are same ) , Here is a scenario I have autest server A and linux
> systems L1, L2,L3 & L4
>
> 1. In starting my autotest should run test one T1 on L1, T2 on L2, T3
> on L3 and T4 on L4
> 2. once T1 execution on L1 is finished it should start executing T5 on
> L1 similarly T6 on L2, T7 on L3 and T8 on L4
> 3. if in between suppose T5 on L1 and T7 on L3 taking more time but
> execution on L2 & L4 finished than autotest should automatically
> trigger T9 on L2 and T10 on L10
> 4. so basically autotest executes these tests on all the linux system
> and one execution is finished it should automatically pickup next
> test from the queue and start executing that on which ever linux
> system is free/available at that point
>
> Please suggest me how should I plan this
I would start with a server control file. As far as I understand the
situation, there is a pool of tests, and whenever a machine is done
running one test, it should pick up the next available test and run it,
until there are no more tests left. I would do a server control file
along the lines (please, I *did not* test the code, this is just an idea
I had):
import fnctl
class TestPool(object):
def __init__(self):
available_tests = [ list with 2000 tests ]
self.lock = open("/tmp/test-pool-lock", "w+")
def get_test():
fcntl.lockf(self.lock, fcntl.LOCK_EX)
test = self.available_tests.pop()
fcntl.lockf(lockfile, fcntl.LOCK_UN)
return test
test_pool = TestPool()
def run(machine):
host = hosts.create_host(machine)
at = autotest_remote.Autotest(host)
while test_pool.available_tests:
t = test_pool.get_test()
at.run_test(t)
job.parallel_simple(run, machines)
With fnctl we have a way to lock the available test dict, to avoid races
on the unlikely occasion 2 machines are ready exactly at the same time.
>
> another question what is the difference between triggering a job from
> GUI/CLI or /usr/local/autotest/server/autoserv -m L1,L2,L3, L4 < Control
> file>
The difference is that the web interface and cli will register the
results of the job in the autotest database, and later someone can query
the database to know what happened on the job. With autoserv, we just
generate the raw test data, with no involvement of the database
whatsoever. Also, the scheduler also can coordinate which machines from
the pool will be used (ie, if one machine is already running tests, it
will pick up another available), while autoserv does not have this
knowledge.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest