7478: On EC2 driver ask for a spot instance when needed.
[arvados.git] / services / nodemanager / tests / test_computenode_dispatch_slurm.py
index f8966841d82424a6e336ea009aff1d1b5fe542b8..840d0a582ab76681893600403bfb9c1ac6626215 100644 (file)
@@ -133,7 +133,23 @@ class SLURMComputeNodeSetupActorTestCase(ComputeNodeSetupActorTestCase):
 
     @mock.patch('subprocess.check_output')
     def test_update_node_features(self, check_output):
-        self.make_mocks()
+        # `scontrol update` happens only if the Arvados node record
+        # has a hostname. ComputeNodeSetupActorTestCase.make_mocks
+        # uses mocks with scrubbed hostnames, so we override with the
+        # default testutil.arvados_node_mock.
+        self.make_mocks(arvados_effect=[testutil.arvados_node_mock()])
         self.make_actor()
         self.wait_for_assignment(self.setup_actor, 'cloud_node')
         check_output.assert_called_with(['scontrol', 'update', 'NodeName=compute99', 'Weight=1000', 'Features=instancetype=z1.test'])
+
+    @mock.patch('subprocess.check_output')
+    def test_failed_arvados_calls_retried(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_failed_arvados_calls_retried()
+
+    @mock.patch('subprocess.check_output')
+    def test_subscribe(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_subscribe()
+
+    @mock.patch('subprocess.check_output')
+    def test_creation_with_arvados_node(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_creation_with_arvados_node()