xref: /curl/tests/ech_tests.sh (revision 57af812e)
1#!/bin/bash
2#***************************************************************************
3#                                  _   _ ____  _
4#  Project                     ___| | | |  _ \| |
5#                             / __| | | | |_) | |
6#                            | (__| |_| |  _ <| |___
7#                             \___|\___/|_| \_\_____|
8#
9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22# SPDX-License-Identifier: curl
23#
24###########################################################################
25#
26
27# Run some tests against servers we know to support ECH (CF, defo.ie, etc.).
28# as well as some we know don't do ECH but have an HTTPS RR, and finally some
29# for which neither is the case.
30
31# TODO: Translate this into something that approximates a valid curl test:-)
32# Should be useful though even before such translation and a pile less work
33# to do this than that.  The pile of work required would include making an
34# ECH-enabled server and a DoH server. For now, this is just run manually.
35#
36
37# set -x
38
39# Exit with an error if there's an active ech stanza in ~/.curlrc
40# as that'd likely skew some results (e.g. turning a fail into a
41# success or vice versa)
42: "${CURL_CFG_FILE=$HOME/.curlrc}"
43active_ech=$(grep ech "$CURL_CFG_FILE" | grep -v "#.*ech")
44if [[ "$active_ech" != "" ]]
45then
46    echo "You seem to have an active ECH setting in $CURL_CFG_FILE"
47    echo "That might affect results so please remove that or comment"
48    echo "it out - exiting."
49    exit 1
50fi
51
52
53# Targets we expect to be ECH-enabled servers
54# for which an HTTPS RR is published.
55# structure is host:port mapped to pathname
56# TODO: add negative tests for these
57declare -A ech_targets=(
58    [my-own.net]="ech-check.php"
59    [my-own.net:8443]="ech-check.php"
60    [defo.ie]="ech-check.php"
61    [cover.defo.ie]=""
62    [draft-13.esni.defo.ie:8413]="stats"
63    [draft-13.esni.defo.ie:8414]="stats"
64    [draft-13.esni.defo.ie:9413]=""
65    [draft-13.esni.defo.ie:10413]=""
66    [draft-13.esni.defo.ie:11413]=""
67    [draft-13.esni.defo.ie:12413]=""
68    [draft-13.esni.defo.ie:12414]=""
69    [crypto.cloudflare.com]="cdn-cgi/trace"
70    [tls-ech.dev]=""
71    [epochbelt.com]=""
72)
73
74# Targets we expect not to be ECH-enabled servers
75# but for which an HTTPS RR is published.
76declare -A httpsrr_targets=(
77    [ietf.org]=""
78    [rte.ie]=""
79)
80
81# Targets we expect not to be ECH-enabled servers
82# and for which no HTTPS RR is published.
83declare -A neither_targets=(
84    [www.tcd.ie]=""
85    [jell.ie]=""
86)
87
88#
89# Variables that can be over-ridden from environment
90#
91
92# Top of curl test tree, assume we're there
93: "${CTOP:=.}"
94
95# Plase to put test log output
96: "${LTOP:=$CTOP/tests/ech-log/}"
97
98# place to stash outputs when things go wrong
99: "${BTOP:=$LTOP}"
100
101# time to wait for a remote access to work, 10 seconds
102: "${tout:=10s}"
103
104# Where we find OpenSSL .so's
105: "${OSSL:=$HOME/code/openssl}"
106
107# Where we find WolfSSL .so's
108: "${WSSL:=$HOME/code/wolfssl/inst/lib}"
109
110# Where we find boringssl .so's
111: "${BSSL:=$HOME/code/boringssl/inst/lib}"
112
113# Where we send DoH queries when using kdig or curl
114: "${DOHSERVER:=one.one.one.one}"
115: "${DOHPATH:=dns-query}"
116
117# Whether to send mail when bad things happen (mostly for cronjob)
118: "${DOMAIL:=no}"
119
120# Misc vars and functions
121
122DEFPORT=443
123
124function whenisitagain()
125{
126    /bin/date -u +%Y%m%d-%H%M%S
127}
128
129function fileage()
130{
131    echo $(($(date +%s) - $(date +%s -r "$1")))
132}
133
134function hostport2host()
135{
136    case $1 in
137      *:*) host=${1%:*} port=${1##*:};;
138        *) host=$1      port=$DEFPORT;;
139    esac
140    echo "$host"
141}
142
143function hostport2port()
144{
145    case $1 in
146      *:*) host=${1%:*} port=${1##*:};;
147        *) host=$1      port=$DEFPORT;;
148    esac
149    echo "$port"
150}
151
152function cli_test()
153{
154    # 1st param is target URL
155    turl=$1
156    # 2nd param is 0 if we expect curl to not work or 1 if we expect it
157    # to have worked
158    curl_winorlose=$2
159    # 3rd param is 0 if we expect ECH to not work or 1 if we expect it
160    # to have worked
161    ech_winorlose=$3
162    # remaining params are passed to command line
163    # echparms=(${@:4})
164    IFS=" " read -r -a echparms <<< "${@:4}"
165
166    TMPF=$(mktemp)
167    cmd="timeout $tout $CURL ${CURL_PARAMS[*]} ${echparms[*]} $turl >$TMPF 2>&1"
168    echo "cli_test: $cmd " >> "$logfile"
169    timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" "${echparms[@]}" "$turl" >"$TMPF" 2>&1
170    eres=$?
171    if [[ "$eres" == "124" ]]
172    then
173        allgood="no"
174        echo "cli_test: Timeout running $cmd"
175        cat "$TMPF" >> "$logfile"
176        echo "cli_test: Timeout running $cmd" >> "$logfile"
177    fi
178    if [[ "$eres" != "0" && "$curl_winorlose" == "1" ]]
179    then
180        allgood="no"
181        echo "cli_test: curl failure running $cmd"
182        cat "$TMPF" >> "$logfile"
183        echo "cli_test: curl failure running $cmd" >> "$logfile"
184    fi
185    ech_success=$(grep -c "ECH: result: status is succeeded" "$TMPF")
186    if [[ "$ech_success" == "$ech_winorlose" ]]
187    then
188        echo "cli_test ok for ${echparms[*]}"
189    else
190        allgood="no"
191        echo "cli_test: ECH failure running $cmd"
192        cat "$TMPF" >> "$logfile"
193        echo "cli_test: ECH failure running $cmd" >> "$logfile"
194    fi
195    rm -f "$TMPF"
196}
197
198function get_ech_configlist()
199{
200    domain=$1
201    ecl=$(dig +short https "$domain" | grep "ech=" | sed -e 's/^.*ech=//' | sed -e 's/ .*//')
202    echo "$ecl"
203}
204
205# start of main script
206
207# start by assuming we have nothing we need...
208have_ossl="no"
209have_wolf="no"
210have_bssl="no"
211using_ossl="no"
212using_wolf="no"
213using_bssl="no"
214have_curl="no"
215have_dig="no"
216have_kdig="no"
217have_presout="no"
218have_portsblocked="no"
219
220# setup logging
221NOW=$(whenisitagain)
222BINNAME=$(basename "$0" .sh)
223if [ ! -d "$LTOP" ]
224then
225    mkdir -p "$LTOP"
226fi
227if [ ! -d "$LTOP" ]
228then
229    echo "Can't see $LTOP for logs - exiting"
230    exit 1
231fi
232logfile=$LTOP/${BINNAME}_$NOW.log
233
234echo "-----" > "$logfile"
235echo "Running $0 at $NOW"  >> "$logfile"
236echo "Running $0 at $NOW"
237
238# check we have the binaries needed and which TLS library we'll be using
239if [ -f "$OSSL"/libssl.so ]
240then
241    have_ossl="yes"
242fi
243if [ -f "$WSSL"/libwolfssl.so ]
244then
245    have_wolf="yes"
246fi
247if [ -f "$BSSL"/libssl.so ]
248then
249    have_bssl="yes"
250fi
251CURL="$CTOP/src/curl"
252CURL_PARAMS=(-vvv --doh-url https://one.one.one.one/dns-query)
253if [ -f "$CTOP"/src/curl ]
254then
255    have_curl="yes"
256fi
257ossl_cnt=$(LD_LIBRARY_PATH=$OSSL $CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c OpenSSL)
258if ((ossl_cnt == 1))
259then
260    using_ossl="yes"
261    # setup access to our .so
262    export LD_LIBRARY_PATH=$OSSL
263fi
264bssl_cnt=$(LD_LIBRARY_PATH=$BSSL $CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c BoringSSL)
265if ((bssl_cnt == 1))
266then
267    using_bssl="yes"
268    # setup access to our .so
269    export LD_LIBRARY_PATH=$BSSL
270fi
271wolf_cnt=$($CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c wolfSSL)
272if ((wolf_cnt == 1))
273then
274    using_wolf="yes"
275    # for some reason curl+wolfSSL dislikes certs that are ok
276    # for browsers, so we'll test using "insecure" mode (-k)
277    # but that's ok here as we're only interested in ECH testing
278    CURL_PARAMS+=(-k)
279fi
280# check if we have dig and it knows https or not
281digcmd="dig +short"
282wdig=$(type -p dig)
283if [[ "$wdig" != "" ]]
284then
285    have_dig="yes"
286fi
287wkdig=$(type -p kdig)
288if [[ "$wkdig" != "" ]]
289then
290    have_kdig="yes"
291    digcmd="kdig @$DOHSERVER +https +short"
292fi
293# see if our dig version knows HTTPS
294dout=$($digcmd https defo.ie)
295if [[ $dout != "1 . "* ]]
296then
297    dout=$($digcmd -t TYPE65 defo.ie)
298    if [[ $dout == "1 . "* ]]
299    then
300        # we're good
301        have_presout="yes"
302    fi
303else
304    have_presout="yes"
305fi
306
307# Check if ports other than 443 are blocked from this
308# vantage point (I run tests in a n/w where that's
309# sadly true sometimes;-)
310# echo "Checking if ports other than 443 are maybe blocked"
311not443testurl="https://draft-13.esni.defo.ie:9413/"
312timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" "$not443testurl" >/dev/null 2>&1
313eres=$?
314if [[ "$eres" == "124" ]]
315then
316    echo "Timeout running curl for $not443testurl" >> "$logfile"
317    echo "Timeout running curl for $not443testurl"
318    have_portsblocked="yes"
319fi
320
321{
322    echo "have_ossl: $have_ossl"
323    echo "have_wolf: $have_wolf"
324    echo "have_bssl: $have_bssl"
325    echo "using_ossl: $using_ossl"
326    echo "using_wolf: $using_wolf"
327    echo "using_bssl: $using_bssl"
328    echo "have_curl: $have_curl"
329    echo "have_dig: $have_dig"
330    echo "have_kdig: $have_kdig"
331    echo "have_presout: $have_presout"
332    echo "have_portsblocked: $have_portsblocked"
333} >> "$logfile"
334
335echo "curl: have $have_curl, cURL command: |$CURL ${CURL_PARAMS[*]}|"
336echo "ossl: have: $have_ossl, using: $using_ossl"
337echo "wolf: have: $have_wolf, using: $using_wolf"
338echo "bssl: have: $have_bssl, using: $using_bssl"
339echo "dig: $have_dig, kdig: $have_kdig, HTTPS pres format: $have_presout"
340echo "dig command: |$digcmd|"
341echo "ports != 443 blocked: $have_portsblocked"
342
343if [[ "$have_curl" == "no" ]]
344then
345    echo "Can't proceed without curl - exiting"
346    exit 32
347fi
348
349allgood="yes"
350
351skip="false"
352
353if [[ "$skip" != "true" ]]
354then
355
356# basic ECH good/bad
357for targ in "${!ech_targets[@]}"
358do
359    if [[ "$using_wolf" == "yes" ]]
360    then
361        case $targ in
362            "draft-13.esni.defo.ie:8414" | "tls-ech.dev" | \
363            "crypto.cloudflare.com" | "epochbelt.com")
364                echo "Skipping $targ 'cause wolf"; continue;;
365            *)
366                ;;
367        esac
368    fi
369    host=$(hostport2host "$targ")
370    port=$(hostport2port "$targ")
371    if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]]
372    then
373        echo "Skipping $targ as ports != 443 seem blocked"
374        continue
375    fi
376    path=${ech_targets[$targ]}
377    turl="https://$host:$port/$path"
378    echo "ECH check for $turl"
379    {
380        echo ""
381        echo "ECH check for $turl"
382    } >> "$logfile"
383    timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech hard "$turl" >> "$logfile" 2>&1
384    eres=$?
385    if [[ "$eres" == "124" ]]
386    then
387        allgood="no"
388        {
389            echo "Timeout for $turl"
390            echo -e "\tTimeout for $turl"
391            echo "Timeout running curl for $host:$port/$path"
392        } >> "$logfile"
393    fi
394    if [[ "$eres" != "0" ]]
395    then
396        allgood="no"
397        echo "Error ($eres) for $turl" >> "$logfile"
398        echo -e "\tError ($eres) for $turl"
399    fi
400    echo "" >> "$logfile"
401done
402
403# check if public_name override works (OpenSSL only)
404if [[ "$using_ossl" == "yes" ]]
405then
406    for targ in "${!ech_targets[@]}"
407    do
408        host=$(hostport2host "$targ")
409        port=$(hostport2port "$targ")
410        if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]]
411        then
412            echo "Skipping $targ as ports != 443 seem blocked"
413            continue
414        fi
415        path=${ech_targets[$targ]}
416        turl="https://$host:$port/$path"
417        echo "PN override check for $turl"
418        {
419            echo ""
420            echo "PN override check for $turl"
421        } >> "$logfile"
422        timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech pn:override --ech hard "$turl" >> "$logfile" 2>&1
423        eres=$?
424        if [[ "$eres" == "124" ]]
425        then
426            allgood="no"
427            {
428                echo "Timeout for $turl"
429                echo -e "\tTimeout for $turl"
430                echo "Timeout running curl for $host:$port/$path"
431            } >> "$logfile"
432        fi
433        if [[ "$eres" != "0" ]]
434        then
435            allgood="no"
436            echo "PN override Error ($eres) for $turl" >> "$logfile"
437            echo -e "\tPN override Error ($eres) for $turl"
438        fi
439        echo "" >> "$logfile"
440    done
441fi
442
443for targ in "${!httpsrr_targets[@]}"
444do
445    host=$(hostport2host "$targ")
446    port=$(hostport2port "$targ")
447    if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]]
448    then
449        echo "Skipping $targ as ports != 443 seem blocked"
450        continue
451    fi
452    path=${httpsrr_targets[$targ]}
453    turl="https://$host:$port/$path"
454    echo "HTTPS RR but no ECHConfig check for $turl"
455    {
456        echo ""
457        echo "HTTPS RR but no ECHConfig check for $turl"
458    } >> "$logfile"
459    timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech true "$turl" >> "$logfile" 2>&1
460    eres=$?
461    if [[ "$eres" == "124" ]]
462    then
463        allgood="no"
464        {
465            echo "Timeout for $turl"
466            echo -e "\tTimeout for $turl"
467            echo "Timeout running curl for $host:$port/$path"
468        } >> "$logfile"
469    fi
470    if [[ "$eres" != "0" ]]
471    then
472        allgood="no"
473        echo "Error ($eres) for $turl" >> "$logfile"
474        echo -e "\tError ($eres) for $turl"
475    fi
476    echo "" >> "$logfile"
477done
478
479for targ in "${!neither_targets[@]}"
480do
481    host=$(hostport2host "$targ")
482    port=$(hostport2port "$targ")
483    if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]]
484    then
485        echo "Skipping $targ as ports != 443 seem blocked"
486        continue
487    fi
488    path=${neither_targets[$targ]}
489    turl="https://$host:$port/$path"
490    echo "Neither HTTPS nor ECHConfig check for $turl"
491    {
492        echo ""
493        echo "Neither HTTPS nor ECHConfig check for $turl"
494    } >> "$logfile"
495    timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech true "$turl" >> "$logfile" 2>&1
496    eres=$?
497    if [[ "$eres" == "124" ]]
498    then
499        allgood="no"
500        {
501            echo "Timeout for $turl"
502            echo -e "\tTimeout for $turl"
503            echo "Timeout running curl for $host:$port/$path"
504        } >> "$logfile"
505    fi
506    if [[ "$eres" != "0" ]]
507    then
508        allgood="no"
509        echo "Error ($eres) for $turl" >> "$logfile"
510        echo -e "\tError ($eres) for $turl"
511    fi
512    echo "" >> "$logfile"
513done
514
515
516# Check various command line options, if we're good so far
517if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]]
518then
519    # use this test URL as it'll tell us if things worked
520    turl="https://defo.ie/ech-check.php"
521    echo "cli_test with $turl"
522    echo "cli_test with $turl" >> "$logfile"
523    cli_test "$turl" 1 1 --ech true
524    cli_test "$turl" 1 0 --ech false
525    cli_test "$turl" 1 1 --ech false --ech true
526    cli_test "$turl" 1 1 --ech false --ech true --ech pn:foobar
527    cli_test "$turl" 1 1 --ech false --ech pn:foobar --ech true
528    echconfiglist=$(get_ech_configlist defo.ie)
529    cli_test "$turl" 1 1 --ech ecl:"$echconfiglist"
530    cli_test "$turl" 1 0 --ech ecl:
531fi
532
533fi # skip
534
535# Check combinations of command line options, if we're good so far
536# Most of this only works for openssl, which is ok, as we're checking
537# the argument handling here, not the ECH protocol
538if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]]
539then
540    # ech can be hard, true, grease or false
541    # ecl:ecl can be correct, incorrect or missing
542    # ech:pn can be correct, incorrect or missing
543    # in all cases the "last" argument provided should "win"
544    # but only one of hard, true, grease or false will apply
545    turl="https://defo.ie/ech-check.php"
546    echconfiglist=$(get_ech_configlist defo.ie)
547    goodecl=$echconfiglist
548    echconfiglist=$(get_ech_configlist hidden.hoba.ie)
549    badecl=$echconfiglist
550    goodpn="cover.defo.ie"
551    badpn="hoba.ie"
552    echo "more cli_test with $turl"
553    echo "more cli_test with $turl" >> "$logfile"
554
555    # The combinatorics here are handled via the tests/ech_combos.py script
556    # which produces all the relevant combinations or inputs and orders
557    # thereof. We have to manually assess whether or not ECH is expected to
558    # work for each case.
559    cli_test "$turl" 0 0
560    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
561    cli_test "$turl" 0 0 --ech ecl:"$badecl"
562    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
563    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech ecl:"$goodecl"
564    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
565    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn"
566    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
567    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard
568    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
569    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl"
570    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
571    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
572    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
573    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn"
574    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
575    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true
576    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
577    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl"
578    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
579    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
580    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
581    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn"
582    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
583    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn"
584    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
585    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl"
586    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
587    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
588    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
589    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard
590    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
591    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
592    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
593    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
594    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
595    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
596    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
597    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true
598    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
599    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
600    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
601    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
602    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
603    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
604    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
605    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn"
606    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
607    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true
608    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
609    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
610    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
611    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
612    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
613    cli_test "$turl" - 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
614    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
615    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$goodpn"
616    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
617    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true
618    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
619    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl"
620    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
621    cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
622    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
623    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech pn:"$goodpn"
624    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
625    cli_test "$turl" 1 1 --ech ecl:"$goodecl"
626    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
627    cli_test "$turl" 1 1 --ech ecl:"$goodecl" --ech pn:"$goodpn"
628    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
629    cli_test "$turl" 1 0 --ech false
630    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
631    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl"
632    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
633    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl"
634    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
635    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn"
636    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
637    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard
638    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
639    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl"
640    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
641    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
642    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
643    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn"
644    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
645    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true
646    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
647    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl"
648    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
649    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
650    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
651    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn"
652    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
653    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn"
654    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
655    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl"
656    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
657    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
658    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
659    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard
660    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
661    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
662    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
663    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
664    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
665    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
666    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
667    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true
668    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
669    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
670    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
671    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
672    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
673    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
674    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
675    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn"
676    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
677    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true
678    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
679    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
680    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
681    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
682    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
683    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
684    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
685    cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$goodpn"
686    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
687    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true
688    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
689    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl"
690    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
691    cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
692    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
693    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech pn:"$goodpn"
694    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
695    cli_test "$turl" 1 0 --ech false --ech ecl:"$goodecl"
696    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
697    cli_test "$turl" 1 0 --ech false --ech ecl:"$goodecl" --ech pn:"$goodpn"
698    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
699    cli_test "$turl" 1 1 --ech false --ech hard
700    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
701    cli_test "$turl" 1 1 --ech false --ech hard --ech ecl:"$goodecl"
702    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
703    cli_test "$turl" 1 1 --ech false --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
704    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
705    cli_test "$turl" 1 1 --ech false --ech hard --ech pn:"$goodpn"
706    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
707    cli_test "$turl" 1 1 --ech false --ech hard --ech true
708    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
709    cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech ecl:"$goodecl"
710    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
711    cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
712    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
713    cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech pn:"$goodpn"
714    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
715    cli_test "$turl" 1 0 --ech false --ech pn:"$badpn"
716    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
717    cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl"
718    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
719    cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
720    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
721    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard
722    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
723    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
724    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
725    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
726    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
727    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
728    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
729    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true
730    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
731    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
732    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
733    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
734    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
735    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
736    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
737    cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech pn:"$goodpn"
738    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
739    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true
740    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
741    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
742    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
743    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
744    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
745    cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
746    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
747    cli_test "$turl" 1 0 --ech false --ech pn:"$goodpn"
748    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
749    cli_test "$turl" 1 1 --ech false --ech true
750    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
751    cli_test "$turl" 1 1 --ech false --ech true --ech ecl:"$goodecl"
752    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
753    cli_test "$turl" 1 1 --ech false --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
754    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
755    cli_test "$turl" 1 1 --ech false --ech true --ech pn:"$goodpn"
756    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
757    cli_test "$turl" 1 1 --ech hard
758    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
759    cli_test "$turl" 1 1 --ech hard --ech ecl:"$goodecl"
760    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
761    cli_test "$turl" 1 1 --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
762    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
763    cli_test "$turl" 1 1 --ech hard --ech pn:"$goodpn"
764    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
765    cli_test "$turl" 1 1 --ech hard --ech true
766    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
767    cli_test "$turl" 1 1 --ech hard --ech true --ech ecl:"$goodecl"
768    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
769    cli_test "$turl" 1 1 --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
770    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
771    cli_test "$turl" 1 1 --ech hard --ech true --ech pn:"$goodpn"
772    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
773    cli_test "$turl" 1 0 --ech pn:"$badpn"
774    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
775    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech ecl:"$goodecl"
776    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
777    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
778    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
779    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard
780    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
781    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
782    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
783    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
784    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
785    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
786    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
787    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true
788    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
789    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
790    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
791    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
792    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
793    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
794    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
795    cli_test "$turl" 1 0 --ech pn:"$badpn" --ech pn:"$goodpn"
796    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
797    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true
798    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
799    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
800    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
801    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
802    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
803    cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
804    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
805    cli_test "$turl" 1 0 --ech pn:"$goodpn"
806    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
807    cli_test "$turl" 1 1 --ech true
808    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
809    cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl"
810    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
811    cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
812    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
813    cli_test "$turl" 1 1 --ech true --ech pn:"$goodpn"
814    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
815    cli_test "$turl" 1 0
816    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
817    cli_test "$turl" 1 1 --ech ecl:"$goodecl"
818    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
819    cli_test "$turl" 1 1 --ech ecl:"$goodecl" --ech pn:"$goodpn"
820    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
821    cli_test "$turl" 1 0 --ech pn:"$goodpn"
822    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
823    cli_test "$turl" 1 1 --ech true
824    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
825    cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl"
826    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
827    cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
828    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
829    cli_test "$turl" 1 1 --ech true --ech pn:"$goodpn"
830    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
831
832    # a target URL that doesn't support ECH
833    turl="https://tcd.ie"
834    echo "cli_test with $turl"
835    echo "cli_test with $turl" >> "$logfile"
836    # the params below don't matter much here as we'll fail anyway
837    echconfiglist=$(get_ech_configlist defo.ie)
838    goodecl=$echconfiglist
839    badecl="$goodecl"
840    goodpn="tcd.ie"
841    badpn="tcd.ie"
842    cli_test "$turl" 1 0
843    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
844    cli_test "$turl" 0 0 --ech ecl:"$badecl"
845    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
846    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech ecl:"$goodecl"
847    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
848    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn"
849    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
850    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard
851    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
852    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl"
853    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
854    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
855    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
856    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn"
857    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
858    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true
859    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
860    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl"
861    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
862    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
863    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
864    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn"
865    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
866    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn"
867    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
868    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl"
869    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
870    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
871    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
872    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard
873    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
874    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
875    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
876    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
877    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
878    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
879    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
880    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true
881    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
882    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
883    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
884    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
885    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
886    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
887    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
888    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn"
889    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
890    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true
891    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
892    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
893    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
894    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
895    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
896    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
897    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
898    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$goodpn"
899    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
900    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true
901    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
902    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl"
903    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
904    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
905    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
906    cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech pn:"$goodpn"
907    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
908    cli_test "$turl" 0 0 --ech ecl:"$goodecl"
909    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
910    cli_test "$turl" 0 0 --ech ecl:"$goodecl" --ech pn:"$goodpn"
911    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
912    cli_test "$turl" 0 0 --ech false
913    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
914    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl"
915    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
916    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl"
917    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
918    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn"
919    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
920    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard
921    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
922    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl"
923    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
924    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
925    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
926    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn"
927    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
928    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true
929    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
930    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl"
931    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
932    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
933    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
934    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn"
935    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
936    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn"
937    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
938    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl"
939    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
940    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
941    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
942    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard
943    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
944    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
945    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
946    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
947    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
948    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
949    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
950    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true
951    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
952    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
953    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
954    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
955    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
956    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
957    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
958    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn"
959    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
960    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true
961    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
962    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
963    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
964    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
965    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
966    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
967    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
968    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$goodpn"
969    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
970    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true
971    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
972    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl"
973    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
974    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
975    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
976    cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech pn:"$goodpn"
977    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
978    cli_test "$turl" 0 0 --ech false --ech ecl:"$goodecl"
979    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
980    cli_test "$turl" 0 0 --ech false --ech ecl:"$goodecl" --ech pn:"$goodpn"
981    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
982    cli_test "$turl" 0 0 --ech false --ech hard
983    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
984    cli_test "$turl" 0 0 --ech false --ech hard --ech ecl:"$goodecl"
985    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
986    cli_test "$turl" 0 0 --ech false --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
987    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
988    cli_test "$turl" 0 0 --ech false --ech hard --ech pn:"$goodpn"
989    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
990    cli_test "$turl" 0 0 --ech false --ech hard --ech true
991    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
992    cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech ecl:"$goodecl"
993    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
994    cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
995    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
996    cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech pn:"$goodpn"
997    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
998    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn"
999    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1000    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl"
1001    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1002    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
1003    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1004    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard
1005    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1006    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
1007    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1008    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
1009    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1010    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
1011    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1012    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true
1013    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1014    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
1015    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1016    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1017    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1018    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
1019    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1020    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech pn:"$goodpn"
1021    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1022    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true
1023    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1024    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
1025    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1026    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1027    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1028    cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
1029    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1030    cli_test "$turl" 0 0 --ech false --ech pn:"$goodpn"
1031    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1032    cli_test "$turl" 0 0 --ech false --ech true
1033    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1034    cli_test "$turl" 0 0 --ech false --ech true --ech ecl:"$goodecl"
1035    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1036    cli_test "$turl" 0 0 --ech false --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1037    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1038    cli_test "$turl" 0 0 --ech false --ech true --ech pn:"$goodpn"
1039    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1040    cli_test "$turl" 0 0 --ech hard
1041    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1042    cli_test "$turl" 0 0 --ech hard --ech ecl:"$goodecl"
1043    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1044    cli_test "$turl" 0 0 --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
1045    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1046    cli_test "$turl" 0 0 --ech hard --ech pn:"$goodpn"
1047    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1048    cli_test "$turl" 0 0 --ech hard --ech true
1049    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1050    cli_test "$turl" 0 0 --ech hard --ech true --ech ecl:"$goodecl"
1051    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1052    cli_test "$turl" 0 0 --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1053    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1054    cli_test "$turl" 0 0 --ech hard --ech true --ech pn:"$goodpn"
1055    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1056    cli_test "$turl" 0 0 --ech pn:"$badpn"
1057    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1058    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech ecl:"$goodecl"
1059    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1060    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn"
1061    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1062    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard
1063    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1064    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl"
1065    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1066    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn"
1067    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1068    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech pn:"$goodpn"
1069    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1070    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true
1071    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1072    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl"
1073    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1074    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1075    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1076    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn"
1077    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1078    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech pn:"$goodpn"
1079    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1080    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true
1081    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1082    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl"
1083    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1084    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1085    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1086    cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech pn:"$goodpn"
1087    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1088    cli_test "$turl" 0 0 --ech pn:"$goodpn"
1089    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1090    cli_test "$turl" 0 0 --ech true
1091    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1092    cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl"
1093    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1094    cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1095    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1096    cli_test "$turl" 0 0 --ech true --ech pn:"$goodpn"
1097    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1098    cli_test "$turl" 0 0
1099    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1100    cli_test "$turl" 0 0 --ech ecl:"$goodecl"
1101    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1102    cli_test "$turl" 0 0 --ech ecl:"$goodecl" --ech pn:"$goodpn"
1103    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1104    cli_test "$turl" 0 0 --ech pn:"$goodpn"
1105    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1106    cli_test "$turl" 0 0 --ech true
1107    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1108    cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl"
1109    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1110    cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn"
1111    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1112    cli_test "$turl" 0 0 --ech true --ech pn:"$goodpn"
1113    if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi
1114fi
1115
1116
1117END=$(whenisitagain)
1118echo "Finished $0 at $END"  >> "$logfile"
1119echo "-----" >> "$logfile"
1120
1121if [[ "$allgood" == "yes" ]]
1122then
1123    echo "Finished $0 at $END"
1124    echo "All good, log in $logfile"
1125    exit 0
1126else
1127    echo "Finished $0 at $END"
1128    echo "NOT all good, log in $logfile"
1129fi
1130
1131# send a mail to root (will be fwd'd) but just once every 24 hours
1132# 'cause we only really need "new" news
1133itsnews="yes"
1134age_of_news=0
1135if [ -f "$LTOP"/bad_runs ]
1136then
1137    age_of_news=$(fileage "$LTOP"/bad_runs)
1138    # only consider news "new" if we haven't mailed today
1139    if ((age_of_news < 24*3600))
1140    then
1141        itsnews="no"
1142    fi
1143fi
1144if [[ "$DOMAIL" == "yes" && "$itsnews" == "yes" ]]
1145then
1146    echo "ECH badness at $NOW" | mail -s "ECH badness at $NOW" root
1147fi
1148# add to list of bad runs (updating file age)
1149echo "ECH badness at $NOW" >>"$LTOP"/bad_runs
1150exit 2
1151