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
e41a13cf
Commit
e41a13cf
authored
Aug 24, 2016
by
Adrien Dorsaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add invalid TSIG test to confirm a failure is raised if key name isn't the good one
parent
bc954b24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
tests/monkey.py
tests/monkey.py
+6
-0
tests/test_module.py
tests/test_module.py
+9
-0
No files found.
tests/monkey.py
View file @
e41a13cf
...
...
@@ -88,6 +88,11 @@ def gen_configs():
with
open
(
accountAsDomain
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
invalidTSIGName
=
NamedTemporaryFile
()
config
[
"TSIGKeyring"
][
"KeyName"
]
=
"{0}.invalid"
.
format
(
TSIGKEYNAME
)
with
open
(
invalidTSIGName
.
name
,
'w'
)
as
configfile
:
config
.
write
(
configfile
)
missingDNS
=
NamedTemporaryFile
()
config
[
"DNS"
]
=
{}
with
open
(
missingDNS
.
name
,
'w'
)
as
configfile
:
...
...
@@ -99,6 +104,7 @@ def gen_configs():
"goodSAN"
:
goodSAN
,
"weakKey"
:
weakKey
,
"accountAsDomain"
:
accountAsDomain
,
"invalidTSIGName"
:
invalidTSIGName
,
"missingDNS"
:
missingDNS
,
"key"
:
{
"accountkey"
:
account_key
,
"weakkey"
:
weak_key
,
...
...
tests/test_module.py
View file @
e41a13cf
...
...
@@ -83,6 +83,15 @@ class TestModule(unittest.TestCase):
self
.
assertIsInstance
(
result
,
ValueError
)
self
.
assertIn
(
"Certificate public key must be different than account key"
,
result
.
args
[
0
])
def
test_failure_dns_update_tsigkeyname
(
self
):
""" Fail to update DNS records by invalid TSIG Key name """
try
:
result
=
acme_dns_tiny
.
main
([
CONFIGS
[
'invalidTSIGName'
].
name
])
except
Exception
as
e
:
result
=
e
self
.
assertIsInstance
(
result
,
ValueError
)
self
.
assertIn
(
"Error updating DNS"
,
result
.
args
[
0
])
def
test_failure_notcompleted_configuration
(
self
):
""" Configuration file have to be completed """
try
:
...
...
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