File tree Expand file tree Collapse file tree
minimal-examples-lowlevel/http-client/minimal-http-client-multi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,13 +106,16 @@ endif()
106106 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} /minimal-examples-lowlevel/http-server/minimal-http-server-tls
107107 FIXTURES_SETUP hcm_srv
108108 TIMEOUT 800 )
109+ set_property (TEST st_hcm_srv PROPERTY ENVIRONMENT SAI_LIST_PORT=${PORT_HCM_SRV} )
109110 set_tests_properties (ki_hcm_srv PROPERTIES
110111 FIXTURES_CLEANUP hcm_srv )
111112
112113 set_tests_properties (st_hcmp_srv PROPERTIES
113114 WORKING_DIRECTORY .
114115 FIXTURES_SETUP hcmp_srv
115116 TIMEOUT 800 )
117+ set_property (TEST st_hcmp_srv PROPERTY ENVIRONMENT SAI_LIST_PORT=1${PORT_HCM_SRV} )
118+
116119 set_tests_properties (ki_hcmp_srv PROPERTIES
117120 FIXTURES_CLEANUP hcmp_srv )
118121
Original file line number Diff line number Diff line change 11#! /bin/bash
22#
3+ # $SAI_LIST_PORT - optional, if present the ipv4 port number to wait on existing
34# $SAI_INSTANCE_IDX - which instance of sai, 0+
45# $1 - background fixture name, unique within test space, like "multipostlocalserver"
56# $2 - executable
89J=` basename $2 ` .$1 .$SAI_INSTANCE_IDX
910$2 $3 $4 $5 $6 $7 $8 $9 2> /tmp/ctest-background-$J 1> /dev/null 0< /dev/null &
1011echo $! > /tmp/sai-ctest-$J
12+
1113# really we want to loop until the listen port is up
1214# on, eg, rpi it can be blocked at sd card and slow to start
1315# due to parallel tests and disc cache flush
14- if [ ! -z " ` echo $2 | grep valgrind` " ] ; then
15- sleep 5
16+
17+ # echo "runscript SAI_LIST_PORT ${SAI_LIST_PORT}" > /tmp/q
18+
19+ if [ -z " ${SAI_LIST_PORT} " ] ; then
20+
21+ if [ ! -z " ` echo $2 | grep valgrind` " ] ; then
22+ sleep 5
23+ else
24+ sleep 1
25+ fi
1626else
17- sleep 1
27+ if [ " $VENDOR " = " apple" ] ; then
28+ while [ -z " ` netstat -an | grep LISTEN | tr -s ' ' | cut -d' ' -f4| grep " \.${SAI_LIST_PORT} \$ " ` " ] ; do
29+ sleep 0.5
30+ done
31+ else
32+ while [ -z " ` netstat -ltn4 | grep LISTEN | tr -s ' ' | grep " :${SAI_LIST_PORT} \ " ` " ] ; do
33+ sleep 0.5
34+ done
35+ fi
1836fi
37+
1938exit 0
2039
You can’t perform that action at this time.
0 commit comments