From 965c3090cc295c6bc023a92eaf1829e1361a36b0 Mon Sep 17 00:00:00 2001 From: roos Date: Wed, 30 Jan 2019 10:16:53 +0100 Subject: [PATCH] paradigm shift --- .../topo_invalid_reloads_acceptance/test | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/acceptance/topo_invalid_reloads_acceptance/test b/acceptance/topo_invalid_reloads_acceptance/test index 64e3165c05..f398b9f159 100755 --- a/acceptance/topo_invalid_reloads_acceptance/test +++ b/acceptance/topo_invalid_reloads_acceptance/test @@ -10,9 +10,9 @@ TEST_TOPOLOGY="topology/Tiny.topo" IA=${IA:-1-ff00:0:112} IA_FILE="$(ia_file $IA)" -SRC_AS_FILE="$(as_file $IA)" +AS_FILE="$(as_file $IA)" -TOPO="gen/ISD1/AS$SRC_AS_FILE/topology.json" +TOPO="gen/ISD1/AS$AS_FILE/topology.json" test_setup() { set -e @@ -26,37 +26,37 @@ test_setup() { test_run() { set -e - cp "gen/ISD1/AS$SRC_AS_FILE/ps$IA_FILE-1/topology.json" "gen/ISD1/AS$SRC_AS_FILE/" - test_ps_immutable "ps1-ff00_0_111-1" "gen/ISD1/AS$SRC_AS_FILE/ps$IA_FILE-1/topology.json" - test_immutable "sd1-ff00_0_111" "gen/ISD1/AS$SRC_AS_FILE/endhost/topology.json" + cp "gen/ISD1/AS$AS_FILE/ps$IA_FILE-1/topology.json" "$TOPO" + test_ps_immutable "ps$IA_FILE-1" "gen/ISD1/AS$AS_FILE/ps$IA_FILE-1/topology.json" "PS" + test_immutable "sd$IA_FILE" "gen/ISD1/AS$AS_FILE/endhost/topology.json" "SD" } test_ps_immutable() { - test_immutable $1 $2 + test_immutable $1 $2 "$3" jq '.PathService[].Addrs.IPv4.Public.Addr = "242.42.42.42"' $TOPO | sponge $2 - check_no_reload $1 "Addr" + check_no_reload $1 5 "$3: Addr" jq '.PathService[].Addrs.IPv4.Public.L4Port = 42424' $TOPO | sponge $2 - check_no_reload $1 "L4Port" + check_no_reload $1 6 "$3: L4Port" } test_immutable() { jq '.ISD_AS = "1-ff00:0:111"' $TOPO | sponge $2 - check_no_reload "$1" "ISD_AS" - jq '.Core = true' $TOPO | sponge $2 - check_no_reload "$1" "Core" - jq '.Overlay = "IPv6"' $TOPO | sponge $2 - check_no_reload "$1" "Overlay" + check_no_reload "$1" 1 "$3: ISD_AS" + jq '.Core = true | del( .BorderRouters[].Interfaces )' $TOPO | sponge $2 + check_no_reload "$1" 2 "$3: Core" + jq '.Overlay = "UDP/IPv4+6"' $TOPO | sponge $2 + check_no_reload "$1" 3 "$3: Overlay" jq '.MTU = 42' $TOPO | sponge $2 - check_no_reload "$1" "MTU" + check_no_reload "$1" 4 "$3: MTU" } check_no_reload() { ./tools/dc scion kill -s HUP scion_"$1" - sleep 1 - grep -q "Reloaded topology" "logs/$1.log" || local failed=$? - if [ -z ${failed+x} ]; then - echo "FAIL: Successful reload should not be possible. step=( $2 )" + sleep 2 + local errors=$( grep "Unable to set topology" "logs/$1.log" | wc -l ) + if [ "$errors" != $2 ]; then + echo "FAIL: Successful reload should not be possible. step=( $3 ) expErrCount=$2 actErrCount=$errors " return 1 fi }