diff options
| author | Niklas Hambüchen <mail@nh2.me> | 2017-05-13 18:54:36 +0200 | 
|---|---|---|
| committer | Amar Tumballi <amarts@redhat.com> | 2018-03-24 05:10:31 +0000 | 
| commit | 0056feaa21489910fa4ef18668602e1f0967ea6c (patch) | |
| tree | 3094a6498469efbb4a12ddffe3f5c97b086dfcec /tests | |
| parent | aaa4e373f3c7093fa13d0882a034f35aba2761a1 (diff) | |
python: Remove all uses of find_library. Fixes #1450593
`find_library()` doesn't consider LD_LIBRARY_PATH on Python < 3.6.
Change-Id: Iee26085cb5d14061001f19f032c2664d69a378a8
BUG: 1450593
Signed-off-by: Niklas Hambüchen <mail@nh2.me>
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/features/ipctest.py | 10 | ||||
| -rw-r--r-- | tests/utils/libcxattr.py | 5 | 
2 files changed, 4 insertions, 11 deletions
diff --git a/tests/features/ipctest.py b/tests/features/ipctest.py index 5aff319b8d0..93392486140 100755 --- a/tests/features/ipctest.py +++ b/tests/features/ipctest.py @@ -1,14 +1,8 @@  #!/usr/bin/python  import ctypes -import ctypes.util - -# find_library does not lookup LD_LIBRARY_PATH and may miss the -# function. In that case, retry with less portable but explicit name. -libgfapi = ctypes.util.find_library("gfapi") -if libgfapi == None: -	libgfapi = "libgfapi.so" -api = ctypes.CDLL(libgfapi,mode=ctypes.RTLD_GLOBAL) + +api = ctypes.CDLL("libgfapi.so",mode=ctypes.RTLD_GLOBAL)  api.glfs_ipc.argtypes = [ ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p ]  api.glfs_ipc.restype = ctypes.c_int diff --git a/tests/utils/libcxattr.py b/tests/utils/libcxattr.py index 149db72e6ee..4e6e6c46df9 100644 --- a/tests/utils/libcxattr.py +++ b/tests/utils/libcxattr.py @@ -11,7 +11,6 @@  import os  import sys  from ctypes import CDLL, c_int, create_string_buffer -from ctypes.util import find_library  class Xattr(object): @@ -28,9 +27,9 @@ class Xattr(object):      if sys.hexversion >= 0x02060000:          from ctypes import DEFAULT_MODE -        libc = CDLL(find_library("libc"), DEFAULT_MODE, None, True) +        libc = CDLL("libc.so.6", DEFAULT_MODE, None, True)      else: -        libc = CDLL(find_library("libc")) +        libc = CDLL("libc.so.6")      @classmethod      def geterrno(cls):  | 
