Sha256: 1bd5f1d9b1e87aee1cc8d87a524278d0fb3c4488c3c1e5cb08dd397d9a85409f

Contents?: true

Size: 988 Bytes

Versions: 58

Compression:

Stored size: 988 Bytes

Contents

Shindo.tests('Fog::Compute[:xenserver] | destroy_vlan request', ['xenserver']) do

  compute = Fog::Compute[:xenserver]

  tests('success') do
    test('#destroy_vlan') do
      @net = compute.networks.create :name => 'test-net'

      # try to use a bonded interface first
      @pif = compute.pifs.find { |p| p.device == 'bond0' and p.vlan == "-1" }
      unless @pif
        @pif = compute.pifs.find { |p| p.device == 'eth0' and p.vlan == "-1" }
      end

      @ref = compute.create_vlan @pif.reference, 1499, @net.reference
      compute.destroy_vlan @ref
      (compute.vlans.reload.find { |v| v.reference == @ref }).nil?
    end
  end
  
  tests('failure') do
    test('#destroy_vlan invalid') do
      raises = false
      # Try to create a VLAN with a duplicated tag
      begin
        compute.destroy_vlan @ref
      rescue Fog::XenServer::RequestFailed => e
        raises = true if (e.message =~ /HANDLE_INVALID/)
      end
      raises
    end
  end

  @net.destroy
  
end

Version data entries

58 entries across 58 versions & 4 rubygems

Version Path
fog-maestrodev-1.15.0.20130927082724 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.15.0.20130829165835 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.15.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
gapinc-fog-1.14.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.14.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.13.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
gapinc-fog-1.12.1.2 tests/xenserver/requests/compute/destroy_vlan_tests.rb
gapinc-fog-1.12.1.1 tests/xenserver/requests/compute/destroy_vlan_tests.rb
gapinc-fog-1.12.1a tests/xenserver/requests/compute/destroy_vlan_tests.rb
gapinc-fog-1.12.1 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.12.1 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.12.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/xenserver/requests/compute/destroy_vlan_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.11.1 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.11.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.10.1 tests/xenserver/requests/compute/destroy_vlan_tests.rb