Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4837141d
Commit
4837141d
authored
Sep 06, 2016
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 27744: Check for AF_ALG support in Kernel
parent
3cebf938
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
Lib/test/test_socket.py
Lib/test/test_socket.py
+14
-1
No files found.
Lib/test/test_socket.py
View file @
4837141d
...
...
@@ -65,10 +65,22 @@ def _have_socket_rds():
s
.
close
()
return
True
def
_have_socket_alg
():
"""Check whether AF_ALG sockets are supported on this host."""
try
:
s
=
socket
.
socket
(
socket
.
AF_ALG
,
socket
.
SOCK_SEQPACKET
,
0
)
except
(
AttributeError
,
OSError
):
return
False
else
:
s
.
close
()
return
True
HAVE_SOCKET_CAN
=
_have_socket_can
()
HAVE_SOCKET_RDS
=
_have_socket_rds
()
HAVE_SOCKET_ALG
=
_have_socket_alg
()
# Size in bytes of the int type
SIZEOF_INT
=
array
.
array
(
"i"
).
itemsize
...
...
@@ -5325,7 +5337,8 @@ class SendfileUsingSendfileTest(SendfileUsingSendTest):
def
meth_from_sock
(
self
,
sock
):
return
getattr
(
sock
,
"_sendfile_use_sendfile"
)
@
unittest
.
skipUnless
(
hasattr
(
socket
,
"AF_ALG"
),
'AF_ALG required'
)
@
unittest
.
skipUnless
(
HAVE_SOCKET_ALG
,
'AF_ALG required'
)
class
LinuxKernelCryptoAPI
(
unittest
.
TestCase
):
# tests for AF_ALG
def
create_alg
(
self
,
typ
,
name
):
...
...
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