コード例 #1
0
def test_compare_config6():
    """
    cl_interface attrs are marked for deletion
    """
    new_config = {'config': {'bridge-stp': None}}
    orig_config = {'config': {'speed: 100'}}
    remove_none_attrs(new_config)
    assert_equals(compare_config(new_config, orig_config), True)
コード例 #2
0
def test_compare_config3():
    """
    cl_interface test compare config.
    addr_method is different. 'config' is empty
    """
    new_config = {'addr_method': 'dhcp', 'addr_family': 'inet', 'config': {}}
    orig = orig_config()
    assert_equals(compare_config(new_config, orig), False)
コード例 #3
0
def test_compare_config5():
    """
    cl_interface test compare config. 'config' has new attr
    """
    new_config = {
        'config': {
            'bridge-stp': 'on'
        }
    }
    assert_equals(compare_config(new_config, orig_config()), False)
コード例 #4
0
def test_compare_config4():
    """
    cl_interface test compare config. 'config' is the same
    """
    new_config = {
        'config': {
            'speed': '1000'
        }
    }
    assert_equals(compare_config(new_config, orig_config()), True)
コード例 #5
0
def test_compare_config():
    """
    cl_interface test compare config. config is new is different
    """
    new_config = {
        'config': {
            'bridge-ports': 'swp2 swp3',
            'address': '10.1.1.1/24'
        }
    }
    assert_equals(compare_config(new_config, orig_config()), False)
コード例 #6
0
def test_compare_config():
    """
    cl_interface test compare config. config is new is different
    """
    new_config = {
        'config': {
            'bridge-ports': 'swp2 swp3',
            'address': '10.1.1.1/24'
        }
    }
    assert_equals(compare_config(new_config, orig_config()), False)
コード例 #7
0
def test_compare_config3():
    """
    cl_interface test compare config.
    addr_method is different. 'config' is empty
    """
    new_config = {
        'addr_method': 'dhcp',
        'addr_family': 'inet',
        'config': {}
    }
    orig = orig_config()
    assert_equals(compare_config(new_config, orig), False)
コード例 #8
0
def test_compare_config6():
    """
    cl_interface attrs are marked for deletion
    """
    new_config = {
        'config': {
            'bridge-stp': None
        }
    }
    orig_config = {
        'config': {
            'speed: 100'
        }
    }
    remove_none_attrs(new_config)
    assert_equals(compare_config(new_config, orig_config), True)
コード例 #9
0
def test_compare_config2():
    """
    cl_interface test compare config. addr_method is the same
    """

    new_config = {
        'addr_method': 'dhcp',
        'addr_family': 'inet',
        'config': {
            'speed': '1000'
        }
    }
    orig = orig_config()
    orig['addr_method'] = 'dhcp'
    orig['addr_family'] = 'inet'

    assert_equals(compare_config(new_config, orig), True)
コード例 #10
0
def test_compare_config2():
    """
    cl_interface test compare config. addr_method is the same
    """

    new_config = {
        'addr_method': 'dhcp',
        'addr_family': 'inet',
        'config': {
            'speed': '1000'
        }
    }
    orig = orig_config()
    orig['addr_method'] = 'dhcp'
    orig['addr_family'] = 'inet'

    assert_equals(compare_config(new_config, orig), True)
コード例 #11
0
def test_compare_config5():
    """
    cl_interface test compare config. 'config' has new attr
    """
    new_config = {'config': {'bridge-stp': 'on'}}
    assert_equals(compare_config(new_config, orig_config()), False)
コード例 #12
0
def test_compare_config4():
    """
    cl_interface test compare config. 'config' is the same
    """
    new_config = {'config': {'speed': '1000'}}
    assert_equals(compare_config(new_config, orig_config()), True)