Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acme-dns-tiny
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adrien Dorsaz
acme-dns-tiny
Commits
3330fc7e
Commit
3330fc7e
authored
Mar 18, 2018
by
Adrien Dorsaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test-acme-dns-tiny: add a test to check the --csr argument is well used
parent
c53c6a33
Pipeline
#184
failed with stage
in 17 minutes and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
tests/config_factory.py
tests/config_factory.py
+8
-3
tests/test_acme_dns_tiny.py
tests/test_acme_dns_tiny.py
+10
-0
No files found.
tests/config_factory.py
View file @
3330fc7e
...
...
@@ -90,8 +90,12 @@ def generate_acme_dns_tiny_config():
config
=
configparser
.
ConfigParser
()
config
.
read
(
goodCName
)
goodCNameWithoutCSR
=
NamedTemporaryFile
(
delete
=
False
)
del
config
[
"acmednstiny"
][
"CSRFile"
]
with
open
(
goodCNameWithoutCSR
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
wildCName
=
NamedTemporaryFile
(
delete
=
False
)
config
[
"acmednstiny"
][
"AccountKeyFile"
]
=
account_key
config
[
"acmednstiny"
][
"CSRFile"
]
=
wilddomain_csr
.
name
with
open
(
wildCName
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
...
...
@@ -103,13 +107,11 @@ def generate_acme_dns_tiny_config():
config
[
"DNS"
][
"Host"
]
=
DNSHOST
goodSAN
=
NamedTemporaryFile
(
delete
=
False
)
config
[
"acmednstiny"
][
"AccountKeyFile"
]
=
account_key
config
[
"acmednstiny"
][
"CSRFile"
]
=
san_csr
.
name
with
open
(
goodSAN
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
wildSAN
=
NamedTemporaryFile
(
delete
=
False
)
config
[
"acmednstiny"
][
"AccountKeyFile"
]
=
account_key
config
[
"acmednstiny"
][
"CSRFile"
]
=
wildsan_csr
.
name
with
open
(
wildSAN
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
...
...
@@ -139,6 +141,7 @@ def generate_acme_dns_tiny_config():
return
{
# configs
"goodCName"
:
goodCName
,
"goodCNameWithoutCSR"
:
goodCNameWithoutCSR
,
"wildCName"
:
wildCName
.
name
,
"dnsHostIP"
:
dnsHostIP
.
name
,
"goodSAN"
:
goodSAN
.
name
,
...
...
@@ -149,6 +152,8 @@ def generate_acme_dns_tiny_config():
"missingDNS"
:
missingDNS
.
name
,
# key (just to simply remove the account from staging server)
"accountkey"
:
account_key
,
# CName CSR file to use with goodCNameWithoutCSR
"cnameCSR"
:
domain_csr
,
}
# generate two account keys to roll over them
...
...
tests/test_acme_dns_tiny.py
View file @
3330fc7e
...
...
@@ -128,6 +128,16 @@ class TestACMEDNSTiny(unittest.TestCase):
self
.
assertCertificateChain
(
certchain
)
def
test_success_cli_with_csr_option
(
self
):
""" Successfully issue a certificate via command line interface using CSR option"""
certout
,
err
=
subprocess
.
Popen
([
"python3"
,
"acme_dns_tiny.py"
,
[
'--csr'
,
sefl
.
configs
[
'cnameCSR'
],
self
.
configs
[
'goodCNameWithoutCSR'
]]
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
).
communicate
()
certchain
=
certout
.
decode
(
"utf8"
)
self
.
assertCertificateChain
(
certchain
)
def
test_weak_key
(
self
):
""" Let's Encrypt rejects weak keys """
self
.
assertRaisesRegex
(
ValueError
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment