From 9f64183c2ba16fff210d221434a85d50c628abe1 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Thu, 26 Jun 2003 00:36:22 +0000 Subject: [PATCH] test_rsc svn path=/trunk/boinc/; revision=1594 --- checkin_notes | 2 ++ test/Makefile.am | 9 ++------- test/Makefile.in | 1 + test/boinc.py | 4 ++-- test/boinc_db.inc | 2 +- test/boinc_db.py | 2 +- test/test_abort.py | 7 +------ test/test_rsc.py | 27 +++++++++++++++++++++++++++ 8 files changed, 37 insertions(+), 17 deletions(-) create mode 100755 test/test_rsc.py diff --git a/checkin_notes b/checkin_notes index edb6aa0704..83cbf737c3 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5048,6 +5048,7 @@ Karl 2003/06/25 limit" instead of "Couldn't upload files" - test that an aborted result due to file limit causes client_state = RESULT_RESULT_OUTCOME_CLIENT_ERROR (currently this test FAILS!) + - test resource limits in python db/ boinc_db.h @@ -5058,6 +5059,7 @@ Karl 2003/06/25 test/ boinc.py test_abort.py (new) + test_rsc.py (new) test_backend.py test_concat.py test_uc.py diff --git a/test/Makefile.am b/test/Makefile.am index 1e6816df4c..0a2f0b0800 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2,17 +2,12 @@ include $(top_srcdir)/Makefile.incl -# TESTS = test_sanity.php \ -# test_uc.php \ -# test_concat.php \ -# test_1sec.php \ -# test_rsc.php \ -# test_backend.php - TESTS = test_sanity.py \ test_uc.py \ test_concat.py \ test_1sec.py \ + test_abort.py \ + test_rsc.py \ test_backend.py EXTRA_DIST = \ diff --git a/test/Makefile.in b/test/Makefile.in index 1620d06b89..134263b3f8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -180,6 +180,7 @@ TESTS = test_sanity.py \ test_uc.py \ test_concat.py \ test_1sec.py \ + test_abort.py \ test_backend.py diff --git a/test/boinc.py b/test/boinc.py index eb8649a37c..12b84acdc1 100644 --- a/test/boinc.py +++ b/test/boinc.py @@ -751,7 +751,7 @@ class Host: self.global_prefs = None self.log_flags = 'log_flags.xml' self.host_dir = os.path.join(HOSTS_DIR, self.name) - self.defargs = "-exit_when_idle -skip_cpu_benchmarks" + self.defargs = "-exit_when_idle -skip_cpu_benchmarks -sched_retry_delay_min 1" def add_user(self, user, project): self.users.append(user) @@ -792,7 +792,7 @@ class Host: if pid: return pid else: verbose_echo(1, "Running core client") - verbose_shell_call("cd %s && %s %s %s > client.out" % ( + verbose_shell_call("cd %s && %s %s %s > client.out 2> client.err" % ( self.dir(), os.path.join(SRC_DIR, 'client', CLIENT_BIN_FILENAME), self.defargs, args)) if asynch: os._exit(0) diff --git a/test/boinc_db.inc b/test/boinc_db.inc index 9a401ef4b0..9b8c2c83af 100644 --- a/test/boinc_db.inc +++ b/test/boinc_db.inc @@ -1,5 +1,5 @@ client.err' - class ProjectAbort(ProjectUC): def __init__(self): - ProjectUC.__init__(self, works=[WorkAbort()], hosts=[HostAbort()]) + ProjectUC.__init__(self, short_name='test_abort', works=[WorkAbort()]) def check(self): # no results should have been uploaded diff --git a/test/test_rsc.py b/test/test_rsc.py new file mode 100755 index 0000000000..16eed9b720 --- /dev/null +++ b/test/test_rsc.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +## $Id$ + +# Test whether the scheduling server filters out work units too big for client + +from test_uc import * + +class WorkTooBig(WorkUC): + def __init__(self): + WorkUC.__init__(self) + self.rsc_disk = 1000000000000 # 1 TB + +class ResultUnsent: + def __init__(self): + self.server_state = RESULT_SERVER_STATE_UNSENT + +class ProjectRsc(ProjectUC): + def __init__(self): + ProjectUC.__init__(self, short_name='test_rsc', works=[WorkTooBig()]) + def check(self): + self.check_results(ResultUnsent()) + +if __name__ == '__main__': + test_msg("resource filtering for large work units") + ProjectRsc() + run_check_all()