Sha256: 26bc4934d1bd3e9f7afc217565536bf7e22c5431be28cb10946781b57c3bd18b

Contents?: true

Size: 1.56 KB

Versions: 19

Compression:

Stored size: 1.56 KB

Contents

Shindo.tests('Fog::Baremetal[:openstack] | Baremetal chassis requests', ['openstack']) do
  openstack = Fog::Identity[:openstack]

  @chassis_format = {
    'description' => String,
    'uuid'        => String,
    'links'       => Array
  }

  @detailed_chassis_format = {
    'description' => String,
    'uuid'        => String,
    'created_at'  => String,
    'updated_at'  => Fog::Nullable::String,
    'extra'       => Hash,
    'nodes'       => Array,
    'links'       => Array
  }

  tests('success') do
    tests('#list_chassis').data_matches_schema({'chassis' => [@chassis_format]}) do
      Fog::Baremetal[:openstack].list_chassis.body
    end

    tests('#list_chassis_detailed').data_matches_schema({'chassis' => [@detailed_chassis_format]}) do
      Fog::Baremetal[:openstack].list_chassis_detailed.body
    end

    tests('#create_chassis').data_matches_schema(@detailed_chassis_format) do
      chassis_attributes = {:description => 'description'}
      @instance = Fog::Baremetal[:openstack].create_chassis(chassis_attributes).body
    end

    tests('#get_chassis').data_matches_schema(@detailed_chassis_format) do
      Fog::Baremetal[:openstack].get_chassis(@instance['uuid']).body
    end

    tests('#patch_chassis').data_matches_schema(@detailed_chassis_format) do
      Fog::Baremetal[:openstack].patch_chassis(
          @instance['uuid'],
          [{'op' => 'replace', 'path' => '/description', 'value' => 'new description'}]).body
    end

    tests('#delete_chassis').succeeds do
      Fog::Baremetal[:openstack].delete_chassis(@instance['uuid'])
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
fog-openstack-0.1.6 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.5 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.4 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.3 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.2 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.1 tests/openstack/requests/baremetal/chassis_tests.rb
fog-openstack-0.1.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.37.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.36.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.35.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-2.0.0.pre.0 tests/openstack/requests/baremetal/chassis_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.34.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.33.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.32.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.31.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.30.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.29.0 tests/openstack/requests/baremetal/chassis_tests.rb
fog-1.28.0 tests/openstack/requests/baremetal/chassis_tests.rb