Sha256: f3b660ad339a6eb803a078770898906db8b6bde485cc93a82acec796e0177f25

Contents?: true

Size: 1.34 KB

Versions: 91

Compression:

Stored size: 1.34 KB

Contents

Shindo.tests("Fog::Compute[:hp] | security_group", ['hp']) do
  # Disabled due to https://github.com/fog/fog/1546
  pending

  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

91 entries across 91 versions & 9 rubygems

Version Path
fog-maestrodev-1.18.0.20131121075022 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/hp/models/compute/security_group_tests.rb
gapinc-fog-1.12.1.2.1 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/hp/models/compute/security_group_tests.rb
fog-1.18.0 tests/hp/models/compute/security_group_tests.rb
fog-1.17.0 tests/hp/models/compute/security_group_tests.rb
fog-1.16.0 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.15.0.20130829165835 tests/hp/models/compute/security_group_tests.rb
fog-1.15.0 tests/hp/models/compute/security_group_tests.rb
gapinc-fog-1.14.0 tests/hp/models/compute/security_group_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/hp/models/compute/security_group_tests.rb
fog-1.14.0 tests/hp/models/compute/security_group_tests.rb
fog-1.13.0 tests/hp/models/compute/security_group_tests.rb
gapinc-fog-1.12.1.2 tests/hp/models/compute/security_group_tests.rb
gapinc-fog-1.12.1.1 tests/hp/models/compute/security_group_tests.rb
gapinc-fog-1.12.1a tests/hp/models/compute/security_group_tests.rb