From 6ac61ebaacaf78ae0dcb859b10c9ecf225432e37 Mon Sep 17 00:00:00 2001 From: Paul <richp@alcf.anl.gov> Date: Thu, 30 Jul 2020 16:30:57 -0500 Subject: [PATCH] Added test to make sure that typoed locations don't cause other breakage (they don't). --- .../TestComponents/test_clustersystem.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/testsuite/TestCobalt/TestComponents/test_clustersystem.py b/testsuite/TestCobalt/TestComponents/test_clustersystem.py index 14d5600a..18bbeead 100644 --- a/testsuite/TestCobalt/TestComponents/test_clustersystem.py +++ b/testsuite/TestCobalt/TestComponents/test_clustersystem.py @@ -276,6 +276,20 @@ class TestClusterSystem(object): assert best_location == {'1':['vs1.test']}, "ERROR: Missing nodes from best location," \ " got: %s" % best_location + def test__find_job_location_bad_location(self): + now = int(time.time()) + job = get_basic_job_dict() + job['attrs']['location'] = "idontexist" + job['nodes'] = 1 + + self.cluster_system.init_drain_times([]) #All resources are clear + best_location, new_drain_time, ready_to_run = self.cluster_system._find_job_location(job, now) + + assert not ready_to_run, "ERROR: Job ready to run with invalid location" + assert new_drain_time == 0, "No job to run, drain time must be 0" + assert best_location == {}, "ERROR: Missing nodes from best location," \ + " got: %s" % best_location + def test__find_job_location_attr_wo_location(self): now = int(time.time()) job = get_basic_job_dict() -- GitLab