File: driver_tests.rb

package info (click to toggle)
ruby-fog-openstack 1.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,784 kB
  • sloc: ruby: 47,937; makefile: 5; sh: 4
file content (46 lines) | stat: -rw-r--r-- 1,299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require "test_helper"

describe "Fog::OpenStack::Baremetal | Baremetal driver requests" do
  before do
    @baremetal = Fog::OpenStack::Baremetal.new

    @driver_format = {
      'hosts' => Array,
      'name'  => String
    }

    @driver_properties_format = {
      "pxe_deploy_ramdisk"   => String,
      "ipmi_transit_address" => String,
      "ipmi_terminal_port"   => String,
      "ipmi_target_channel"  => String,
      "ipmi_transit_channel" => String,
      "ipmi_local_address"   => String,
      "ipmi_username"        => String,
      "ipmi_address"         => String,
      "ipmi_target_address"  => String,
      "ipmi_password"        => String,
      "pxe_deploy_kernel"    => String,
      "ipmi_priv_level"      => String,
      "ipmi_bridging"        => String
    }

    @instances = @baremetal.list_drivers.body
    @instance = @instances['drivers'].last
  end

  describe "success" do
    it "#list_drivers" do
      @instances.must_match_schema('drivers' => [@driver_format])
    end

    it "#get_driver" do
      @baremetal.get_driver(@instance['name']).body.must_match_schema(@driver_format)
    end

    it "#get_driver_properties" do
      @baremetal.get_driver_properties(@instance['name']).body.
        must_match_schema(@driver_properties_format)
    end
  end
end