2003-06-19 00:19:22 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
## $Id$
|
|
|
|
|
|
|
|
# This tests whether the client handles multiple projects, and whether CPU
|
|
|
|
# time is divided correctly between projects The client should do work for
|
|
|
|
# project 2 5 times faster than for project 1
|
|
|
|
|
|
|
|
from boinc import *
|
|
|
|
from test_uc import *
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_msg("multiple projects with resource share");
|
|
|
|
|
|
|
|
host = Host()
|
|
|
|
user = UserUC()
|
|
|
|
projects = []
|
|
|
|
for i in range(2):
|
2003-06-19 02:01:18 +00:00
|
|
|
project = ProjectUC(users=[user], hosts=[host],
|
|
|
|
short_name="test_1sec_%d"%i,
|
|
|
|
redundancy=5)
|
2003-06-19 00:19:22 +00:00
|
|
|
project.resource_share = [1, 5][i]
|
|
|
|
projects.append(project)
|
|
|
|
project.run()
|
|
|
|
host.run()
|
|
|
|
for project in projects:
|
2003-06-19 02:01:18 +00:00
|
|
|
project.check()
|
2003-06-19 00:19:22 +00:00
|
|
|
project.stop()
|