aboutsummaryrefslogtreecommitdiff
path: root/tcl_tests
diff options
context:
space:
mode:
authorVitaly Chikunov <vt@altlinux.org>2024-03-22 05:12:53 +0300
committerVitaly Chikunov <vt@altlinux.org>2024-03-22 05:26:24 +0300
commit27245fdabff573bb85d6aeb2e228a854170296ee (patch)
treecc25ab288be970f74bb2a1af89a5af0ff75f4785 /tcl_tests
parente0a500ab877ba72cb14026a24d462dd923b90ced (diff)
downloadgost-engine-27245fdabff573bb85d6aeb2e228a854170296ee.zip
gost-engine-27245fdabff573bb85d6aeb2e228a854170296ee.tar.gz
gost-engine-27245fdabff573bb85d6aeb2e228a854170296ee.tar.bz2
tcl_tests: Introduce new exitStatus -1 to ignore exit codes
It's proposed[1] that crl and req change exit code making it unreliable for some commands. Allow tests to ignore exit codes by specifying expected exit code `-1`. This will also make such tests to always use regexp match mode. Also, slightly fix the logic of applying regexp. Commentary says test _parameter_ (`exitStatus`) 1 is used to trigger regexp matching but in fact actual command exit code (`status`) 1 is used for that. This change did not cause any test result difference. Link: https://github.com/openssl/openssl/pull/23773 Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Diffstat (limited to 'tcl_tests')
-rw-r--r--tcl_tests/test.tcl3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcl_tests/test.tcl b/tcl_tests/test.tcl
index e281f1a..276db7e 100644
--- a/tcl_tests/test.tcl
+++ b/tcl_tests/test.tcl
@@ -198,7 +198,8 @@ namespace eval test {
set timestamp "$teststart+[expr $testend-$teststart]"
}
}
- if {$status!=$exitStatus || ($status==1?![regexp --\
+ if {($exitStatus!=-1 && $status!=$exitStatus) ||
+ ($exitStatus!=0?![regexp --\
[rus $expectedResult] $result]:([info exists opts(-time)]?\
![listcompare $result $expectedResult $opts(-time)]:\
[string compare "$result" "$expectedResult"]))} {