mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
scenario_test: support to the new cli client
This commit is contained in:
committed by
FUJITA Tomonori
parent
c5264192a2
commit
e8ff6de23a
@@ -62,5 +62,5 @@ A_PART_OF_CURRENT_DIR = "/test/scenario_test"
|
||||
ADJ_RIB_IN = "adj-in"
|
||||
ADJ_RIB_OUT = "adj-out"
|
||||
LOCAL_RIB = "local"
|
||||
GLOBAL_RIB = "global"
|
||||
GLOBAL_RIB = "global rib"
|
||||
NEIGHBOR = "neighbor"
|
||||
|
||||
@@ -186,7 +186,8 @@ class GoBGPTestBase(unittest.TestCase):
|
||||
return True
|
||||
|
||||
def ask_gobgp(self, what, who="", af="ipv4"):
|
||||
cmd = "%s/%s -j -u %s -p %s show " % (CONFIG_DIR, CLI_CMD, self.gobgp_ip, self.gobgp_port)
|
||||
af = "-a %s" % af
|
||||
cmd = "%s/%s -j -u %s -p %s " % (CONFIG_DIR, CLI_CMD, self.gobgp_ip, self.gobgp_port)
|
||||
if what == GLOBAL_RIB:
|
||||
cmd += " ".join([what, af])
|
||||
elif what == NEIGHBOR:
|
||||
@@ -198,8 +199,9 @@ class GoBGPTestBase(unittest.TestCase):
|
||||
return result
|
||||
|
||||
def soft_reset(self, neighbor_address, route_family, type="in"):
|
||||
cmd = "%s/%s -j -u %s -p %s softreset%s " % (CONFIG_DIR, CLI_CMD, self.gobgp_ip, self.gobgp_port, type)
|
||||
cmd += "neighbor %s %s" % (neighbor_address, route_family)
|
||||
cmd = "%s/%s -j -u %s -p %s " % (CONFIG_DIR, CLI_CMD, self.gobgp_ip, self.gobgp_port)
|
||||
cmd += "neighbor %s " % neighbor_address
|
||||
cmd += "softreset%s -a %s" % (type, route_family)
|
||||
local(cmd)
|
||||
|
||||
def get_paths_in_localrib(self, neighbor_address, target_prefix, retry=3, interval=5):
|
||||
|
||||
@@ -116,7 +116,7 @@ def check_func(exabgp_conf, result):
|
||||
retry_count += 1
|
||||
# check whether the service of gobgp is normally
|
||||
try:
|
||||
cmd = "%s/%s -j -u %s -p %s show neighbors" % (CONFIG_DIR, CLI_CMD, gobgp_ip, gobgp_port)
|
||||
cmd = "%s/%s -j -u %s -p %s neighbor" % (CONFIG_DIR, CLI_CMD, gobgp_ip, gobgp_port)
|
||||
j = local(cmd, capture=True)
|
||||
neighbors = json.loads(j)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user