view doc/DTLS.testbed.txt @ 1231:8608085d7b0d default tip

Add notice about running the DTLS tests
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 20 Jun 2013 11:11:28 +0800
parents
children
line wrap: on
line source

# Provide the path to your GnuTLS 3.x implementation
GNUTLS_3_INC_PATH=/home/thedoc/sources/gnutls-latest/lib/includes
GNUTLS_3_LIB_PATH=/home/thedoc/sources/gnutls-latest/lib/.libs/


# (re)create the folder for the binaries
rm -rf test.build
mkdir test.build
cd test.build 

# Generate certificates for the test.
bash ../doc/single_host/make_certs.sh


# Configure freeDiameter to use specific GNU TLS version (adapt path)
cmake .. -DGNUTLS_INCLUDE_DIR:PATH=$GNUTLS_3_INC_PATH	\
         -DGNUTLS_LIBRARY:FILEPATH=$GNUTLS_3_LIB_PATH/libgnutls.so \
	 -DBUILD_TEST_APP:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Debug
	
# Build freeDiameter
make


# Create the configuration files for the DTLS test


##  freeDiameter.conf for the first peer
cat > freeDiameter-1.conf << EOF
Identity = "peer1.localdomain";
Realm = "localdomain";
Port=0;
No_TCP;
TLS_Cred = "peer1.cert.pem",
           "peer1.key.pem";
TLS_CA = "cacert.pem";
LoadExtension="extensions/test_app.fdx":"test_app.conf";
ConnectPeer = "peer2.localdomain" { ConnectTo = "127.0.0.1"; port = 50658; };
EOF

## test_app extension configuration
cat > test_app.conf << EOF
long-avp-id=12345;
long-avp-len=20000;
mixedsizes;
EOF

##  freeDiameter.conf for the second peer
cat > freeDiameter-2.conf << EOF
Identity = "peer2.localdomain";
Realm = "localdomain";
Port=0;
SecPort=50658;
No_TCP;
TLS_Cred = "peer2.cert.pem",
           "peer2.key.pem";
TLS_CA = "cacert.pem";
LoadExtension="extensions/test_app.fdx":"test_app.conf";
ConnectPeer = "peer1.localdomain" { ConnectTo = "127.0.0.1"; port = 5658; };
EOF



# Run the two instances with these configuration files (in two different terminals):
./freeDiameterd/freeDiameterd -c freeDiameter-1.conf
./freeDiameterd/freeDiameterd -c freeDiameter-2.conf

# once both instances are running, they will connect and exchange a few DWR/DWA messages periodically.
# You can trigger additional exchanges by sending signal 10 to one of those instances. 
# You can adjust the length of the payload exchanged by editing the "long-avp-len" parameter in file test_app.conf.
kill -10 `ps --no-heading -C freeDiameterd -o '%p'`


# You can activate the GNUTLS traces using:
./freeDiameterd/freeDiameterd -c freeDiameter-1.conf --dbg_gnutls 8

# You can also activate the libfdcore/sctp_dtls.c traces using:
./freeDiameterd/freeDiameterd -dd -c freeDiameter-1.conf --dbg_file sctp_dtls.c --dbg_gnutls 8
./freeDiameterd/freeDiameterd -dd -c freeDiameter-2.conf --dbg_file sctp_dtls.c --dbg_gnutls 8

"Welcome to our mercurial repository"