def test_compute_joined_with_juju_az(self, mock_az): self.migration_enabled.return_value = False mock_az.return_value = 'az1' hooks.compute_joined('cloud-compute:2') self.relation_set.assert_called_with(**{ 'relation_id': 'cloud-compute:2', 'availability_zone': 'az1', })
def test_compute_joined_with_resize(self): self.migration_enabled.return_value = False self.test_config.set('enable-resize', True) self.public_ssh_key.return_value = 'bar' hooks.compute_joined() self.relation_set.assert_called_with( relation_id=None, nova_ssh_public_key='bar', hostname='testserver', ) hooks.compute_joined(rid='cloud-compute:2') self.relation_set.assert_called_with( relation_id='cloud-compute:2', nova_ssh_public_key='bar', hostname='testserver', )
def test_compute_joined_with_ssh_migration(self): self.migration_enabled.return_value = True self.test_config.set('migration-auth-type', 'ssh') self.public_ssh_key.return_value = 'foo' hooks.compute_joined() self.relation_set.assert_called_with( relation_id=None, ssh_public_key='foo', migration_auth_type='ssh' ) hooks.compute_joined(rid='cloud-compute:2') self.relation_set.assert_called_with( relation_id='cloud-compute:2', ssh_public_key='foo', migration_auth_type='ssh' )
def test_compute_joined_with_resize(self): self.migration_enabled.return_value = False self.test_config.set('enable-resize', True) self.public_ssh_key.return_value = 'bar' hooks.compute_joined() self.relation_set.assert_called_with(**{ 'relation_id': None, 'nova_ssh_public_key': 'bar', 'hostname': 'testserver', 'private-address': '10.0.0.50', }) hooks.compute_joined(rid='cloud-compute:2') self.relation_set.assert_called_with(**{ 'relation_id': 'cloud-compute:2', 'nova_ssh_public_key': 'bar', 'hostname': 'testserver', 'private-address': '10.0.0.50', })
def test_compute_joined_with_ssh_migration(self): self.migration_enabled.return_value = True self.test_config.set('migration-auth-type', 'ssh') self.public_ssh_key.return_value = 'foo' hooks.compute_joined() self.relation_set.assert_called_with( relation_id=None, ssh_public_key='foo', migration_auth_type='ssh', hostname='testserver', ) hooks.compute_joined(rid='cloud-compute:2') self.relation_set.assert_called_with( relation_id='cloud-compute:2', ssh_public_key='foo', migration_auth_type='ssh', hostname='testserver', )
def test_compute_joined_with_ssh_migration(self): self.migration_enabled.return_value = True self.test_config.set('migration-auth-type', 'ssh') self.public_ssh_key.return_value = 'foo' hooks.compute_joined() self.relation_set.assert_called_with(**{ 'relation_id': None, 'ssh_public_key': 'foo', 'migration_auth_type': 'ssh', 'hostname': 'testserver', 'private-address': '10.0.0.50', }) hooks.compute_joined(rid='cloud-compute:2') self.relation_set.assert_called_with(**{ 'relation_id': 'cloud-compute:2', 'ssh_public_key': 'foo', 'migration_auth_type': 'ssh', 'hostname': 'testserver', 'private-address': '10.0.0.50', })
def test_compute_joined_no_migration_no_resize(self): self.migration_enabled.return_value = False hooks.compute_joined() self.assertFalse(self.relation_set.called)