import time if __name__ == '__main__': from cloudi_job_api import CloudI obj = CloudI() assert obj.nodes_add('[foobar1@hostX, foobar2@hostY]') == 'ok' assert obj.nodes_remove('[foobar1@hostX, foobar2@hostY]') == 'ok' # removing entries that do not exist, does not fail, # since the request is valid (despite the fact it is pointless) assert obj.nodes_remove('[foobar1@hostX, foobar2@hostY]') == 'ok' assert obj.acl_remove('[all]') == 'ok' assert obj.acl_add('[{all, [database, tests]}]') == 'ok' # remove the hexpi jobs assert obj.jobs_remove('[2, 5]') == 'ok' # start the C flood test assert obj.jobs_add("""\ [{external, "/tests/flood/", "tests/flood/service/flood", "1 tcp 16384", [{"LD_LIBRARY_PATH", "api/c/lib/"}, {"DYLD_LIBRARY_PATH", "api/c/lib/"}], none, tcp, 16384, 5000, 5000, 5000, [api], undefined, 1, 1, 5, 300}, {internal, "/tests/flood/", cloudi_job_flood, [{flood, "/tests/flood/c", <<"DATA">>, 1000}], lazy_closest,
if __name__ == '__main__': from cloudi_job_api import CloudI obj = CloudI() assert obj.nodes_add('[foobar1@hostX, foobar2@hostY]') == 'ok' assert obj.nodes_remove('[foobar1@hostX, foobar2@hostY]') == 'ok' # removing entries that do not exist, does not fail, # since the request is valid (despite the fact it is pointless) assert obj.nodes_remove('[foobar1@hostX, foobar2@hostY]') == 'ok' assert obj.acl_remove('[all]') == 'ok' assert obj.acl_add('[{all, [database, tests]}]') == 'ok' # remove the hexpi jobs jobs = obj.jobs() assert obj.jobs_remove('[%s, %s]' % ( str(jobs[1][0]), str(jobs[4][0]), )) == 'ok' # start the C flood test assert obj.jobs_add("""\ [{external, "/tests/flood/", "tests/flood/service/flood", "1 tcp 16384", [{"LD_LIBRARY_PATH", "api/c/lib/"}, {"DYLD_LIBRARY_PATH", "api/c/lib/"}], none, tcp, 16384, 5000, 5000, 5000, [api], undefined, 1, 1, 5, 300}, {internal, "/tests/flood/", cloudi_job_flood, [{flood, "/tests/flood/c", <<"DATA">>, 1000}],