~ubuntu-branches/ubuntu/vivid/sflphone/vivid

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/third_party/srtp/test/rtpw_test.sh

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# usage: rtpw_test <rtpw_commands>
 
4
#
 
5
# tests the rtpw sender and receiver functions
 
6
 
 
7
RTPW=rtpw
 
8
DEST_PORT=9999
 
9
DURATION=3
 
10
 
 
11
key=2b2edc5034f61a72345ca5986d7bfd0189aa6dc2ecab32fd9af74df6dfc6
 
12
 
 
13
ARGS="-k $key -ae"
 
14
 
 
15
# First, we run "killall" to get rid of all existing rtpw processes.
 
16
# This step also enables this script to clean up after itself; if this
 
17
# script is interrupted after the rtpw processes are started but before
 
18
# they are killed, those processes will linger.  Re-running the script
 
19
# will get rid of them.
 
20
 
 
21
killall rtpw 2&>/dev/null
 
22
 
 
23
if test -x $RTPW; then
 
24
 
 
25
echo  $0 ": starting rtpw receiver process... "
 
26
 
 
27
$RTPW $* $ARGS -r 0.0.0.0 $DEST_PORT  &
 
28
 
 
29
receiver_pid=$!
 
30
 
 
31
echo $0 ": receiver PID = $receiver_pid"
 
32
 
 
33
sleep 1
 
34
 
 
35
# verify that the background job is running
 
36
ps | grep -q $receiver_pid
 
37
retval=$?
 
38
echo $retval
 
39
if [ $retval != 0 ]; then
 
40
    echo $0 ": error"
 
41
    exit 254
 
42
fi
 
43
 
 
44
echo  $0 ": starting rtpw sender process..."
 
45
 
 
46
$RTPW $* $ARGS -s 127.0.0.1 $DEST_PORT  &
 
47
 
 
48
sender_pid=$!
 
49
 
 
50
echo $0 ": sender PID = $sender_pid"
 
51
 
 
52
# verify that the background job is running
 
53
ps | grep -q $sender_pid
 
54
retval=$?
 
55
echo $retval
 
56
if [ $retval != 0 ]; then
 
57
    echo $0 ": error"
 
58
    exit 255
 
59
fi
 
60
 
 
61
sleep $DURATION
 
62
 
 
63
kill $receiver_pid
 
64
kill $sender_pid
 
65
 
 
66
echo $0 ": done (test passed)"
 
67
 
 
68
else
 
69
 
 
70
echo "error: can't find executable" $RTPW
 
71
exit 1
 
72
 
 
73
fi
 
74
 
 
75
# EOF