Sha256: 3974341737fa3fa260661afc277a6167262337411dd46d20326120b7dab84660

Contents?: true

Size: 1.74 KB

Versions: 37

Compression:

Stored size: 1.74 KB

Contents

Shindo.tests("Fog::Network[:openstack] | network", ['openstack']) do

  tests('success') do

    tests('#create').succeeds do
      @instance = Fog::Network[:openstack].networks.create(:name => 'net_name',
                                                           :shared => false,
                                                           :admin_state_up => true,
                                                           :tenant_id => 'tenant_id')
      !@instance.id.nil?
    end

    tests('#create+extensions').succeeds do
      net = Fog::Network[:openstack].networks.create(
        :name => 'net_name',
        :shared => false,
        :admin_state_up => true,
        :tenant_id => 'tenant_id',
        :router_external => true,
        # local, gre, vlan. Depends on the provider.
        # May rise an exception if the network_type isn't valid:
        # QuantumError: "Invalid input for operation: provider:physical_network"
        :provider_network_type => 'gre',
        :provider_segmentation_id => 22
      )
      net.destroy
      net.provider_network_type == 'gre'
    end

    tests('have attributes') do
      attributes = [
        :name,
        :subnets,
        :shared,
        :status,
        :admin_state_up,
        :tenant_id,
        :provider_network_type,
        :provider_physical_network,
        :provider_segmentation_id,
        :router_external
      ]
      tests("The network model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { @instance.respond_to? attribute }
        end
      end
    end

    tests('#update').succeeds do
      @instance.name = 'new_net_name'
      @instance.update
    end

    tests('#destroy').succeeds do
      @instance.destroy == true
    end

  end

end

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
fog-openstack-0.1.7 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.6 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.5 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.4 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.3 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.2 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.1 tests/openstack/models/network/network_tests.rb
fog-openstack-0.1.0 tests/openstack/models/network/network_tests.rb
fog-1.37.0 tests/openstack/models/network/network_tests.rb
fog-1.36.0 tests/openstack/models/network/network_tests.rb
fog-1.35.0 tests/openstack/models/network/network_tests.rb
fog-2.0.0.pre.0 tests/openstack/models/network/network_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/models/network/network_tests.rb
fog-1.34.0 tests/openstack/models/network/network_tests.rb
fog-1.33.0 tests/openstack/models/network/network_tests.rb
fog-1.32.0 tests/openstack/models/network/network_tests.rb
fog-1.31.0 tests/openstack/models/network/network_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/openstack/models/network/network_tests.rb
fog-1.30.0 tests/openstack/models/network/network_tests.rb
fog-1.29.0 tests/openstack/models/network/network_tests.rb