Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kedifa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
kedifa
Commits
4b187130
Commit
4b187130
authored
Jun 24, 2020
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Follow-up upcoming caucase API changes.
parent
91525e37
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
kedifa/test.py
kedifa/test.py
+16
-17
No files found.
kedifa/test.py
View file @
4b187130
...
@@ -61,17 +61,6 @@ def findFreeTCPPort(ip=''):
...
@@ -61,17 +61,6 @@ def findFreeTCPPort(ip=''):
return
str
(
s
.
getsockname
()[
1
])
return
str
(
s
.
getsockname
()[
1
])
@
contextlib
.
contextmanager
def
captured_output
():
new_out
,
new_err
=
StringIO
(),
StringIO
()
old_out
,
old_err
=
sys
.
stdout
,
sys
.
stderr
try
:
sys
.
stdout
,
sys
.
stderr
=
new_out
,
new_err
yield
sys
.
stdout
,
sys
.
stderr
finally
:
sys
.
stdout
,
sys
.
stderr
=
old_out
,
old_err
class
KedifaMixin
(
object
):
class
KedifaMixin
(
object
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
testdir
=
tempfile
.
mkdtemp
()
self
.
testdir
=
tempfile
.
mkdtemp
()
...
@@ -200,10 +189,15 @@ class KedifaMixinCaucase(KedifaMixin):
...
@@ -200,10 +189,15 @@ class KedifaMixinCaucase(KedifaMixin):
self
.
cas
=
cas
.
split
()
self
.
cas
=
cas
.
split
()
kedifa_key_pem
,
csr_file
=
self
.
generateCSR
(
unicode
(
common_name
))
kedifa_key_pem
,
csr_file
=
self
.
generateCSR
(
unicode
(
common_name
))
with
captured_output
()
as
(
out
,
err
):
out
=
StringIO
()
caucase
.
cli
.
main
(
argv
=
self
.
cas
+
[
err
=
StringIO
()
caucase
.
cli
.
main
(
argv
=
self
.
cas
+
[
'--send-csr'
,
csr_file
'--send-csr'
,
csr_file
])
],
stdout
=
out
,
stderr
=
err
,
)
self
.
assertEqual
(
''
,
err
.
getvalue
().
strip
())
self
.
assertEqual
(
''
,
err
.
getvalue
().
strip
())
output
=
out
.
getvalue
().
strip
()
output
=
out
.
getvalue
().
strip
()
...
@@ -439,10 +433,15 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -439,10 +433,15 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
raise
raise
def
revokeCaucaseServiceCertifice
(
self
):
def
revokeCaucaseServiceCertifice
(
self
):
with
captured_output
()
as
(
out
,
err
):
out
=
StringIO
()
caucase
.
cli
.
main
(
argv
=
self
.
cas
+
[
err
=
StringIO
()
caucase
.
cli
.
main
(
argv
=
self
.
cas
+
[
'--revoke-crt'
,
self
.
client_key_pem
,
self
.
client_key_pem
'--revoke-crt'
,
self
.
client_key_pem
,
self
.
client_key_pem
])
],
stdout
=
out
,
stderr
=
err
,
)
self
.
assertEqual
(
''
,
out
.
getvalue
().
strip
())
self
.
assertEqual
(
''
,
out
.
getvalue
().
strip
())
self
.
assertEqual
(
''
,
err
.
getvalue
().
strip
())
self
.
assertEqual
(
''
,
err
.
getvalue
().
strip
())
...
...
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