Sha256: 8ce8f082e7e2a3d301c69481226c6686f68405ad0d1796fbbd662d32f1d9d9ba

Contents?: true

Size: 1.75 KB

Versions: 29

Compression:

Stored size: 1.75 KB

Contents

describe HybridPlatformsConductor::HpcPlugins::PlatformHandler::ServerlessChef do

  context 'when checking inventory' do

    context 'with an empty platform' do

      it 'returns no node' do
        with_serverless_chef_platforms('empty') do |platform|
          expect(platform.known_nodes).to eq []
        end
      end

      it 'returns no nodes list' do
        with_serverless_chef_platforms('empty') do |platform|
          expect(platform.respond_to?(:known_nodes_lists)).to eq false
        end
      end

      it 'returns no deployable services' do
        with_serverless_chef_platforms('empty') do |platform|
          expect(platform.deployable_services).to eq []
        end
      end

    end

    context 'with a platform having 1 node' do

      it 'returns the node' do
        with_serverless_chef_platforms('1_node') do |platform|
          expect(platform.known_nodes).to eq ['node']
        end
      end

      it 'returns correct metadata for this node' do
        with_serverless_chef_platforms('1_node') do |platform|
          expect(platform.metadata_for('node')).to eq(
            description: 'Single test node',
            image: 'debian_9',
            private_ips: ['172.16.0.1'],
            property_1: {
              'property_11' => 'value11'
            },
            property_2: 'value2'
          )
        end
      end

      it 'returns correct service for this node' do
        with_serverless_chef_platforms('1_node') do |platform|
          expect(platform.services_for('node')).to eq %w[test_policy]
        end
      end

      it 'returns deployable services' do
        with_serverless_chef_platforms('1_node') do |platform|
          expect(platform.deployable_services).to eq %w[test_policy]
        end
      end

    end

  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.2.2 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.2.1 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.2.0 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.1.1 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.1.0 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.0.4 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.0.3 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.0.2 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb
hybrid_platforms_conductor-33.0.1 spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb