def test_run_route_sources_not_list():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['ord -> lax'] = 'fw1.ord'
    exp_routes = empty_exp_routes.copy()
    exp_routes['ord', 'lax'] = set(['fw1.ord'])
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, exp_routes, exp_sources('fw1.ord'))
Esempio n. 2
0
def test_run_route_sources_not_list():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['ord -> lax'] = 'fw1.ord'
    exp_routes = empty_exp_routes.copy()
    exp_routes['ord', 'lax'] = set(['fw1.ord'])
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, exp_routes,
                                   exp_sources('fw1.ord'))
Esempio n. 3
0
def test_run_address_space_list():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['address_spaces']['ord'] = [
        '100.0.0.0/9', '100.128.0.0/9'
    ]
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, empty_exp_routes,
                                   exp_sources())
def test_run_star_source():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['* -> lax'] = 'fw1.lax'
    exp_routes = empty_exp_routes.copy()
    exp_routes['ord', 'lax'] = set(['fw1.lax'])
    exp_routes['lax', 'lax'] = set(['fw1.lax'])
    exp_routes['nyc', 'lax'] = set(['fw1.lax'])
    exp_routes['unmanaged', 'lax'] = set(['fw1.lax'])
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, exp_routes, exp_sources('fw1.lax'))
Esempio n. 5
0
def test_run_star_dest():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['lax -> *'] = 'fw1.lax'
    exp_routes = empty_exp_routes.copy()
    exp_routes['lax', 'ord'] = set(['fw1.lax'])
    exp_routes['lax', 'nyc'] = set(['fw1.lax'])
    exp_routes['lax', 'lax'] = set(['fw1.lax'])
    exp_routes['lax', 'unmanaged'] = set(['fw1.lax'])
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, exp_routes,
                                   exp_sources('fw1.lax'))
def test_run_route_with_invalid_space():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['mdw -> lax'] = 'fw1.ord'
    with patched_combine():
        assert_raises(RuntimeError, lambda:
            scripts.run(cfg['enterprise'], cfg))
def test_run_address_space_list():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['address_spaces']['ord'] = ['100.0.0.0/9', '100.128.0.0/9']
    with patched_combine() as combine:
        scripts.run(cfg['enterprise'], cfg)
        combine.assert_called_with(exp_address_spaces, empty_exp_routes, exp_sources())
Esempio n. 8
0
def test_run_route_with_invalid_space():
    cfg = copy.deepcopy(base_cfg)
    cfg['enterprise']['routes']['mdw -> lax'] = 'fw1.ord'
    with patched_combine():
        assert_raises(RuntimeError,
                      lambda: scripts.run(cfg['enterprise'], cfg))