Sha256: 64ffad03e3b59e9cb0feded2f6a0e171e4bf363cd0f401eac794daa961e4425e

Contents?: true

Size: 1.3 KB

Versions: 31

Compression:

Stored size: 1.3 KB

Contents

require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'

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

  context 'when checking containers stop' do

    it 'stops 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,
          # 2 - The start of the container
          mock_proxmox_to_start_node,
          # 3 - The stop of the container
          mock_proxmox_to_stop_node
        ]
        instance.create
        instance.start
        instance.stop
      end
    end

    it 'fails to stop 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,
          # 2 - The start of the container
          mock_proxmox_to_start_node,
          # 3 - The stop of the container
          mock_proxmox_to_stop_node(task_status: 'ERROR')
        ]
        instance.create
        instance.start
        expect { instance.stop }.to raise_error '[ node/test ] - Proxmox task UPID:pve_node_name:0000A504:6DEABF24:5F44669B:stop::root@pam: completed with status ERROR'
      end
    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.9.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.9.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.9.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.9.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.8.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.8.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.8.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.8.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.8.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.7.4 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.7.3 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.7.2 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.7.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.7.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.6.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.5.1 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.5.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.4.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
hybrid_platforms_conductor-33.3.0 spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb