Sha256: d1cdd0e93038096257d6740a44823e386e0fbf9f2f49ceaaaff7a1e3b7ae87c5

Contents?: true

Size: 1.28 KB

Versions: 14

Compression:

Stored size: 1.28 KB

Contents

Shindo.tests("Fog::Compute[:hp] | security_group", ["hp"]) do

  model_tests(Fog::Compute[:hp].security_groups, {:name => 'foggroupname', :description => 'foggroupdescription'}, true)

  tests("a group with trailing whitespace") do
    @group = Fog::Compute[:hp].security_groups.create(:name => "   foggroup with spaces   ", :description => "   fog group desc   ")

    test("all spaces are removed from name") do
      @group.name == "   foggroup with spaces   ".strip!
    end

    test("all spaces are removed from description") do
      @group.description == "   fog group desc   ".strip!
    end

    @other_group = Fog::Compute[:hp].security_groups.create(:name => 'other group', :description => 'another group')

    test("authorize access by another security group") do
      sgrule = @group.create_rule(80..80, "tcp", nil, @other_group.id)
      @sg_rule_id = sgrule.body['security_group_rule']['id']
      @group.reload
      s = @group.rules.select {|r| r['id'] == @sg_rule_id unless r.nil?}
      s[0]['id'] == @sg_rule_id
    end

    test("revoke access from another security group") do
      @group.delete_rule(@sg_rule_id)
      @group.reload
      s = @group.rules.select {|r| r['id'] == @sg_rule_id unless r.nil?}
      s.empty?
    end

    @other_group.destroy
    @group.destroy
  end
end

Version data entries

14 entries across 14 versions & 6 rubygems

Version Path
fog-nirvanix-1.8.2 tests/hp/models/compute/security_group_tests.rb
fog-nirvanix-1.8.1 tests/hp/models/compute/security_group_tests.rb
fog-parser-fix-1.6.1 tests/hp/models/compute/security_group_tests.rb
fog-test-again-1.6.0 tests/hp/models/compute/security_group_tests.rb
fog-parser-fix-1.6.0 tests/hp/models/compute/security_group_tests.rb
fog-1.9.0 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/hp/models/compute/security_group_tests.rb
fog-sgonyea-1.8.1 tests/hp/models/compute/security_group_tests.rb
fog-1.8.0 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/hp/models/compute/security_group_tests.rb
fog-1.7.0 tests/hp/models/compute/security_group_tests.rb
fog-1.6.0 tests/hp/models/compute/security_group_tests.rb