]> granicus.if.org Git - python/commitdiff
Issue 27744: skip test if AF_ALG socket bind fails
authorChristian Heimes <christian@python.org>
Tue, 6 Sep 2016 09:14:09 +0000 (11:14 +0200)
committerChristian Heimes <christian@python.org>
Tue, 6 Sep 2016 09:14:09 +0000 (11:14 +0200)
Lib/test/test_socket.py

index 71837143c594901d16f4ff880571a6e514cf61fb..b3632e9af9fc3c7665f10349d7411117c3b1fcb5 100644 (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):