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-1.22.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.21.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.20.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-1.19.0 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/xenserver/requests/compute/destroy_vlan_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/xenserver/requests/compute/destroy_vlan_tests.rb