Sha256: 959d091580275813e48b6c587a8e78384c0899f33d027a3e22a931bd5ce74523

Contents?: true

Size: 1.29 KB

Versions: 31

Compression:

Stored size: 1.29 KB

Contents

require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'

describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do

  context 'when checking containers destroy' do

    it 'destroys an instance' do
      with_test_proxmox_platform do |instance|
        mock_proxmox_calls_with(
          [
            # 1 - The info on existing containers
            mock_proxmox_to_get_nodes_info
          ],
          destroy_vm: true
        )
        instance.create
        instance.destroy
        expect(proxmox_destroy_options).to eq(
          'vm_id' => 1024,
          'environment' => 'test',
          'node' => 'node'
        )
      end
    end

    it 'fails to destroy an instance when the Proxmox task ends in error' do
      with_test_proxmox_platform do |instance|
        mock_proxmox_calls_with(
          [
            # 1 - The info on existing containers
            mock_proxmox_to_get_nodes_info
          ],
          destroy_vm: true,
          error_on_destroy: 'Error while destroy'
        )
        instance.create
        expect { instance.destroy }.to raise_error '[ node/test ] - Error returned by reserve_proxmox_container --destroy ./proxmox/destroy/destroy_node_test.json --config ./proxmox/config/config_node_test.json: Error while destroy'
      end
    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.2.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.2.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.2.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.2.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.2.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.1.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.1.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.0.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.0.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.0.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-33.0.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb