Sha256: ea21ebe61401ec948b69b7c6e8bcb623d12f04a4054dd4642316f52313a80952

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

require_relative "test_helper"

class TestBGPPeer < Minitest::Unit::TestCase
  include Clusterfuck

  def setup
    @peer = BGPPeer.new(:peer)
    @peer2 = BGPPeer.new(:peer2)
    @cluster = Cluster.new(:test)
  end

  def test_assigned_random_asn_in_private_range
    assert_instance_of Fixnum, @peer.bgp_asn
    assert 65000 <= @peer.bgp_asn
  end

  def test_assigned_random_ipv4_ip_as_router_id
    assert_match(/\d+\.\d+\.\d+\.\d+/, @peer.bgp_router_id.to_s)
  end

  def test_assigned_successive_asns
    assert_equal @peer.bgp_asn + 1, @peer2.bgp_asn
  end

  def test_assigned_different_default_ips_as_router_id
    refute_equal @peer.bgp_router_id, @peer2.bgp_router_id
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-clusterfuck-0.0.7 test/bgp_peer_test.rb
vagrant-clusterfuck-0.0.6 test/bgp_peer_test.rb
vagrant-clusterfuck-0.0.5 test/bgp_peer_test.rb
vagrant-clusterfuck-0.0.4 test/bgp_peer_test.rb
vagrant-clusterfuck-0.0.3 test/bgp_peer_test.rb
vagrant-clusterfuck-0.0.2 test/bgp_peer_test.rb