diff options
Diffstat (limited to 'test/scenario_test/gobgp_test.py')
-rw-r--r-- | test/scenario_test/gobgp_test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/scenario_test/gobgp_test.py b/test/scenario_test/gobgp_test.py index 78a29823..e416db2c 100644 --- a/test/scenario_test/gobgp_test.py +++ b/test/scenario_test/gobgp_test.py @@ -205,6 +205,13 @@ class GoBGPTestBase(unittest.TestCase): cmd += "softreset%s -a %s" % (type, af) local(cmd) + def set_policy(self, peer, target, policy_name, default_accept=True): + default_policy = "ACCEPT" if default_accept else "REJECT" + cmd = "%s " % CLI_CMD + cmd += NEIGHBOR + " %s " % peer + cmd += POLICY + " add %s %s %s" % (target, policy_name, default_policy) + local(cmd) + def get_paths_in_localrib(self, neighbor_address, target_prefix, af="ipv4", retry=3, interval=5): retry_count = 0 while True: |