Skip to content
Snippets Groups Projects
Commit f231a98f authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Finalized integration test when running against arbitrary network

parent b33675d6
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,17 @@ rm server-5.qdrep || true ...@@ -12,6 +12,17 @@ rm server-5.qdrep || true
mkdir -p .elixxir mkdir -p .elixxir
if [ $# -gt 1 ]
then
echo "usage: $0 [permsip:port]"
exit
fi
PERMISSIONING=$1
#export GRPC_GO_LOG_VERBOSITY_LEVEL=99 #export GRPC_GO_LOG_VERBOSITY_LEVEL=99
#export GRPC_GO_LOG_SEVERITY_LEVEL=info #export GRPC_GO_LOG_SEVERITY_LEVEL=info
...@@ -22,14 +33,16 @@ DUMMYOUT=results/dummy-console.txt ...@@ -22,14 +33,16 @@ DUMMYOUT=results/dummy-console.txt
UDBOUT=results/udb-console.txt UDBOUT=results/udb-console.txt
CLIENTCLEAN=results/clients-cleaned CLIENTCLEAN=results/clients-cleaned
CLIENTOPTS="--password hello --ndf ndf.json --waitTimeout 90 --unsafe-channel-creation --verbose" CLIENTOPTS="--password hello --ndf results/ndf.json --waitTimeout 90 --unsafe-channel-creation --verbose"
CLIENTUDOPTS="--password hello --ndf ndf.json --verbose" CLIENTUDOPTS="--password hello --ndf results/ndf.json --verbose"
mkdir -p $SERVERLOGS mkdir -p $SERVERLOGS
mkdir -p $GATEWAYLOGS mkdir -p $GATEWAYLOGS
mkdir -p $CLIENTOUT mkdir -p $CLIENTOUT
mkdir -p $CLIENTCLEAN mkdir -p $CLIENTCLEAN
if [ "$PERMISSIONING" == "" ]
then
echo "STARTING SERVERS..." echo "STARTING SERVERS..."
UDBID=$(../bin/client init -s results/udbsession -l results/udbidgen.log --password hello --ndf ndf.json) UDBID=$(../bin/client init -s results/udbsession -l results/udbidgen.log --password hello --ndf ndf.json)
...@@ -110,8 +123,6 @@ while [ ! -s rid.txt ] && [ $cnt -lt 120 ]; do ...@@ -110,8 +123,6 @@ while [ ! -s rid.txt ] && [ $cnt -lt 120 ]; do
echo -n "." echo -n "."
done done
echo "DONE LETS DO STUFF"
# Start a user discovery bot server # Start a user discovery bot server
echo "STARTING UDB..." echo "STARTING UDB..."
UDBCMD="../bin/udb --logLevel 3 --config udb.yaml -l 1 --devMode" UDBCMD="../bin/udb --logLevel 3 --config udb.yaml -l 1 --devMode"
...@@ -119,7 +130,6 @@ $UDBCMD >> $UDBOUT 2>&1 & ...@@ -119,7 +130,6 @@ $UDBCMD >> $UDBOUT 2>&1 &
PIDVAL=$! PIDVAL=$!
echo $PIDVAL >> results/serverpids echo $PIDVAL >> results/serverpids
echo "$UDBCMD -- $PIDVAL" echo "$UDBCMD -- $PIDVAL"
rm rid.txt || true rm rid.txt || true
while [ ! -s rid.txt ] && [ $cnt -lt 30 ]; do while [ ! -s rid.txt ] && [ $cnt -lt 30 ]; do
sleep 1 sleep 1
...@@ -128,7 +138,26 @@ while [ ! -s rid.txt ] && [ $cnt -lt 30 ]; do ...@@ -128,7 +138,26 @@ while [ ! -s rid.txt ] && [ $cnt -lt 30 ]; do
echo -n "." echo -n "."
done done
# sleep 5 echo "localhost:18000" > results/permserver.txt
echo "DONE LETS DO STUFF"
else
echo "Connecting to network defined at $PERMISSIONING"
echo $PERMISSIONING > results/permserver.txt
fi
echo "DOWNLOADING TLS Cert..."
openssl s_client -showcerts -connect $(cat results/permserver.txt) < /dev/null 2>&1 | openssl x509 -outform PEM > results/permcert.pem
echo "DOWNLOADING NDF..."
CLIENTCMD="../bin/client getndf --permhost $(cat results/permserver.txt) --cert results/permcert.pem"
eval $CLIENTCMD >> results/ndf.json 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
cat results/ndf.json | jq . | head -5
echo "RUNNING CLIENTS..."
runclients() { runclients() {
echo "Starting clients..." echo "Starting clients..."
...@@ -164,6 +193,10 @@ runclients() { ...@@ -164,6 +193,10 @@ runclients() {
done done
} }
if [ "$PERMISSIONING" == "" ]
then
echo "RUNNING BASIC CLIENTS..." echo "RUNNING BASIC CLIENTS..."
runclients runclients
echo "RUNNING BASIC CLIENTS (2nd time)..." echo "RUNNING BASIC CLIENTS (2nd time)..."
...@@ -209,7 +242,7 @@ eval $CLIENTCMD >> $CLIENTOUT/client9_rekey.txt 2>&1 || true & ...@@ -209,7 +242,7 @@ eval $CLIENTCMD >> $CLIENTOUT/client9_rekey.txt 2>&1 || true &
PIDVAL=$! PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL" echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL || true wait $PIDVAL || true
fi
# Non-precanned E2E user messaging # Non-precanned E2E user messaging
echo "SENDING E2E MESSAGES TO NEW USERS..." echo "SENDING E2E MESSAGES TO NEW USERS..."
...@@ -253,6 +286,8 @@ wait $PIDVAL ...@@ -253,6 +286,8 @@ wait $PIDVAL
wait $PIDVAL2 wait $PIDVAL2
if [ "$PERMISSIONING" == "" ]
then
# UD Test # UD Test
echo "TESTING USER DISCOVERY..." echo "TESTING USER DISCOVERY..."
CLIENTCMD="timeout 240s ../bin/client ud $CLIENTUDOPTS -l $CLIENTOUT/client13.log -s blob13 --register josh13 --addemail josh13@elixxir.io --addphone 6178675309US" CLIENTCMD="timeout 240s ../bin/client ud $CLIENTUDOPTS -l $CLIENTOUT/client13.log -s blob13 --register josh13 --addemail josh13@elixxir.io --addphone 6178675309US"
...@@ -293,6 +328,7 @@ PIDVAL2=$! ...@@ -293,6 +328,7 @@ PIDVAL2=$!
echo "$CLIENTCMD -- $PIDVAL" echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL wait $PIDVAL
wait $PIDVAL2 wait $PIDVAL2
fi
cp $CLIENTOUT/*.txt $CLIENTCLEAN/ cp $CLIENTOUT/*.txt $CLIENTCLEAN/
...@@ -312,7 +348,13 @@ set -e ...@@ -312,7 +348,13 @@ set -e
echo "TESTS EXITED SUCCESSFULLY, CHECKING OUTPUT..." echo "TESTS EXITED SUCCESSFULLY, CHECKING OUTPUT..."
set +x set +x
diff -aruN clients.goldoutput $CLIENTCLEAN for C in $(ls -1 $CLIENTCLEAN)
do
diff -auN clients.goldoutput/$C $CLIENTCLEAN/$C
done
if [ "$PERMISSIONING" == "" ]
then
#cat $CLIENTOUT/* | strings | grep -e "ERROR" -e "FATAL" > results/client-errors || true #cat $CLIENTOUT/* | strings | grep -e "ERROR" -e "FATAL" > results/client-errors || true
#diff -ruN results/client-errors.txt noerrors.txt #diff -ruN results/client-errors.txt noerrors.txt
...@@ -326,5 +368,6 @@ IGNOREMSG="GetRoundBufferInfo: Error received: rpc error: code = Unknown desc = ...@@ -326,5 +368,6 @@ IGNOREMSG="GetRoundBufferInfo: Error received: rpc error: code = Unknown desc =
cat $GATEWAYLOGS/*.log | grep -a "ERROR" | grep -av "context" | grep -av "certificate" | grep -av "Failed to read key" | grep -av "$IGNOREMSG" > results/gateway-errors.txt || true cat $GATEWAYLOGS/*.log | grep -a "ERROR" | grep -av "context" | grep -av "certificate" | grep -av "Failed to read key" | grep -av "$IGNOREMSG" > results/gateway-errors.txt || true
cat $GATEWAYLOGS/*.log | grep -a "FATAL" | grep -av "context" | grep -av "transport is closing" >> results/gateway-errors.txt || true cat $GATEWAYLOGS/*.log | grep -a "FATAL" | grep -av "context" | grep -av "transport is closing" >> results/gateway-errors.txt || true
diff -aruN results/gateway-errors.txt noerrors.txt diff -aruN results/gateway-errors.txt noerrors.txt
fi
echo "NO OUTPUT ERRORS, SUCCESS!" echo "NO OUTPUT ERRORS, SUCCESS!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment