diff options
Diffstat (limited to 'Lib/test/test_dl.py')
-rwxr-xr-x | Lib/test/test_dl.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Lib/test/test_dl.py b/Lib/test/test_dl.py new file mode 100755 index 0000000..b8cb0c04 --- /dev/null +++ b/Lib/test/test_dl.py @@ -0,0 +1,32 @@ +#! /usr/bin/env python +"""Test dlmodule.c + Roger E. Masse +""" +filename = '/usr/lib/libresolv.so' +try: + import dl +except ImportError: + # No test if no library + raise SystemExit + +try: + import os + n = os.popen('/bin/uname','r') + if n.readlines()[0][:-1] != 'SunOS': + raise SystemExit + l = dl.open('/usr/lib/libresolv.so') +except: + # No test if not SunOS (or Solaris) + raise SystemExit + +# Try to open a shared library that should be available +# on SunOS and Solaris in a default place +try: + open(filename,'r') +except IOError: + # No test if I can't even open the test file with builtin open + raise SystemExit + +l = dl.open(filename) +a = l.call('gethostent') +l.close() |