Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration


File:  [GForge:cvsroot/nutss] / libnutss / examples / swptest
Revision 1.3: download - view: text, annotated - select for diffs
Fri May 25 21:12:23 2007 UTC (10 years, 4 months ago) by ths
Branches: MAIN
CVS tags: HEAD
fixed some major bugs in swaplinks... also did some work on the new slinks test.

#!/bin/bash

trap "killall lt-nutssd lt-slinkapp" SIGINT SIGTERM

if [ "$#" == "0" ]; then
    echo -e "Usage:\n  swptest num"
    exit 0
fi

if [ ! -x "./slinkapp" -o ! -x "./nutssd" ]; then
    echo "Cannot file slinkapp and nutssd."
    echo "The test must be run from the libnutss/example directory"
    exit 0
fi

mkdir -p output

./nutssd -stwn -r sip.nutss.net:5060 -p ths1 ths1@nutss.net >output/debug_registrar.txt 2>&1 &

for i in $(seq 1 $1); do
    ./slinkapp $i 2>&1 | tee output/debug_node$i.txt | grep SWLOG | tee output/swlog_node$i.txt |
        grep 'DEGREE.*}$' | sed 's/@[^,} ]*//g' | sed 's/<sip:test/node/g' >output/degree_node$i.txt &
done

watch "cat output/output_node* |
awk '
{
    if (\$2 == \"RCVD\" && \$3 == \"REQUEST\") {
        a[\$1,\$7]++;
        s[\$1]++;
        e[\$7]++;
    }
}
END {
    printf \"R\\\\S\\t\";
    for(n in s)
        printf n\"\\t\";
    printf \"\\n\";
    for(n in s) {
        printf n\"\\t\";
        for(m in s)
            printf a[n,m]\"\\t\";
        printf \"\\t\"s[n]\"\\n\";
    }
    printf \"\\n\\t\";
    for(n in s)
        printf e[n]\"\\t\";
    printf \"\\n\"
}';
echo;
ls output/degree_node*.txt |
while read i; do
    tail -n2 \$i | head -n1 | awk '{print \$3\" \"\$5\" \"\$6\"\\t\"\$7;}';
done;
"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment