Issue 27744: skip test if AF_ALG socket bind fails

This commit is contained in:
Christian Heimes 2016-09-06 11:14:09 +02:00
parent ea9b2dc9e3
commit 407380f63f
1 changed files with 5 additions and 1 deletions

View File

@ -5343,7 +5343,11 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
# tests for AF_ALG
def create_alg(self, typ, name):
sock = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0)
sock.bind((typ, name))
try:
sock.bind((typ, name))
except FileNotFoundError as e:
# type / algorithm is not available
raise unittest.SkipTest(str(e), typ, name)
return sock
def test_sha256(self):