| 1 |
#! /usr/bin/make -rRf |
| 2 |
#? |
| 3 |
#? NAME |
| 4 |
#? Makefile - makefile for testing O-Saft warning messages |
| 5 |
#? |
| 6 |
#? DESCRIPTION |
| 7 |
#? For more details please see |
| 8 |
#? ../Makefile Makefile Makefile.help Makefile.pod |
| 9 |
#? make help.test.warnings |
| 10 |
#? |
| 11 |
#? Makefile with targets for testing warnings of o-saft.pl . |
| 12 |
#? All targets succedd, if the warning message is present, they fail, if |
| 13 |
#? the warning message is not present. |
| 14 |
#? |
| 15 |
#? VERSION |
| 16 |
#? @(#) Makefile.warnigs 1.73 22/10/29 18:58:26 |
| 17 |
#? |
| 18 |
#? AUTHOR |
| 19 |
#? 18-apr-18 Achim Hoffmann |
| 20 |
#? |
| 21 |
# ----------------------------------------------------------------------------- |
| 22 |
|
| 23 |
HELP-help.test.warnings = targets for testing '$(SRC.pl)' WARNING messages |
| 24 |
|
| 25 |
_SID.warnings := 1.73 |
| 26 |
|
| 27 |
_MYSELF.warnings := t/Makefile.warnings |
| 28 |
ALL.includes += $(_MYSELF.warnings) |
| 29 |
ALL.inc.type += warnings |
| 30 |
ALL.help.tests += help.test.warnings |
| 31 |
|
| 32 |
first-warn-target-is-default: help.test.warnings |
| 33 |
|
| 34 |
ifeq (,$(_SID.test)) |
| 35 |
-include t/Makefile |
| 36 |
endif |
| 37 |
|
| 38 |
ifndef TEST.host |
| 39 |
TEST.host = localhost |
| 40 |
endif |
| 41 |
|
| 42 |
help.test.warnings: HELP_TYPE = warnings |
| 43 |
help.test.warnings-v: HELP_TYPE = warnings |
| 44 |
help.test.warnings-vv: HELP_TYPE = warnings |
| 45 |
|
| 46 |
#_____________________________________________________________________________ |
| 47 |
#________________________________________________________________ variables __| |
| 48 |
|
| 49 |
# extract all line looking like: |
| 50 |
# die $STR{ERROR}, |
| 51 |
# warn $STR{ERROR}, |
| 52 |
# warn $STR{WARN}, |
| 53 |
# warn $STR{WARN} . |
| 54 |
# warn($STR{ |
| 55 |
# warn "**WARNING: |
| 56 |
# _warn(" |
| 57 |
# _warn($STR{ |
| 58 |
# Because perl comments with # cannot be used inside Makefile's define or macro |
| 59 |
# definitions, the following sequence of the perl code is explained first: |
| 60 |
# skip assignments |
| 61 |
# remove opening ( if any |
| 62 |
# if line mtches die or warn or print |
| 63 |
# replace die|warn by **WARNING: or **ERROR: |
| 64 |
# replace _warn by **WARNING: |
| 65 |
# remove postfix condition |
| 66 |
# remove ") and anything reight to it |
| 67 |
# remove _warn (if still there) |
| 68 |
# TODO: warn and die not detected, if they do not appear as first word in line |
| 69 |
EXE.extract_warn := perl -nle '\ |
| 70 |
m/^\s*warn\s+=/ && do {next};\ |
| 71 |
s/[(]/ / if m/^\s*(?:die|_?warn|print)\s*\(\s*$$STR.[EW]/;\ |
| 72 |
m/^\s*(?:die|_?warn|print $$STR.[EW])/ && do {\ |
| 73 |
s/^\s*(?:print|die|warn)\s+$$STR.ERROR.,\s"/**ERROR: /;\ |
| 74 |
s/^\s*(?:print|die|warn)\s+$$STR.WARN.[,.\s]+"/**WARNING: /;\ |
| 75 |
s/^\s*(?:print|die|warn)[\s(]+"\$$STR.WARN.[,.\s]+/**WARNING: /;\ |
| 76 |
s/",\s+"/ /;\ |
| 77 |
s/^\s*_warn(?:_nosni)?\s*\(\s*"/**WARNING: /;\ |
| 78 |
s/ +if +\(.*//;\ |
| 79 |
s/"\s*\)?\s*;?\s*$$//;\ |
| 80 |
s/^\s*_?warn\s*\(?"//;\ |
| 81 |
print;\ |
| 82 |
}' |
| 83 |
|
| 84 |
EXE.gen_warning-target := perl -nle '\ |
| 85 |
s/^..(?:ERROR|WARNING): /warning-/;\ |
| 86 |
s/:/: TEST.args = TODO:/;\ |
| 87 |
print;' |
| 88 |
|
| 89 |
#_____________________________________________________________________________ |
| 90 |
#_________________________________________________________ testing warnings __| |
| 91 |
|
| 92 |
HELP-_warnings = ____________________________________________ test warnings _ |
| 93 |
HELP-test.warnings = test **WARNING messages of '$(SRC.pl)' |
| 94 |
HELP-test.warnings.log = test **WARNING messages of '$(SRC.pl)' and compare with previous one |
| 95 |
HELP-message-STR = test for specific STR in output of '$(SRC.pl)' |
| 96 |
HELP-warning-NR = test for specific messages number NR in output of '$(SRC.pl)' |
| 97 |
HELP-warnings-info = get all **WARNING messages from '$(SRC.pl)' |
| 98 |
HELP-warnings-show.todo = show not implemented tests for warnings |
| 99 |
HELP-warnings-show.difficult= show tests for warnings which are difficult to implement |
| 100 |
HELP-warnings.gen.template = generate template Makefile for testing warning messages |
| 101 |
|
| 102 |
HELP.warnings = $(_NL)\ |
| 103 |
\# Hint: message-STR can test for any string in output, example$(_NL)\ |
| 104 |
\# $(MAKE_COMMAND) message-Certificate TEST.args='+cn localhost'$(_NL)\ |
| 105 |
\#$(_NL)\ |
| 106 |
\# Examples:$(_NL)\ |
| 107 |
\# $(MAKE_COMMAND) warning-042$(_NL)\ |
| 108 |
\# $(MAKE_COMMAND) message-Certificate TEST.args='+cn localhost'$(_NL)\ |
| 109 |
\#$(_NL)\ |
| 110 |
\# Note that using -n reports a bunch of shell commands. |
| 111 |
|
| 112 |
HELP.test.warnings.all = \ |
| 113 |
\# for more details, use:$(_NL)\ |
| 114 |
\# $(MAKE_COMMAND) t-warn$(_NL)\ |
| 115 |
|
| 116 |
# SEE Make:target name |
| 117 |
# SEE Make:target name prefix |
| 118 |
|
| 119 |
# testing warning messages |
| 120 |
TEST.tmp.rc := /tmp/o-saft.tmprc |
| 121 |
|
| 122 |
test.warnings%: EXE.pl = ../$(SRC.pl) |
| 123 |
warning-%: EXE.pl = ../$(SRC.pl) |
| 124 |
warning-%: TEST.init = |
| 125 |
|
| 126 |
# How target rules in this Makefile (should) work: |
| 127 |
# The pattern rule message-% from ./Makefile is used to check for a |
| 128 |
# specific warning message. |
| 129 |
|
| 130 |
warning-%: message-% |
| 131 |
@$(TRACE.target) |
| 132 |
|
| 133 |
# The pattern rule message-% searches (grep) the output of o-saft.pl |
| 134 |
# for a string, which is the pattern of the target name. |
| 135 |
# Each target rule defines its own arguments to be passed to o-saft.pl |
| 136 |
# |
| 137 |
# Mainly the +quit command is sufficient to get the warning. |
| 138 |
# The first target rule warning-000 is designed to fail. |
| 139 |
# All targets rules are summarized in the target test.warnings . |
| 140 |
# |
| 141 |
# To log the results of these tests, only one file will be created, not |
| 142 |
# one for each target rule. The target is test.warnings.log . |
| 143 |
# |
| 144 |
# All targets define EXE.pl which is the command to be used. |
| 145 |
# All targets should define TEST.args with the arguments, which force |
| 146 |
# the warning message DDD given in the target's name warning-DDD . |
| 147 |
# Some messages can be tested without any target host, then the +quit |
| 148 |
# command is added to TEST.args . Others need a target host argument |
| 149 |
# somehow, "any-host" is used for that. Using "any-host" most likely |
| 150 |
# causes $(EXE.pl) to fail with more WARNNG messages printed, but they |
| 151 |
# are silently ignored because the message with the specific number DDD |
| 152 |
# only is extracted. |
| 153 |
# If the definition of TEST.args starts with the literal string "TODO:" |
| 154 |
# the target will only print the text (see message-%). |
| 155 |
# The "TODO:" texts ending with "difficult ..." mark messages, which |
| 156 |
# cannot be tested easily. They are currently disabled, means that the |
| 157 |
# "TODO" text is printed by the target. |
| 158 |
# |
| 159 |
# Examples |
| 160 |
# warning-049: TEST.args = +unknown_command +quit |
| 161 |
# warning-004: TEST.args = TODO: testing perl status, difficult ... |
| 162 |
# |
| 163 |
# Limitations |
| 164 |
# The name of each individual target rule contains the pattern (049 in |
| 165 |
# above example), which must be searched for in the output of EXE.pl . |
| 166 |
# As this is just a simple number in all rules here, the search may re- |
| 167 |
# sult in false positives. Manual checks of the rule commands (recipe) |
| 168 |
# are recommended from time to time. |
| 169 |
# |
| 170 |
# NOTE: in rare cases the target may succedd wrongly, see description |
| 171 |
# of message-% pattern rule in t/Makefile. |
| 172 |
|
| 173 |
# TODO: the message text assigned to TEST.args is mainly a copy of the |
| 174 |
# the text used in the source code; should find a way to generate |
| 175 |
# these assignments (done manually here, which is error-prone) |
| 176 |
warning-000: TEST.args = --invalid_nr_to_show_failed-status |
| 177 |
warning-002: TEST.args = TODO: testing openssl returning error, difficult ... |
| 178 |
warning-003: TEST.args = TODO: testing openssl failed with allocate memory, difficult ... |
| 179 |
warning-004: TEST.args = TODO: testing perl returned status, difficult ... |
| 180 |
warning-005: TEST.args = TODO: testing missing IO/Socket/SSL.pm |
| 181 |
warning-006: TEST.args = TODO: testing missing IO/Socket/INET.pm, disabled ... |
| 182 |
warning-007: TEST.args = TODO: testing missing Net/DNS.pm |
| 183 |
warning-008: TEST.args = TODO: testing missing Time/Local.pm |
| 184 |
#warning-009: TEST.args = free |
| 185 |
warning-010: TEST.args = TODO: testing die, missing Net/SSLhello.pm |
| 186 |
warning-011: TEST.args = TODO: testing die, missing Net/SSLinfo.pm |
| 187 |
warning-012: TEST.args = TODO: testing die, missing Net::SSLeay.pm |
| 188 |
warning-013: TEST.args = TODO: testing die, missing o-saft-man.pm, disabled ... |
| 189 |
warning-014: TEST.args = TODO: testing die, missing Net::SSLeay.pm |
| 190 |
warning-015: TEST.args = TODO: testing die, no ciphers found, may happen with openssl pre 1.0.0, difficult ... |
| 191 |
# 016, 017: programing error |
| 192 |
warning-016: TEST.args = TODO: testing undefined cipher description for, difficult ... |
| 193 |
warning-017: TEST.args = TODO: testing partial match for cipher name found, difficult ... |
| 194 |
warning-020: TEST.args = TODO: testing die, CGI mode requires strict settings, disabled ... |
| 195 |
warning-021: TEST.args = --set-score=unknown +quit |
| 196 |
warning-022: TEST.args = --cfgcmd-is=unknown +quit |
| 197 |
warning-023: TEST.args = --legacy=key +quit |
| 198 |
#warning-040: TEST.args = free |
| 199 |
warning-041: TEST.args = s_client +quit |
| 200 |
warning-042: TEST.args = +cn /unknown-host +quit |
| 201 |
warning-043: TEST.args = +cn --port=' ' unknown-host +quit |
| 202 |
warning-044: TEST.args = +zlib +lzo +open_pgp +fallback +quit |
| 203 |
warning-045: TEST.args = any-host --port 45 +quit |
| 204 |
warning-046: TEST.args = --rc=$(TEST.tmp.rc) --v +quit |
| 205 |
warning-046: TEST.rc = --cfg_cmd=new_command=quit |
| 206 |
warning-047: TEST.args = +info +cn any-host |
| 207 |
warning-048: TEST.args = +check +cn any-host |
| 208 |
warning-049: TEST.args = +unknown_command +quit |
| 209 |
warning-050: TEST.args = +cn --port= +quit |
| 210 |
warning-051: TEST.args = --label=unknown +quit |
| 211 |
warning-052: TEST.args = --rc=$(TEST.tmp.rc) |
| 212 |
warning-052: TEST.rc = "--option=-with_trailing_spaces " |
| 213 |
warning-053: TEST.args = --capath='/path with spaces' +quit |
| 214 |
warning-054: TEST.args = --legacy=unknown_legacy +quit |
| 215 |
warning-055: TEST.args = --format=unknown_format +quit |
| 216 |
warning-056: TEST.args = --range=unknown_range +quit |
| 217 |
warning-057: TEST.args = --cipher-mode=unknown +quit |
| 218 |
warning-058: TEST.args = --ca-path=unknown +quit |
| 219 |
warning-059: TEST.args = --ca-path=unknown +quit |
| 220 |
warning-060: TEST.args = --ca-paths=unknown --cfg-init=ca_files=unknown +quit |
| 221 |
#warning-061: TEST.args = free |
| 222 |
warning-062: TEST.args = --cipher=unknown +cipher any-host |
| 223 |
warning-063: TEST.args = --cipher=UNKNOWN +cipher any-host |
| 224 |
warning-064: TEST.args = +sts --no-http any-host |
| 225 |
#warning-065: TEST.args = free |
| 226 |
warning-066: TEST.args = --ignore-out=cn +cn any-host |
| 227 |
warning-067: TEST.args = --ignore-out=cn +cn --v any-host |
| 228 |
warning-068: TEST.args = --ignore-out=cn +cn --v any-host |
| 229 |
warning-069: TEST.args = --sniname=wrong +cn $(TEST.host) |
| 230 |
warning-070: TEST.args = TODO: testing configuration file cannot be opened |
| 231 |
#warning-070: TEST.args = --cfg_cmd=$(TEST.tmp.rc) +quit |
| 232 |
#warning-070: TEST.args = TODO: need special test target which uses unredable --cfg_cmd=$(TEST.tmp.rc) |
| 233 |
warning-071: TEST.args = --cfg_unknown=dummy=dummy +quit |
| 234 |
warning-070: TEST.args = TODO: configuration files are not read in CGI mode, difficult ... |
| 235 |
#warning-072: TEST.args = --cfg_cmd=$(TEST.tmp.rc) --cgi +quit |
| 236 |
#warning-072: TEST.rc = --cfg_cmd=new_command=not_allowed_with--cgi |
| 237 |
warning-073: TEST.args = --cfg_cmd=invalid_default_command=default +quit |
| 238 |
#?# warning-074: TEST.args = --rc=$(TEST.tmp.rc) +quit |
| 239 |
#?# warning-074: TEST.rc = "--cfg_cmd=dummy=cn unknown_command" |
| 240 |
warning-074: TEST.args = --cfg_cmd=dummy=unknown_command +quit |
| 241 |
warning-075: TEST.args = --cfg-init=ca_path=force-message +quit |
| 242 |
warning-076: TEST.args = --cfg_score=dummy=invalid_value +quit |
| 243 |
warning-080: TEST.args = TODO: testing Net::SSLeay < 1.49 |
| 244 |
warning-081: TEST.args = TODO: ancient Net::SSLeay Net::SSLeay::VERSION < 1.49, difficult ... |
| 245 |
warning-090: TEST.args = TODO: Net::SSLinfo::next_protos no longer supported, please use Net::SSLinfo::protos_alpn instead, difficult ... |
| 246 |
warning-091: TEST.args = TODO: help file cannot be opened, difficult ... |
| 247 |
warning-092: TEST.args = TODO: help file unknown syntax:, difficult ... |
| 248 |
warning-093: TEST.args = TODO: help file cannot be opened, difficult ... |
| 249 |
warning-190: TEST.args = TODO: open(OSaft/Doc/file.txt): failed, difficult ... |
| 250 |
warning-191: TEST.args = TODO: no OSaft/Doc/file.txt found, difficult ... |
| 251 |
warning-111: TEST.args = --mx --nodns +quit |
| 252 |
warning-111: TEST.args = TODO: testing missing Net/DNS.pm |
| 253 |
warning-112: TEST.args = +sts_expired +quit |
| 254 |
warning-112: TEST.args = TODO: testing missing Time/Local.pm need by +sts_expired |
| 255 |
#warning-113 .. warning-119: TEST.args = free |
| 256 |
warning-120: TEST.args = TODO: testing ancient perl |
| 257 |
warning-121: TEST.args = TODO: testing ancient module |
| 258 |
warning-122: TEST.args = TODO: testing ancient Net::SSLeay |
| 259 |
warning-123: TEST.args = TODO: testing ancient IO::Socket |
| 260 |
warning-124: TEST.args = TODO: testing ancient IO::Socket::SSL |
| 261 |
warning-125: TEST.args = TODO: testing openssl < 1.0.0 |
| 262 |
warning-126: TEST.args = TODO: testing missing ALPN functionality |
| 263 |
warning-127: TEST.args = TODO: testing Net::SSLeay < 1.56, ALPN disabled |
| 264 |
warning-128: TEST.args = TODO: testing openssl < 1.0.2, ALPN disabled |
| 265 |
warning-129: TEST.args = TODO: testing missing NPN functionality |
| 266 |
warning-130: TEST.args = TODO: testing Net::SSLeay < 1.46, NPN disabled |
| 267 |
#warning-131: TEST.args = free |
| 268 |
warning-132: TEST.args = TODO: testing openssl < 1.0.1, NPN disabled |
| 269 |
warning-133: TEST.args = TODO: testing Net::SSLeay without OCSP |
| 270 |
warning-134: TEST.args = TODO: testing Net::SSLeay without EC |
| 271 |
warning-135: TEST.args = TODO: testing Net::SSLeay < 1.49 |
| 272 |
#warning-136: TEST.args = free |
| 273 |
#warning-137: TEST.args = free |
| 274 |
#warning-138: TEST.args = free |
| 275 |
#warning-139: TEST.args = free |
| 276 |
warning-140: TEST.args = +cipherraw --dtlsv1 +quit |
| 277 |
warning-141: TEST.args = +cipherraw --dtlsv9 +quit |
| 278 |
warning-141: TEST.args = TODO: testing wrong or unsupported SSL protocol |
| 279 |
#warning-142: TEST.args = free |
| 280 |
warning-143: TEST.args = TODO: testing SSL protocol not supported by Net::SSLeay, difficult ... |
| 281 |
warning-144: TEST.args = TODO: testing missing openssl s_client support for -alpn or -npn, difficult ... |
| 282 |
warning-145: TEST.args = TODO: testing missing openssl s_client support for -alpn or -npn, difficult ... |
| 283 |
warning-146: TEST.args = TODO: testing missing openssl -tlsextdebug option |
| 284 |
warning-147: TEST.args = TODO: testing missing openssl executable in Net::SSLinfo |
| 285 |
warning-148: TEST.args = TODO: testing missing openssl version -d failed, difficult ... |
| 286 |
warning-149: TEST.args = --openssl=/does/not/exist +quit |
| 287 |
warning-201: TEST.args = +cn unknown-host |
| 288 |
warning-202: TEST.args = +cn --exit=HOST1 www.skype.com |
| 289 |
# # scary: need a reliable FQDN here -^^^^^^^^^^^^^ |
| 290 |
warning-203: TEST.args = TODO: testing connection without SNI (errors), difficult ... |
| 291 |
warning-204: TEST.args = TODO: testing connection without SNI, difficult ... |
| 292 |
warning-205: TEST.args = TODO: testing connection failed, difficult ... |
| 293 |
warning-206: TEST.args = TODO: testing connection witout SNI errors from Net::SSLinfo, difficult ... |
| 294 |
warning-207: TEST.args = TODO: testing connection with openssl failed, difficult ... |
| 295 |
warning-208: TEST.args = TODO: testing +check without openssl on Windows, difficult ... |
| 296 |
warning-209: TEST.args = TODO: testing missing SSL version, difficult ... |
| 297 |
warning-301: TEST.args = TODO: testing continous connection errors, difficult ... |
| 298 |
warning-302: TEST.args = TODO: testing max connection errors, difficult ... |
| 299 |
warning-303: TEST.args = TODO: testing unsupported Net::SSLeay::CTX_v2_new, difficult ... |
| 300 |
warning-304: TEST.args = TODO: testing unsupported Net::SSLeay::CTX_v3_new, difficult ... |
| 301 |
warning-305: TEST.args = TODO: testing connection _usesocket failed, difficult ... |
| 302 |
#warning-306 .. warning-310: TEST.args = free |
| 303 |
warning-311: TEST.args = TODO: testing empty result from openssl, difficult ... |
| 304 |
warning-312: TEST.args = TODO: testing strange result from openssl, difficult ... |
| 305 |
warning-312: TEST.args = TODO: testing unknown result from openssl, difficult ... |
| 306 |
warning-321: TEST.args = TODO: testing _isbleed failed to connect, difficult ... |
| 307 |
warning-322: TEST.args = TODO: testing _isbleed with openTcpSSLconnection failed, difficult ... |
| 308 |
warning-323: TEST.args = TODO: testing heartbleed: no reply, difficult ... |
| 309 |
warning-324: TEST.args = TODO: --sniname=wrong +cn |
| 310 |
# # scary: need a reliable FQDN here -^^^^^^^^^^^^^ www.skype.com |
| 311 |
warning-325: TEST.args = TODO: testing connection failed, HTTP disabled, difficult ... |
| 312 |
warning-331: TEST.args = TODO: testing _isccs: failed to connect, difficult ... |
| 313 |
warning-332: TEST.args = TODO: testing _isccs: no reply, difficult ... |
| 314 |
warning-407: TEST.args = --no-rc +cipher -ciphermode=intern --cipher=IS-UNKNOWN $(TEST.host) |
| 315 |
warning-408: TEST.args = --no-openssl +cipher-dh --exit=HOST2 $(TEST.host) |
| 316 |
warning-409: TEST.args = --sslv2 --sni +cipher --exit=HOST4 $(TEST.host) |
| 317 |
warning-410: TEST.args = --sslv2 --sni +cipher --ciphermode=openssl --exit=HOST4 $(TEST.host) |
| 318 |
warning-411: TEST.args = TODO: testing checked cipher does not match returned cipher, difficult ... |
| 319 |
warning-412: TEST.args = TODO: testing missing ciphers in sorted list, difficult ... |
| 320 |
warning-420: TEST.args = TODO: testing empty value [$cipher, $ssl], check ignored; programming error |
| 321 |
warning-451: TEST.args = TODO: testing function obsolete, please use cipher_openssl, difficult ... |
| 322 |
warning-510: TEST.args = TODO: testing --help=unknown-table , difficult ... |
| 323 |
warning-601: TEST.args = TODO: testing connection failed with protocol error, difficult ... |
| 324 |
warning-602: TEST.args = TODO: testing connection type name mismatch, difficult ... |
| 325 |
warning-631: TEST.args = TODO: testing SSL protocol mismatch for cipher, difficult ... |
| 326 |
warning-641: TEST.args = TODO: testing HTTPS request failed, difficult:& needs target with ALPN ... |
| 327 |
warning-651: TEST.args = TODO: testing Net::SSLeay >= 1.45 required for getting version |
| 328 |
warning-652: TEST.args = TODO: testing Net::SSLeay >= 1.33 required for getting subjectAltNames |
| 329 |
warning-653: TEST.args = TODO: testing Net::SSLeay >= 1.30 required for getting commonName |
| 330 |
warning-654: TEST.args = TODO: testing Net::SSLeay >= 1.45 required for getting fingerprint_md5 |
| 331 |
warning-655: TEST.args = TODO: testing Net::SSLeay >= 1.46 required for getting some certificate checks |
| 332 |
warning-801: TEST.args = TODO: testing connection returning unknown label, difficult ... |
| 333 |
warning-811: TEST.args = TODO: testing ancient openssl version: using '-msg' option to get DH parameters |
| 334 |
warning-821: TEST.args = TODO: can not print certificate sizes without a certificate, --no-cert |
| 335 |
warning-831: TEST.args = --testing-+quit__without__--trace=arg +quit |
| 336 |
warning-841: TEST.args = TODO: used openssl version differs from compiled Net:SSLeay |
| 337 |
warning-851: TEST.args = TODO: ancient version Net::SSLeay < 1.49 |
| 338 |
warning-861: TEST.args = TODO: not all ciphers listed |
| 339 |
|
| 340 |
# o-saft.pl: programming error (cipher missing in %cipher) |
| 341 |
warning-862: TEST.args = TODO: unknown cipher key '$key', key ignored, difficult ... |
| 342 |
warning-863: TEST.args = TODO: unknown cipher key '$key', key ignored, difficult ... |
| 343 |
|
| 344 |
# not yet used in o-saft.pl (1/2019) |
| 345 |
warning-501: TEST.args = TODO: cannot read OSaft/_ciphers_openssl_all.pm |
| 346 |
warning-501: EXE.pl = ../OSaft/Ciphers.pm |
| 347 |
warning-502: TEST.args = TODO: cannot read OSaft/_ciphers_iana.pm |
| 348 |
warning-502: EXE.pl = ../OSaft/Ciphers.pm |
| 349 |
warning-503: TEST.args = TODO: cannot read OSaft/_ciphers_osaft.pm |
| 350 |
warning-503: EXE.pl = ../OSaft/Ciphers.pm |
| 351 |
warning-504: TEST.args = TODO: DATA line%4d: wrong hex key |
| 352 |
warning-504: EXE.pl = ../OSaft/Ciphers.pm |
| 353 |
warning-505: TEST.args = TODO: DATA line%4d: wrong number of TAB-separated fields |
| 354 |
warning-505: EXE.pl = ../OSaft/Ciphers.pm |
| 355 |
warning-511: TEST.args = getter=0x42 |
| 356 |
warning-511: EXE.pl = ../OSaft/Ciphers.pm |
| 357 |
warning-513: TEST.args = TODO: partial match for cipher name found, difficult ... |
| 358 |
warning-513: EXE.pl = ../OSaft/Ciphers.pm |
| 359 |
|
| 360 |
# Ciphers.pm |
| 361 |
warning-520: TEST.args = testing ciphers unknown format |
| 362 |
warning-520: EXE.pl = ../OSaft/Ciphers.pm |
| 363 |
# Ciphers.pm: programming error |
| 364 |
warning-521: TEST.args = TODO: no key found for '$txt' |
| 365 |
warning-521: EXE.pl = ../OSaft/Ciphers.pm |
| 366 |
#warning-522: TEST.args = TODO: testing duplicate openssl key, difficult ... |
| 367 |
#warning-522: EXE.pl = ../OSaft/Ciphers.pm |
| 368 |
|
| 369 |
ALL.test.warnings = $(shell awk -F: '/^warning-...:/{arr[$$1]=1}$(_EXE.print_arr_END.awk)' $(_MYSELF.warnings)) |
| 370 |
|
| 371 |
_TEST.template = t/test.warning.Makefile-template |
| 372 |
$(_TEST.template): $(SRC.pl) $(SRC.pm) |
| 373 |
@echo "# generated template targets to test **WARNING messages" > $@ |
| 374 |
@echo "# targets use the message text as TODO (see Makefile)" >> $@ |
| 375 |
@echo "# Note: texts for TEST.args should not contain ; | ()" >> $@ |
| 376 |
@echo "# Note: not all texts my be useful, it's a template!" >> $@ |
| 377 |
@echo "" >> $@ |
| 378 |
@$(EXE.extract_warn) $^ \ |
| 379 |
| $(EXE.gen_warning-target) \ |
| 380 |
| sort >> $@ |
| 381 |
@-ls -l $@ |
| 382 |
|
| 383 |
warnings.gen.template: $(ALL.Makefiles) $(_TEST.template) |
| 384 |
# TODO: Makefile dependency does not work, probably need to use $(MAKE) |
| 385 |
# TODO: hence missing from ALL.test.warnings |
| 386 |
.PHONY: warnings.gen.template |
| 387 |
|
| 388 |
warnings-info: $(SRC.pl) $(SRC.pm) |
| 389 |
@echo "# generated by $(_MYSELF.warnings) $@" |
| 390 |
@echo "# list of used error and warning numbers and messages" |
| 391 |
@$(EXE.extract_warn) $^ | sort |
| 392 |
|
| 393 |
warnings-show.todo: |
| 394 |
grep "^warning..*TODO" $(_MYSELF.warnings) |
| 395 |
|
| 396 |
ALL.test.warnings += warnings-info warnings-show.difficult warnings-show.todo |
| 397 |
|
| 398 |
warnings-show.difficult: |
| 399 |
grep "^warning..*difficult" $(_MYSELF.warnings) |
| 400 |
|
| 401 |
warnings-%.log: $(TEST.logdir) |
| 402 |
@$(TRACE.target) |
| 403 |
@$(TRACE.target.log) |
| 404 |
@$(eval _NEW.log := $(TEST.logdir)/$@-$(TEST.today)) |
| 405 |
@$(MAKE) $(MFLAGS) -s warnings-$* > $@ 2>&1 |
| 406 |
@expr "$(MAKEFLAGS)" : n >/dev/null \ |
| 407 |
&& echo "$(MAKE) $(MFLAGS) -s warnings-$* > $@ 2>&1" \ |
| 408 |
|| $(MAKE) $(MFLAGS) -s warnings-$* > $@ 2>&1 |
| 409 |
@-diff $(TEST.logdir)/$@ $@ 2>/dev/null \ |
| 410 |
&& rm $@ \ |
| 411 |
|| mv $@ $(_NEW.log) |
| 412 |
@-test -f $(TEST.logdir)/$@ || mv $(_NEW.log) $(TEST.logdir)/$@ |
| 413 |
@-ls -l $(TEST.logdir)/warnings-$(*)* |
| 414 |
# TODO: target should be unified with testcmd-%.log |
| 415 |
|
| 416 |
# $(_TEST.warning.log) calls "make -s" to avoid printing of executed commands |
| 417 |
_TEST.warning.log = $(TEST.logdir)/test.warnings.log-$(TEST.today) |
| 418 |
$(_TEST.warning.log): |
| 419 |
@echo "# $(_MYSELF.warnings) 1.73: $(MAKE) test.warnings.log" > $@ |
| 420 |
@$(MAKE) -s $(ALL.test.warnings) >> $@ 2>&1 |
| 421 |
|
| 422 |
# Target should create a new logfile, then compare it with the current one. If |
| 423 |
# diff returns nothing, delete newly created logfile, otherwise rename newly |
| 424 |
# created file to name which contains the current date. |
| 425 |
# Finally, If current logfile is/was missing, use newly created one: |
| 426 |
# "test ... || mv ..." . This ensures that the file exists afterwards. |
| 427 |
# FIXME: following target should have $(SRC.pl) as dependency, but that fails |
| 428 |
# if make is called from within ./t/ directory; hence no dependency |
| 429 |
test.warnings.log: $(_TEST.warning.log) |
| 430 |
@$(TRACE.target) |
| 431 |
@$(TRACE.target.log) |
| 432 |
@diff $(TEST.logdir)/$@ $(_TEST.warning.log) \ |
| 433 |
&& rm $(_TEST.warning.log) \ |
| 434 |
|| mv $(_TEST.warning.log) $(TEST.logdir)/$@ |
| 435 |
@-test -f $(TEST.logdir)/$@ || mv $(_TEST.warning.log) $(TEST.logdir)/$@ |
| 436 |
@ls -l $(TEST.logdir)/$@* |
| 437 |
# TODO: same target as test.cgi.log |
| 438 |
|
| 439 |
ALL.test.warnings.log = test.warnings.log |
| 440 |
|
| 441 |
test.warnings: $(ALL.test.warnings) |