tests: fix help usage test for uclient built with sanitizer
[project/uclient.git] / tests / cram / test-san_uclient-fetch.t
1 check uclient-fetch usage:
2
3 $ [ -n "$BUILD_BIN_DIR" ] && export PATH="$BUILD_BIN_DIR:$PATH"
4 $ alias uc='uclient-fetch-san'
5
6 $ uc
7 Usage: uclient-fetch-san [options] <URL>
8 Options:
9 \t-4\t\t\t\tUse IPv4 only (esc)
10 \t-6\t\t\t\tUse IPv6 only (esc)
11 \t-O <file>\t\t\tRedirect output to file (use "-" for stdout) (esc)
12 \t-P <dir>\t\t\tSet directory for output files (esc)
13 \t--quiet | -q\t\t\tTurn off status messages (esc)
14 \t--continue | -c\t\t\tContinue a partially-downloaded file (esc)
15 \t--user=<user>\t\t\tHTTP authentication username (esc)
16 \t--password=<password>\t\tHTTP authentication password (esc)
17 \t--user-agent | -U <str>\t\tSet HTTP user agent (esc)
18 \t--post-data=STRING\t\tuse the POST method; send STRING as the data (esc)
19 \t--post-file=FILE\t\tuse the POST method; send FILE as the data (esc)
20 \t--spider | -s\t\t\tSpider mode - only check file existence (esc)
21 \t--timeout=N | -T N\t\tSet connect/request timeout to N seconds (esc)
22 \t--proxy=on | -Y on\t\tEnable interpretation of proxy env vars (default) (esc)
23 \t--proxy=off | -Y off | (esc)
24 \t--no-proxy \t\tDisable interpretation of proxy env vars (esc)
25
26 HTTPS options:
27 \t--ca-certificate=<cert>\t\tLoad CA certificates from file <cert> (esc)
28 \t--no-check-certificate\t\tdon't validate the server's certificate (esc)
29 \t--ciphers=<cipherlist>\t\tSet the cipher list string (esc)
30
31 [1]
32
33 download lorem ipsum verbose:
34
35 $ uc -O lorem http://127.0.0.1:1922/lorem
36 Downloading 'http://127.0.0.1:1922/lorem'
37 Connecting to 127.0.0.1:1922
38 Writing to 'lorem'
39 \r (no-eol) (esc)
40 lorem 100% |*******************************| 4111 0:00:00 ETA
41 Download completed (4111 bytes)
42
43 $ md5sum lorem
44 887943f7c25bd6cec4570c405241b425 lorem
45
46 download lorem ipsum quiet:
47
48 $ uc -q -O lorem http://127.0.0.1:1922/lorem
49
50 $ md5sum lorem
51 887943f7c25bd6cec4570c405241b425 lorem
52
53 check that HTTP 404 errors are handled properly:
54
55 $ uc http://127.0.0.1:1922/does-not-exist
56 Downloading 'http://127.0.0.1:1922/does-not-exist'
57 Connecting to 127.0.0.1:1922
58 HTTP error 404
59 [8]
60
61 $ uc -q http://127.0.0.1:1922/does-not-exist
62 [8]
63
64 check that SSL works:
65
66 $ uc -q -O /dev/null 'https://www.openwrt.org'
67
68 $ uc -O /dev/null 'https://downloads.openwrt.org/does-not-exist' 2>&1 | grep error
69 HTTP error 404
70
71 check handling of certificate issues:
72
73 $ uc -O /dev/null 'https://self-signed.badssl.com/' 2>&1 | grep error
74 Connection error: Invalid SSL certificate
75
76 $ uc -O /dev/null 'https://untrusted-root.badssl.com/' 2>&1 | grep error
77 Connection error: Invalid SSL certificate
78
79 $ uc -O /dev/null 'https://expired.badssl.com/' 2>&1 | grep error
80 Connection error: Invalid SSL certificate
81
82 $ uc --ca-certificate=/dev/null -O /dev/null 'https://www.openwrt.org/' 2>&1 | grep error
83 Connection error: Invalid SSL certificate
84
85 check that certificate issues can be disabled:
86
87 $ uc --no-check-certificate -q -O /dev/null 'https://self-signed.badssl.com/'
88
89 $ uc --no-check-certificate -q -O /dev/null 'https://untrusted-root.badssl.com/'
90
91 $ uc --no-check-certificate -q -O /dev/null 'https://expired.badssl.com/'