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)
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)
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)
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)
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)
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)
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)
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)
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)
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)