Changeset 7adbcd7 in mod_gnutls


Ignore:
Timestamp:
Jul 2, 2015, 12:07:44 PM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
6ce02e2
Parents:
ae38a49
Message:

Test suite: Wait loop for MSVA startup

Until now, there was a fixed wait time for MSVA startup. This caused one
of two problems: Either the wait time was short, risiking a test failure
due to MSVA not being ready in time, or it was long, making test runs
slow. Waiting just a short time but retrying for a longer time if
necessary helps.

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/TestMakefile

    rae38a49 r7adbcd7  
    1717export MSVA_PORT ?= 9933
    1818
    19 export TEST_GAP ?= 1.5
     19export TEST_GAP ?= 0.4
     20export TEST_MSVA_MAX_WAIT ?= 10
    2021export TEST_QUERY_DELAY ?= 30
    2122
  • test/runtests

    rae38a49 r7adbcd7  
    116116    trap stop_msva EXIT
    117117
    118     sleep "$TEST_GAP"
    119 
    120118    printf "TESTING: initial MSVA verification\n"
    121     MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" msva-query-agent https "$(cat client.uid)" x509pem client < client/x509.pem
    122     printf "\nSUCCESS: initial MSVA verification\n"
     119    # set to 0 if MSVA is up
     120    ret=1
     121    export MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT"
     122    # wait at most TEST_MSVA_MAX_WAIT seconds for MSVA to get ready
     123    waited=0.0
     124    until [ ${ret} -eq 0 ] \
     125              || [ $(echo "${waited} > ${TEST_MSVA_MAX_WAIT}" | bc) -eq 1 ]; do
     126        if msva-query-agent https "$(cat client.uid)" x509pem client < client/x509.pem
     127        then
     128            ret=0
     129        else
     130            echo "MSVA not ready yet"
     131        fi
     132        sleep "${TEST_GAP}"
     133        waited=$(echo "${waited} + ${TEST_GAP}" | bc)
     134    done
     135
     136    # check if MSVA is up, fail if not
     137    if [ ${ret} -eq 0 ]; then
     138        printf "\nSUCCESS: initial MSVA verification\n"
     139    else
     140        printf "\nFAIL: initial MSVA verification\n"
     141        exit 1
     142    fi
    123143fi
    124144
Note: See TracChangeset for help on using the changeset viewer.