Skip to content

Commit

Permalink
chore(tests) format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Dec 20, 2023
1 parent 073c943 commit c8745f9
Show file tree
Hide file tree
Showing 29 changed files with 1,098 additions and 615 deletions.
35 changes: 22 additions & 13 deletions scripts/templates/x509_tests.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{%- set ns = namespace(idx=test_idx) %}
{%- for f in module.fields %}
{%- if f.type in tests.types and not f.skip_tests%}



{%+ set ns = namespace(idx=test_idx) -%}
{%- for f in module.fields -%}
{%- if f.type in tests.types and not f.skip_tests -%}
=== TEST {{ ns.idx }}: {{ modname }}:get_{{ f.field }} (AUTOGEN)
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -24,9 +26,10 @@
"{{ f.sample_printable }}"
--- no_error_log
[error]
{%- set ns.idx = ns.idx + 1 %}

=== TEST {{ ns.idx }}: {{ modname }}:set_{{ f.field }} (AUTOGEN)


=== TEST {{ ns.idx + 1 }}: {{ modname }}:set_{{ f.field }} (AUTOGEN)
--- http_config eval: $::HttpConfig
--- config
location =/t {
Expand Down Expand Up @@ -61,11 +64,14 @@
"ok"
--- no_error_log
[error]
{%- set ns.idx = ns.idx + 1 %}
{%- endif %}
{%- if f.extension_nid and not f.skip_tests %}

=== TEST {{ ns.idx + 1 }}: {{ modname }}:get/set_{{ f.field }}_critical (AUTOGEN)


{%+ set nop=1 -%}
{%- set ns.idx = ns.idx + 2 -%}
{%- endif -%}
{%- if f.extension_nid and not f.skip_tests -%}
=== TEST {{ ns.idx }}: {{ modname }}:get/set_{{ f.field }}_critical (AUTOGEN)
--- http_config eval: $::HttpConfig
--- config
location =/t {
Expand All @@ -86,11 +92,14 @@
true
--- no_error_log
[error]
{%- set ns.idx = ns.idx + 1 %}
{%- endif %}
{%- endfor %}

=== TEST {{ ns.idx + 1 }}: {{ modname }}:get_get_signature_name (AUTOGEN)


{%+ set nop=1 -%}
{%- set ns.idx = ns.idx + 1 -%}
{%- endif -%}
{%- endfor -%}
=== TEST {{ ns.idx }}: {{ modname }}:get_signature_name (AUTOGEN)
--- http_config eval: $::HttpConfig
--- config
location =/t {
Expand Down
7 changes: 7 additions & 0 deletions t/fips.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ our $HttpConfig = qq{
run_tests();

__DATA__

=== TEST 1: FIPS mode can be turned on and off
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -51,6 +52,8 @@ false
--- no_error_log
[error]



=== TEST 2: CIPHER, MD and PKEY provider is directed to fips
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -77,6 +80,8 @@ fips
--- no_error_log
[error]



=== TEST 3: Non-FIPS compliant algorithms are not allowed
--- http_config eval: $::HttpConfig
--- config
Expand Down Expand Up @@ -122,6 +127,8 @@ true
--- no_error_log
[error]



=== TEST 4: Get FIPS version text
--- http_config eval: $::HttpConfig
--- config
Expand Down
11 changes: 11 additions & 0 deletions t/openssl.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ our $HttpConfig = qq{
run_tests();

__DATA__

=== TEST 1: Load ffi openssl library
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -42,6 +43,7 @@ __DATA__
[error]



=== TEST 2: Luaossl compat pattern
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -64,6 +66,7 @@ false
[error]



=== TEST 3: List cipher algorithms
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -87,6 +90,8 @@ false
--- no_error_log
[error]



=== TEST 4: List digest algorithms
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -110,6 +115,8 @@ false
--- no_error_log
[error]



=== TEST 5: List mac algorithms
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -131,6 +138,8 @@ false
--- no_error_log
[error]



=== TEST 6: List kdf algorithms
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -152,6 +161,8 @@ false
--- no_error_log
[error]



=== TEST 7: List SSL cipher
--- http_config eval: $::HttpConfig
--- config
Expand Down
9 changes: 9 additions & 0 deletions t/openssl/asn1.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ our $HttpConfig = qq{
run_tests();

__DATA__
=== TEST 1: asn1_to_unix utctime
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -43,6 +44,8 @@ __DATA__
--- no_error_log
[error]
=== TEST 2: asn1_to_unix utctime, offset
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -65,6 +68,8 @@ __DATA__
--- no_error_log
[error]
=== TEST 3: asn1_to_unix generalized time
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -87,6 +92,8 @@ __DATA__
--- no_error_log
[error]
=== TEST 4: asn1_to_unix generalized time, offset
--- http_config eval: $::HttpConfig
--- config
Expand All @@ -109,6 +116,8 @@ __DATA__
--- no_error_log
[error]
=== TEST 5: asn1_to_unix error on bad format
--- http_config eval: $::HttpConfig
--- config
Expand Down
Loading

0 comments on commit c8745f9

Please sign in to comment.