From cb9a1a047abf204234e7c7cefae7d54f127de375 Mon Sep 17 00:00:00 2001 From: cgparini Date: Thu, 12 Oct 2017 09:40:53 +0200 Subject: [PATCH 1/2] Fix make clean logs Move echo outside of testOutput Signed-off-by: cgparini --- Makefile | 3 ++- scripts/run_gobgp_watcher_examples.sh | 6 +++++- scripts/testOuput.sh | 4 ---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index cec4997..3399571 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,8 @@ clean: @echo "# cleaning" @rm -f examples/gobgp_watch_plugin/gobgp_watch_plugin @rm -f docker/gobgp_route_reflector/gobgp-client-in-host/gobgp-client-in-host - @rm -f docker/gobgp_route_reflector/gobgp-client-in-host/log + @rm -f docker/gobgp_route_reflector/usage_scripts/gobgp-client-in-host/log + @rm -f log @echo "# done" #run all diff --git a/scripts/run_gobgp_watcher_examples.sh b/scripts/run_gobgp_watcher_examples.sh index 4e670ea..5d330cc 100755 --- a/scripts/run_gobgp_watcher_examples.sh +++ b/scripts/run_gobgp_watcher_examples.sh @@ -33,7 +33,11 @@ echo "#### running go example (gobgp plugin,example plugin)" expected=("Agent received path &{65001 101.0.0.0/24 101.0.10.1} ") -testOutput ./examples/gobgp_watch_plugin/gobgp_watch_plugin "${expected}" +./examples/gobgp_watch_plugin/gobgp_watch_plugin &> log & +sleep 20 +echo "$(less log)" +echo "#### validating Go example output" +testOutput "$(less log)" "${expected}" echo "done" echo "" diff --git a/scripts/testOuput.sh b/scripts/testOuput.sh index ad09acd..4b0b986 100755 --- a/scripts/testOuput.sh +++ b/scripts/testOuput.sh @@ -23,10 +23,6 @@ IFS="${PREV_IFS}" sleep 2 IFS=" " - echo "Output of $1:" - cat ${TMP_FILE} - echo "" - echo "Checking output of $1" rv=0 # loop through expected lines for i in $2 From 88ea390fd7019e0fc6c70cac810925fc597001bb Mon Sep 17 00:00:00 2001 From: cgparini Date: Thu, 12 Oct 2017 10:40:34 +0200 Subject: [PATCH 2/2] Print Path added to gobgp Signed-off-by: cgparini --- docker/gobgp_route_reflector/usage_scripts/addPath.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/gobgp_route_reflector/usage_scripts/addPath.sh b/docker/gobgp_route_reflector/usage_scripts/addPath.sh index eb39628..04596ac 100755 --- a/docker/gobgp_route_reflector/usage_scripts/addPath.sh +++ b/docker/gobgp_route_reflector/usage_scripts/addPath.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +PREFIX="101.0.0.0/24" +NEXTHOP="101.0.10.1" ## Advertize path -docker exec -i gobgp-for-rr bash <<< "gobgp global rib add -a ipv4 101.0.0.0/24 nexthop 101.0.10.1" \ No newline at end of file +echo "##### prefix "$PREFIX +echo "##### nexthop "$NEXTHOP + +( +echo "gobgp global rib add -a ipv4 "$PREFIX" nexthop "$NEXTHOP +) | docker exec -i gobgp-for-rr bash \ No newline at end of file