diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-27 16:55:12 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-29 14:24:54 +0000 |
commit | e0ae574838a9af9e440e2df1f36b8944566d38c1 (patch) | |
tree | b48e47941003375fd3170f9d900dfa382c5784b5 | |
parent | bb84cdcfd5c5d4761778518a8e9d3c0ec7e7e949 (diff) |
scenario_test: add route server flag
this is a preparation for normal BGP scenario test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | test/scenario_test/docker_control.py | 12 | ||||
-rw-r--r-- | test/scenario_test/quagga-rsconfig.go | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/test/scenario_test/docker_control.py b/test/scenario_test/docker_control.py index 91172040..b7ad0ef0 100644 --- a/test/scenario_test/docker_control.py +++ b/test/scenario_test/docker_control.py @@ -349,7 +349,7 @@ def reload_config(): print "complete append docker container." -def init_test_env_executor(quagga_num, use_local, go_path, log_debug=False): +def init_test_env_executor(quagga_num, use_local, go_path, log_debug=False, is_route_server=True): print "start initialization of test environment." if docker_container_check() or bridge_setting_check(): @@ -360,7 +360,7 @@ def init_test_env_executor(quagga_num, use_local, go_path, log_debug=False): print "make gobgp test environment." create_config_dir() bridge_setting_for_docker_connection(BRIDGES) - make_config(quagga_num, go_path, BRIDGE_0) + make_config(quagga_num, go_path, BRIDGE_0, ("" if is_route_server else "--normal-bgp")) # run gobgp docker container docker_container_run_gobgp(BRIDGE_0) @@ -498,8 +498,8 @@ def init_malformed_test_env_executor(conf_file, use_local, go_path, exabgp_path start_exabgp(conf_file) -def docker_container_quagga_append_executor(quagga_num, go_path): - make_config_append(quagga_num, go_path, BRIDGE_0) +def docker_container_quagga_append_executor(quagga_num, go_path, is_route_server=True): + make_config_append(quagga_num, go_path, BRIDGE_0, ("" if is_route_server else "--normal-bgp")) docker_container_quagga_append(quagga_num, BRIDGE_0) reload_config() @@ -520,9 +520,9 @@ def docker_container_quagga_removed_executor(quagga_num): docker_container_quagga_removed(quagga_num) -def docker_container_make_bestpath_env_executor(append_quagga_num, go_path): +def docker_container_make_bestpath_env_executor(append_quagga_num, go_path, is_route_server=True): print "start make bestpath environment" - make_config_append(append_quagga_num, go_path, BRIDGE_1) + make_config_append(append_quagga_num, go_path, BRIDGE_1, ("" if is_route_server else "--normal-bgp")) append_quagga_name = "q" + str(append_quagga_num) docker_container_quagga_append(append_quagga_num, BRIDGE_1) reload_config() diff --git a/test/scenario_test/quagga-rsconfig.go b/test/scenario_test/quagga-rsconfig.go index 4af43cd6..9c92cb50 100644 --- a/test/scenario_test/quagga-rsconfig.go +++ b/test/scenario_test/quagga-rsconfig.go @@ -88,7 +88,7 @@ func (qt *QuaggaConfig) IPv6Config() *bytes.Buffer { return buf } -func create_config_files(nr int, outputDir string, IPVersion string, nonePeer bool) { +func create_config_files(nr int, outputDir string, IPVersion string, nonePeer bool, normalBGP bool) { quaggaConfigList := make([]*QuaggaConfig, 0) gobgpConf := config.Bgp{ @@ -103,8 +103,8 @@ func create_config_files(nr int, outputDir string, IPVersion string, nonePeer bo PeerAs: 65000 + uint32(i), NeighborAddress: net.ParseIP(fmt.Sprintf("%s%d", baseNeighborAddress[IPVersion], i)), AuthPassword: fmt.Sprintf("hoge%d", i), - RouteServer: config.RouteServer{RouteServerClient: true}, TransportOptions: config.TransportOptions{PassiveMode: true}, + RouteServer: config.RouteServer{RouteServerClient: !normalBGP}, Timers: config.Timers{HoldTime: 30, KeepaliveInterval: 10, IdleHoldTimeAfterReset: 10}, PeerType: config.PEER_TYPE_EXTERNAL, } @@ -135,7 +135,7 @@ func create_config_files(nr int, outputDir string, IPVersion string, nonePeer bo } } -func append_config_files(ar int, outputDir string, IPVersion string, nonePeer bool) { +func append_config_files(ar int, outputDir string, IPVersion string, nonePeer bool, normalBGP bool) { gobgpConf := config.Bgp{ Global: config.Global{ @@ -147,7 +147,7 @@ func append_config_files(ar int, outputDir string, IPVersion string, nonePeer bo PeerAs: 65000 + uint32(ar), NeighborAddress: net.ParseIP(fmt.Sprintf("%s%d", baseNeighborAddress[IPVersion], ar)), AuthPassword: fmt.Sprintf("hoge%d", ar), - RouteServer: config.RouteServer{RouteServerClient: true}, + RouteServer: config.RouteServer{RouteServerClient: !normalBGP}, TransportOptions: config.TransportOptions{PassiveMode: true}, Timers: config.Timers{HoldTime: 30, KeepaliveInterval: 10, IdleHoldTimeAfterReset: 10}, PeerType: config.PEER_TYPE_EXTERNAL, @@ -188,6 +188,7 @@ func main() { IPVersion string `short:"v" long:"ip-version" description:"specifing the use ip version" default:"IPv4"` NetIdentifier int `short:"i" long:"net-identifer" description:"specifing the use network identifier" default:"0"` NonePeer bool `long:"none-peer" description:"disable make quagga config"` + NormalBGP bool `long:"normal-bgp" description:"generate normal bgp server configuration"` } parser := flags.NewParser(&opts, flags.Default) _, err := parser.Parse() @@ -217,11 +218,11 @@ func main() { } if opts.AppendClient == 0 { - create_config_files(opts.ClientNumber, opts.OutputDir, opts.IPVersion, opts.NonePeer) + create_config_files(opts.ClientNumber, opts.OutputDir, opts.IPVersion, opts.NonePeer, opts.NormalBGP) } else { if _, err := os.Stat(fmt.Sprintf("%s/gobgpd.conf", opts.OutputDir)); os.IsNotExist(err) { log.Fatal(err) } - append_config_files(opts.AppendClient, opts.OutputDir, opts.IPVersion, opts.NonePeer) + append_config_files(opts.AppendClient, opts.OutputDir, opts.IPVersion, opts.NonePeer, opts.NormalBGP) } } |