Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
9e673d8e
Commit
9e673d8e
authored
Nov 08, 2021
by
Boxiang Sun
Committed by
Vincent Pelletier
Nov 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caucase.test: get IP address from CAUCASE_LOC instead of hardcode IP
parent
aa090b76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
caucase/test.py
caucase/test.py
+24
-2
No files found.
caucase/test.py
View file @
9e673d8e
...
@@ -3439,7 +3439,18 @@ class CaucaseTest(TestCase):
...
@@ -3439,7 +3439,18 @@ class CaucaseTest(TestCase):
"""
"""
Test that it is possible to use a literal IPv4 as netloc.
Test that it is possible to use a literal IPv4 as netloc.
"""
"""
self
.
_testHttpCustomNetLoc
(
netloc
=
'127.0.0.1'
)
parsed_url
=
urllib_parse
.
urlparse
(
self
.
_caucase_url
)
try
:
# pylint: disable=unused-variable
family
,
socktype
,
proto
,
canonname
,
(
address
,
port
)
=
socket
.
getaddrinfo
(
parsed_url
.
hostname
,
None
,
socket
.
AF_INET
,
socket
.
SOCK_STREAM
,
)[
0
]
# Any is fine, pick the first one
# pylint: enable=unused-variable
except
socket
.
gaierror
:
# pragma: no cover
raise
unittest
.
SkipTest
(
"Cannot resolve %r as AF_INET"
%
(
parsed_url
.
hostname
,
)
)
self
.
_testHttpCustomNetLoc
(
netloc
=
address
)
def
testHttpNetlocIPv6
(
self
):
def
testHttpNetlocIPv6
(
self
):
"""
"""
...
@@ -3447,7 +3458,18 @@ class CaucaseTest(TestCase):
...
@@ -3447,7 +3458,18 @@ class CaucaseTest(TestCase):
This used to fail because cryptography module would reject bare IPv6
This used to fail because cryptography module would reject bare IPv6
address in CRL distribution point extension (unlike IPv4).
address in CRL distribution point extension (unlike IPv4).
"""
"""
self
.
_testHttpCustomNetLoc
(
netloc
=
'[::1]'
)
parsed_url
=
urllib_parse
.
urlparse
(
self
.
_caucase_url
)
try
:
# pylint: disable=unused-variable
family
,
socktype
,
proto
,
canonname
,
(
address
,
port
,
flowinfo
,
scope_id
)
=
socket
.
getaddrinfo
(
parsed_url
.
hostname
,
None
,
socket
.
AF_INET6
,
socket
.
SOCK_STREAM
,
)[
0
]
# Any is fine, pick the first one
# pylint: enable=unused-variable
except
socket
.
gaierror
:
# pragma: no cover
raise
unittest
.
SkipTest
(
"Cannot resolve %r as AF_INET6"
%
(
parsed_url
.
hostname
,
)
)
self
.
_testHttpCustomNetLoc
(
netloc
=
'['
+
address
+
']'
)
def
testServerFilePermissions
(
self
):
def
testServerFilePermissions
(
self
):
"""
"""
...
...
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