blob: b8cb0c0436508ffb4e049a72585cbac7c5099efb [file] [log] [blame]
Roger E. Masse7eee08d1996-12-13 20:32:26 +00001#! /usr/bin/env python
2"""Test dlmodule.c
3 Roger E. Masse
4"""
5filename = '/usr/lib/libresolv.so'
6try:
7 import dl
8except ImportError:
9 # No test if no library
10 raise SystemExit
11
12try:
13 import os
14 n = os.popen('/bin/uname','r')
15 if n.readlines()[0][:-1] != 'SunOS':
16 raise SystemExit
17 l = dl.open('/usr/lib/libresolv.so')
18except:
19 # No test if not SunOS (or Solaris)
20 raise SystemExit
21
22# Try to open a shared library that should be available
23# on SunOS and Solaris in a default place
24try:
25 open(filename,'r')
26except IOError:
27 # No test if I can't even open the test file with builtin open
28 raise SystemExit
29
30l = dl.open(filename)
31a = l.call('gethostent')
32l.close()