Skip to content

Commit

Permalink
tests: fix after adding -certfile CMS option
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Voronin <viktor.voronin@evologics.de>
  • Loading branch information
viktor-av authored and sbabic committed Nov 17, 2023
1 parent 9b45e2d commit 52a357e
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ def test_missing_config_file_throws_exception():

#### Signing option parsing tests ####
SIGNING_TEST_PARAMETERS = [
("CMS,foo,bar,baz", SWUSignCMS("foo", "bar", "baz")),
("CMS,foo,bar", SWUSignCMS("foo", "bar", None)),
("CMS,foo,bar,baz,qux", SWUSignCMS("foo", "bar", "baz", "qux")),
("CMS,foo,bar,,qux", SWUSignCMS("foo", "bar", "", "qux")),
("CMS,foo,bar,baz", SWUSignCMS("foo", "bar", "baz", None)),
("CMS,foo,bar", SWUSignCMS("foo", "bar", None, None)),
("RSA,foo,bar", SWUSignRSA("foo", "bar")),
("RSA,foo", SWUSignRSA("foo", None)),
("PKCS11,foo", SWUSignPKCS11("foo")),
Expand All @@ -108,19 +110,20 @@ def test_valid_siging_params_parsed_to_correct_signing_obj(arg, expected):


INVALID_SIGNING_TEST_PARAMETERS = [
("CMS", "CMS requires private key, certificate, and an optional password file"),
("CMS,", "CMS requires private key, certificate, and an optional password file"),
("CMS,,", "CMS requires private key, certificate, and an optional password file"),
("CMS,,,", "CMS requires private key, certificate, and an optional password file"),
("CMS,,,,", "CMS requires private key, certificate, and an optional password file"),
("CMS", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
("CMS,", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
("CMS,,", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
("CMS,,,", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
("CMS,,,,", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
("CMS,,,,,", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
(
"CMS,,foo,",
"CMS requires private key, certificate, and an optional password file",
"CMS requires private key, certificate, an optional password file and an optional file with additional certificates",
),
("CMS,foo", "CMS requires private key, certificate, and an optional password file"),
("CMS,foo", "CMS requires private key, certificate, an optional password file and an optional file with additional certificates"),
(
"CMS,foo,bar,baz,jaz",
"CMS requires private key, certificate, and an optional password file",
"CMS,foo,bar,baz,qux,jaz",
"CMS requires private key, certificate, an optional password file and an optional file with additional certificates",
),
("RSA,foo,bar,baz", "RSA requires private key and an optional password file"),
("PKCS11", "PKCS11 requires URI"),
Expand Down Expand Up @@ -153,7 +156,7 @@ def mock_extract_keys(*_):
return "foo", "bar"

def mock_parse_signing_option(*_):
return SWUSignCMS("foo", "bar", "baz")
return SWUSignCMS("foo", "bar", "baz", "qux")

def mock_parse_config_file(*_):
return {}
Expand Down

0 comments on commit 52a357e

Please sign in to comment.