Beispiel #1
0
def test_create_arp():
    """Test Arp creation."""
    arp = Arp(**cfg_test)
    assert Arp

    # verify cfg items
    for k, v in list(cfg_test.items()):
        assert arp.data[k] == v
Beispiel #2
0
def test_hash():
    """Test Arp hash."""
    arp1 = Arp(**cfg_test)
    arp2 = Arp(**cfg_test)

    cfg_changed = copy(cfg_test)
    cfg_changed['name'] = '4.3.2.1'
    arp3 = Arp(**cfg_changed)

    cfg_changed = copy(cfg_test)
    cfg_changed['partition'] = 'other'
    arp4 = Arp(**cfg_changed)

    assert arp1
    assert arp2
    assert arp3
    assert arp4

    assert hash(arp1) == hash(arp2)
    assert hash(arp1) != hash(arp3)
    assert hash(arp1) != hash(arp4)
Beispiel #3
0
def test_eq():
    """Test Arp equality."""
    arp1 = Arp(**cfg_test)
    arp2 = Arp(**cfg_test)
    assert arp1
    assert arp2
    assert arp1 == arp2

    # name not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['name'] = '4.3.2.1'
    arp2 = Arp(**cfg_changed)
    assert arp1 != arp2

    # partition not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['partition'] = 'other'
    arp2 = Arp(**cfg_changed)
    assert arp1 != arp2

    # ipAddress not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['ipAddress'] = '4.3.2.1'
    arp2 = Arp(**cfg_changed)
    assert arp1 != arp2

    # macAddress not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['macAddress'] = '98:ab:76:cd:54:ef'
    arp2 = Arp(**cfg_changed)
    assert arp1 != arp2
Beispiel #4
0
def test_uri_path(bigip):
    """Test Arp URI."""
    arp = Arp(**cfg_test)
    assert arp._uri_path(bigip) == bigip.tm.net.arps.arp
Beispiel #5
0
def test_uri_path(bigip):
    """Test Arp URI."""
    arp = Arp(**cfg_test)
    assert arp._uri_path(bigip) == bigip.tm.net.arps.arp