| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | # This is a generic script for firing up a server, waiting for it to write
|
|---|
| 4 | # its stringified IOR to a file, then firing up a server
|
|---|
| 5 |
|
|---|
| 6 | if test "z$ORBIT_TMPDIR" = "z"; then
|
|---|
| 7 | ORBIT_TMPDIR="/tmp/orbit-$USER/tst"
|
|---|
| 8 | rm -Rf $ORBIT_TMPDIR
|
|---|
| 9 | mkdir -p $ORBIT_TMPDIR
|
|---|
| 10 | fi
|
|---|
| 11 | TMPDIR=$ORBIT_TMPDIR;
|
|---|
| 12 | export TMPDIR;
|
|---|
| 13 |
|
|---|
| 14 | # 100: socket path max - Posix.1g
|
|---|
| 15 | SAMPLE_NAME="$ORBIT_TMPDIR/orbit-$USER/linc-78fe-0-14c0fc671d5b4";
|
|---|
| 16 | echo "Sample name: '$SAMPLE_NAME'"
|
|---|
| 17 | if (test ${#SAMPLE_NAME} -gt 100); then
|
|---|
| 18 | echo "Socket directory path '$ORBIT_TMPDIR' too long for bind";
|
|---|
| 19 | exit 1;
|
|---|
| 20 | else
|
|---|
| 21 | echo "Running with socketdir: '$ORBIT_TMPDIR'";
|
|---|
| 22 | fi
|
|---|
| 23 |
|
|---|
| 24 | run_test() {
|
|---|
| 25 |
|
|---|
| 26 | echo testing with $1
|
|---|
| 27 |
|
|---|
| 28 | ./server $1 &
|
|---|
| 29 |
|
|---|
| 30 | until test -s iorfile; do sleep 1; done
|
|---|
| 31 |
|
|---|
| 32 | if ./client $1; then
|
|---|
| 33 | echo "============================================================="
|
|---|
| 34 | echo "Test passed with params: $1"
|
|---|
| 35 | echo "============================================================="
|
|---|
| 36 | rm iorfile
|
|---|
| 37 | else
|
|---|
| 38 | echo "============================================================="
|
|---|
| 39 | echo "Test failed with params: $1"
|
|---|
| 40 | echo " if this is an IPv4 test, can you ping `hostname` ?"
|
|---|
| 41 | echo "============================================================="
|
|---|
| 42 | kill $!
|
|---|
| 43 | test x"$DONT_EXIT" = x && exit 1
|
|---|
| 44 | rm iorfile
|
|---|
| 45 | fi
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | for params in '--ORBIIOPIPv4=1 --ORBIIOPUSock=0 --ORBCorbaloc=1' \
|
|---|
| 49 | '--ORBIIOPIPv4=1 --ORBIIOPUSock=0 --thread-tests' \
|
|---|
| 50 | '--ORBIIOPIPv4=1 --ORBIIOPUSock=0' \
|
|---|
| 51 | '--ORBIIOPIPv4=1 --ORBIIOPUSock=0 --thread-safe' \
|
|---|
| 52 | '--ORBIIOPIPv4=1 --ORBIIOPUSock=0 --gen-imodule'
|
|---|
| 53 | do
|
|---|
| 54 |
|
|---|
| 55 | run_test "$params"
|
|---|
| 56 | done
|
|---|
| 57 |
|
|---|
| 58 | # Don't run the Unix domain socket tests on Windows
|
|---|
| 59 | if test x"$WINDIR" = x; then
|
|---|
| 60 | for params in '--ORBIIOPIPv4=0 --ORBIIOPUSock=1 --ORBCorbaloc=1' \
|
|---|
| 61 | '--ORBIIOPIPv4=0 --ORBIIOPUSock=1 --thread-tests' \
|
|---|
| 62 | '--ORBIIOPIPv4=0 --ORBIIOPUSock=1' \
|
|---|
| 63 | '--ORBIIOPIPv4=0 --ORBIIOPUSock=1 --thread-safe' \
|
|---|
| 64 | '--ORBIIOPIPv4=0 --ORBIIOPUSock=1 --gen-imodule'
|
|---|
| 65 | do
|
|---|
| 66 |
|
|---|
| 67 | run_test "$params"
|
|---|
| 68 | done
|
|---|
| 69 | fi
|
|---|