From d707222ededa671375bbf30d531dd97d064bd985 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Tue, 23 Feb 2016 00:10:20 +0100 Subject: [PATCH] Cer and cea helper --- .../resources/scripts/tinyTestcase.sh | 73 +++++++++++-------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/example/diameter/launcher/resources/scripts/tinyTestcase.sh b/example/diameter/launcher/resources/scripts/tinyTestcase.sh index 68e32af..08145fd 100755 --- a/example/diameter/launcher/resources/scripts/tinyTestcase.sh +++ b/example/diameter/launcher/resources/scripts/tinyTestcase.sh @@ -75,6 +75,12 @@ usage() { echo " not responsability for this script. Such operations shall be externally performed to guarantee that" echo " programming this testcase is going to be valid in context of test execution. Anyway, CER messages" echo " will be detected and symbolically linked with the name 'cer..xml'." + echo + echo " PCAPS WITHOUT CER/CEA MESSAGES:" + echo + echo " There is a helper tool to build CER/CEA messages for involved origin hosts. This is useful when the" + echo " pcap file analyzed miss the capabilities exchange messages: touch the file 'create_cer_and_cea' inside" + echo " the source directory, and follow the instructions." _exit } @@ -269,19 +275,21 @@ do count=$((count+1)) done -# PCAPs without CER messages ... -if [ ! -s cers_4_starting_origin_hosts ] +if [ -f $SOURCE_DIR/create_cer_and_cea ] then - if [ $n_involved -ne 0 ] - then - grep " cers_4_starting_origin_hosts - for oh in `cat cers_4_starting_origin_hosts` - do - cer_file=cer.${oh}.xml - touch $cer_file - echo "WARNING: perhaps you should configure '$cer_file' because it is missing in the pcap file provided." - echo " Currently it contains a basic template but you must fill/fix the unknowns '$WHAT'." - cat << EOF > $cer_file + # PCAPs without CER messages ... + if [ ! -s cers_4_starting_origin_hosts ] + then + if [ $n_involved -ne 0 ] + then + grep " cers_4_starting_origin_hosts + for oh in `cat cers_4_starting_origin_hosts` + do + cer_file=cer.${oh}.xml + touch $cer_file + echo "WARNING: perhaps you should configure '$cer_file' because it is missing in the pcap file provided." + echo " Currently it contains a basic template but you must fill/fix the unknowns '$WHAT'." + cat << EOF > $cer_file @@ -293,25 +301,25 @@ then EOF - done - #else - # echo "WARNING: No 'sendxml' primitives on testcase ??" + done + #else + # echo "WARNING: No 'sendxml' primitives on testcase ??" + fi fi -fi -# PCAPs without CEA messages ... -if [ ! -s ceas_4_establishing_origin_hosts ] -then - if [ $n_involved -ne 0 ] - then - grep " ceas_4_establishing_origin_hosts - for oh in `cat ceas_4_establishing_origin_hosts` - do - cea_file=cea.${oh}.xml - touch $cea_file - echo "WARNING: perhaps you should configure '$cea_file' because it is missing in the pcap file provided." - echo " Currently it contains a basic template but you must fill/fix the unknowns '$WHAT'." - cat << EOF > $cea_file + # PCAPs without CEA messages ... + if [ ! -s ceas_4_establishing_origin_hosts ] + then + if [ $n_involved -ne 0 ] + then + grep " ceas_4_establishing_origin_hosts + for oh in `cat ceas_4_establishing_origin_hosts` + do + cea_file=cea.${oh}.xml + touch $cea_file + echo "WARNING: perhaps you should configure '$cea_file' because it is missing in the pcap file provided." + echo " Currently it contains a basic template but you must fill/fix the unknowns '$WHAT'." + cat << EOF > $cea_file @@ -334,9 +342,10 @@ then EOF - done - #else - # echo "WARNING: No 'sendxml' primitives on testcase ??" + done + #else + # echo "WARNING: No 'sendxml' primitives on testcase ??" + fi fi fi -- 2.20.1