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