diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-06-10 18:24:03 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-06-10 21:44:44 +0900 |
commit | f6824f870639d0e635f3415869d9d8047263d46c (patch) | |
tree | af74639dde7b9cb1be89e7eea5dd47105e89bd05 /test/scenario_test | |
parent | 99c2d7157439f11a4f52bf8114fe14205d79160b (diff) |
scenario_test: execute the cli command using the docker exec in test
Diffstat (limited to 'test/scenario_test')
-rw-r--r-- | test/scenario_test/constant.py | 2 | ||||
-rw-r--r-- | test/scenario_test/docker_control.py | 1 | ||||
-rw-r--r-- | test/scenario_test/gobgp_test.py | 15 | ||||
-rw-r--r-- | test/scenario_test/route_server_malformed_test.py | 2 |
4 files changed, 4 insertions, 16 deletions
diff --git a/test/scenario_test/constant.py b/test/scenario_test/constant.py index ebcf897c..3b447813 100644 --- a/test/scenario_test/constant.py +++ b/test/scenario_test/constant.py @@ -28,7 +28,7 @@ GOBGP_CONFIG_FILE = "gobgpd.conf" CONFIG_DIR = "/tmp/gobgp" CONFIG_DIRR = "/tmp/gobgp/" SHARE_VOLUME = "/root/share_volume" -CLI_CMD = "gobgpcli" +CLI_CMD = "docker exec gobgp /go/bin/gobgp" EXABGP_CONTAINER_NAME = "exabgp" EXABGP_ADDRESS = "10.0.0.100/16" EXABGP_CONFDIR = SHARE_VOLUME + "/exabgp_test_conf" diff --git a/test/scenario_test/docker_control.py b/test/scenario_test/docker_control.py index c55826ef..687008cd 100644 --- a/test/scenario_test/docker_control.py +++ b/test/scenario_test/docker_control.py @@ -186,7 +186,6 @@ def make_install_file(use_local=False): file_buff += 'cd gobgp' + '\n' file_buff += 'go get -v' + '\n' file_buff += 'go build' + '\n' - file_buff += 'cp gobgp ' + SHARE_VOLUME + '/' + CLI_CMD + '\n' file_buff += 'cd ../gobgpd' + '\n' file_buff += 'go get -v' + '\n' file_buff += 'go build' diff --git a/test/scenario_test/gobgp_test.py b/test/scenario_test/gobgp_test.py index 030bf9c4..78a29823 100644 --- a/test/scenario_test/gobgp_test.py +++ b/test/scenario_test/gobgp_test.py @@ -30,7 +30,6 @@ class GoBGPTestBase(unittest.TestCase): gobgp_ip = GOBGP_IP gobgp_ipv6 = GOBGP_ADDRESS_0[IPv6] - gobgp_port = "8080" base_dir = CONFIG_DIRR gobgp_config_file = CONFIG_DIRR + "gobgpd.conf" gobgp_config = None @@ -189,12 +188,7 @@ class GoBGPTestBase(unittest.TestCase): def ask_gobgp(self, what, who="", af="ipv4"): af = "-a %s" % af - - gobgp_ip = self.gobgp_ip - if self.use_ipv6_gobgp: - gobgp_ip = self.gobgp_ipv6 - - cmd = "%s/%s -j -u %s -p %s " % (CONFIG_DIR, CLI_CMD, gobgp_ip, self.gobgp_port) + cmd = "%s -j " % CLI_CMD if what == GLOBAL_RIB: cmd += " ".join([what, af]) elif what == NEIGHBOR: @@ -206,12 +200,7 @@ class GoBGPTestBase(unittest.TestCase): return result def soft_reset(self, neighbor_address, af, type="in"): - - gobgp_ip = self.gobgp_ip - if self.use_ipv6_gobgp: - gobgp_ip = self.gobgp_ipv6 - - cmd = "%s/%s -j -u %s -p %s " % (CONFIG_DIR, CLI_CMD, gobgp_ip, self.gobgp_port) + cmd = "%s -j " % CLI_CMD cmd += "neighbor %s " % neighbor_address cmd += "softreset%s -a %s" % (type, af) local(cmd) diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py index f695b562..ac3d1186 100644 --- a/test/scenario_test/route_server_malformed_test.py +++ b/test/scenario_test/route_server_malformed_test.py @@ -114,7 +114,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 neighbor" % (CONFIG_DIR, CLI_CMD, gobgp_ip, gobgp_port) + cmd = "%s -j neighbor" % CLI_CMD j = local(cmd, capture=True) neighbors = json.loads(j) except Exception: |