Sha256: d341ce3f1c4dec2fb17dcf327132cecae3c839791ab67bf5408dfb9b59c978ab

Contents?: true

Size: 1.29 KB

Versions: 36

Compression:

Stored size: 1.29 KB

Contents

require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'

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

  context '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

36 entries across 36 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.0.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.18.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.17.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.17.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.16.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.16.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.16.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.16.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.16.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.15.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.14.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.13.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.13.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.13.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.13.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.13.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.12.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.11.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.11.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb
hybrid_platforms_conductor-32.11.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb