diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-29 13:02:43 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-29 14:24:54 +0000 |
commit | bb84cdcfd5c5d4761778518a8e9d3c0ec7e7e949 (patch) | |
tree | 04dd837bf0374e7520fd234ff16fafc1115820df /test/scenario_test | |
parent | 3d808b5c0d6cbad6d62c2d267ca72d0e7605fb9b (diff) |
scenario_test: add option to specify exabgp_path
can be used to use local exabgp repository
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test')
-rw-r--r-- | test/scenario_test/docker_control.py | 11 | ||||
-rw-r--r-- | test/scenario_test/noseplugin.py | 1 | ||||
-rw-r--r-- | test/scenario_test/route_server_malformed_test.py | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/test/scenario_test/docker_control.py b/test/scenario_test/docker_control.py index 84bf9a54..91172040 100644 --- a/test/scenario_test/docker_control.py +++ b/test/scenario_test/docker_control.py @@ -441,7 +441,7 @@ def init_ipv6_test_env_executor(quagga_num, use_local, go_path, log_debug=False) print "complete initialization of test environment." -def init_malformed_test_env_executor(conf_file, use_local, go_path, log_debug=False): +def init_malformed_test_env_executor(conf_file, use_local, go_path, exabgp_path, log_debug=False): print "start initialization of exabgp test environment." if docker_container_check() or bridge_setting_check(): @@ -482,7 +482,14 @@ def init_malformed_test_env_executor(conf_file, use_local, go_path, log_debug=F make_startup_file(log_opt=opt) change_owner_to_root(CONFIG_DIR) - change_exabgp_version() + + if exabgp_path != "": + cmd = "cp -rf %s %s" % (exabgp_path, CONFIG_DIR) + local(cmd, capture=True) + cmd = "docker exec exabgp cp -rf " + SHARE_VOLUME + "/exabgp /root/" + local(cmd, capture=True) + else: + change_exabgp_version() start_gobgp() diff --git a/test/scenario_test/noseplugin.py b/test/scenario_test/noseplugin.py index daabeb20..a0cedb80 100644 --- a/test/scenario_test/noseplugin.py +++ b/test/scenario_test/noseplugin.py @@ -9,6 +9,7 @@ class OptionParser(Plugin): def options(self, parser, env=os.environ): super(OptionParser, self).options(parser, env=env) parser.add_option('--use-local', action="store_true", dest="use_local", default=False) + parser.add_option('--exabgp-path', action="store", dest="exabgp_path", default="") parser.add_option('--go-path', action="store", dest="go_path", default="") parser.add_option('--gobgp-log-debug', action="store_true", dest="gobgp_log_debug", default=False) diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py index 3902fc68..4c45a9f7 100644 --- a/test/scenario_test/route_server_malformed_test.py +++ b/test/scenario_test/route_server_malformed_test.py @@ -76,10 +76,12 @@ def test_malformed_packet(): use_local = parser_option.use_local log_debug = parser_option.gobgp_log_debug go_path = parser_option.go_path + exabgp_path = parser_option.exabgp_path + for pkey in pattern: conf_file = pwd + "/exabgp_test_conf/" + pkey if os.path.isfile(conf_file) is True: - fab.init_malformed_test_env_executor(pkey, use_local, go_path, log_debug) + fab.init_malformed_test_env_executor(pkey, use_local, go_path, exabgp_path, log_debug) print "please wait (" + str(initial_wait_time) + " second)" time.sleep(initial_wait_time) yield check_func, pkey, pattern[pkey] |