Changeset a61edfd in mod_gnutls


Ignore:
Timestamp:
Nov 5, 2015, 6:41:41 PM (2 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
master, debian, jessie-backports, upstream
Children:
02a6a18
Parents:
83b3901
Message:

Manage MSVA start up wait time in milliseconds

Using milliseconds avoids floating point arithmetic, so everything can
be done in bash instead of calling "bc". This avoids a dependency, and
is probably a little faster, too (though the latter doesn't really
matter).

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/Makefile.am

    rfc8e463 ra61edfd  
    134134# port for MSVA in test cases that use it
    135135MSVA_PORT ?= 9933
    136 # maximum time to wait for MSVA startup
    137 TEST_MSVA_MAX_WAIT ?= 10
    138 # wait loop time for MSVA startup
    139 TEST_MSVA_WAIT ?= 0.4
     136# maximum time to wait for MSVA startup (milliseconds)
     137TEST_MSVA_MAX_WAIT ?= 10000
     138# wait loop time for MSVA startup (milliseconds)
     139TEST_MSVA_WAIT ?= 400
    140140# seconds for the HTTP request to be sent and responded to
    141141TEST_QUERY_DELAY ?= 30
  • test/runtests

    r34e5dc7 ra61edfd  
    124124    ret=1
    125125    export MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT"
    126     # wait at most TEST_MSVA_MAX_WAIT seconds for MSVA to get ready
    127     waited=0.0
     126
     127    # convert TEST_MSVA_WAIT to seconds because that's what "sleep" expects
     128    TEST_MSVA_SLEEP="$((${TEST_MSVA_WAIT} / 1000)).$((${TEST_MSVA_WAIT} % 1000))"
     129    # wait at most TEST_MSVA_MAX_WAIT milliseconds for MSVA to get ready
     130    waited=0
    128131    until [ ${ret} -eq 0 ] \
    129               || [ $(echo "${waited} > ${TEST_MSVA_MAX_WAIT}" | bc) -eq 1 ]; do
     132              || [ ${waited} -ge ${TEST_MSVA_MAX_WAIT} ]; do
    130133        if msva-query-agent https "$(cat client.uid)" x509pem client < client/x509.pem
    131134        then
     
    134137            echo "MSVA not ready yet"
    135138        fi
    136         sleep "${TEST_MSVA_WAIT}"
    137         waited=$(echo "${waited} + ${TEST_MSVA_WAIT}" | bc)
     139        sleep "${TEST_MSVA_SLEEP}"
     140        waited=$((${waited} + ${TEST_MSVA_WAIT}))
    138141    done
    139142
Note: See TracChangeset for help on using the changeset viewer.