diff options
Diffstat (limited to 'lava_scheduler_app/tests/test_connections.py')
-rw-r--r-- | lava_scheduler_app/tests/test_connections.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lava_scheduler_app/tests/test_connections.py b/lava_scheduler_app/tests/test_connections.py index f52546e55..db80feef2 100644 --- a/lava_scheduler_app/tests/test_connections.py +++ b/lava_scheduler_app/tests/test_connections.py @@ -18,7 +18,7 @@ class YamlSshFactory(YamlFactory): def make_job_data(self, actions=None, **kw): sample_job_file = os.path.join(os.path.dirname(__file__), 'devices', 'qemu-ssh-guest.yaml') with open(sample_job_file, 'r') as test_support: - data = yaml.load(test_support) + data = yaml.safe_load(test_support) data.update(kw) return data @@ -31,7 +31,7 @@ class SecondaryConnections(TestCaseWithFactory): self.device_type = self.factory.make_device_type() def test_ssh_job_data(self): - data = yaml.load(self.factory.make_job_yaml()) + data = yaml.safe_load(self.factory.make_job_yaml()) self.assertNotIn('context', data) self.assertNotIn('timeout', data) self.assertIn('timeouts', data) @@ -52,7 +52,7 @@ class SecondaryConnections(TestCaseWithFactory): path = os.path.join(os.path.dirname(os.path.join(__file__)), 'devices') host_role = [] for job in jobs: - data = yaml.load(job.definition) + data = yaml.safe_load(job.definition) params = data['protocols']['lava-multinode'] params['target_group'] = 'replaced' if not group_size: @@ -62,7 +62,7 @@ class SecondaryConnections(TestCaseWithFactory): self.assertEqual(job.requested_device_type.name, device.device_type.name) self.assertIn(params['sub_id'], [0, 1, 2]) sub_id.append(params['sub_id']) - comparison = yaml.load(open(os.path.join(path, 'qemu-ssh-parent.yaml'), 'r').read()) + comparison = yaml.safe_load(open(os.path.join(path, 'qemu-ssh-parent.yaml'), 'r').read()) self.assertIn('protocols', data) self.assertIn('lava-multinode', data['protocols']) self.assertIn('sub_id', data['protocols']['lava-multinode']) @@ -85,7 +85,7 @@ class SecondaryConnections(TestCaseWithFactory): del(data['protocols']['lava-multinode']['sub_id']) self.assertEqual( data, - yaml.load(open(os.path.join(path, 'qemu-ssh-guest-1.yaml'), 'r').read()) + yaml.safe_load(open(os.path.join(path, 'qemu-ssh-guest-1.yaml'), 'r').read()) ) self.assertIsNone(job.requested_device_type) self.assertIsNone(job.actual_device) @@ -102,7 +102,7 @@ class SecondaryConnections(TestCaseWithFactory): # create a new device to allow the submission to reach the multinode YAML test. hostname = 'fakeqemu4' self.factory.make_device(self.device_type, hostname) - data = yaml.load(self.factory.make_job_yaml()) + data = yaml.safe_load(self.factory.make_job_yaml()) data['protocols']['lava-multinode']['roles']['host']['count'] = 2 self.assertRaises( SubmissionException, TestJob.from_yaml_and_user, @@ -114,7 +114,7 @@ class SecondaryConnections(TestCaseWithFactory): # create a new device to allow the submission to reach the multinode YAML test. hostname = 'fakeqemu4' self.factory.make_device(self.device_type, hostname) - data = yaml.load(self.factory.make_job_yaml()) + data = yaml.safe_load(self.factory.make_job_yaml()) deploy = [action['deploy'] for action in data['actions'] if 'deploy' in action] # replace working image with a broken URL for block in deploy: |