See how I did not test the code, just wrote some lines trying to sketch 
my idea...

On 03/15/2012 07:00 PM, Lucas Meneghel Rodrigues wrote:
> class TestPool(object):
>       def __init__(self):
>           available_tests = [ list with 2000 tests ]

^ this should be self.available_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)

^ instead of lockfile should be self.lock

>           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)

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to