@echo "+++"
@echo "+++ WARNING: Tcl not available. The kadm5 tests will not be run."
@echo "+++"
+ @echo 'Skipped kadm5 tests: Tcl not found' >> $(SKIPTESTS)
all-tcl:: $(CLNTPROG) $(SRVPROG)
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
+if not test_keyring:
+ skipped('keyring collection tests', 'keyring support not built')
# Run the collection test program against each collection-enabled type.
realm.run(['./t_cccol', 'DIR:' + os.path.join(realm.testdir, 'cc')])
$(RUN_SETUP) $(VALGRIND) ./t_locate_kdc $(LOCREALM); \
else \
echo '*** WARNING: skipped t_locate_kdc test: known DNS name not found'; \
+ echo 'Skipped t_locate_kdc test: known DNS name found' >> $(SKIPTESTS); \
fi; \
else \
echo '*** WARNING: skipped t_locate_kdc test: OFFLINE'; \
+ echo 'Skipped t_locate_kdc test: OFFINE' >> $(SKIPTESTS); \
fi
check-unix-trace:: t_trace
@echo "+++ WARNING: lib/rpc unit tests not run."
@echo "+++ Either tcl, runtest, or Perl is unavailable."
@echo "+++"
+ @echo 'Skipped rpc tests: runtest or Perl not found' >> $(SKIPTESTS)
unit-test-ok:: unit-test-body
@echo "+++ WARNING: tests/dejagnu tests not run."
@echo "+++ runtest is unavailable."
@echo "+++"
+ @echo 'Skipped dejagnu tests: runtest not found' >> $(SKIPTESTS)
# Set VALGRIND at run time, that may be changed when running 'make'.
check-runtest-yes:: t_inetd site.exp
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
+if not test_keyring:
+ skipped('keyring ccache tests', 'keyring support not built')
# Test kdestroy and klist of a non-existent ccache.
realm.run([kdestroy])
if (not os.path.exists(os.path.join(plugins, 'kdb', 'kldap.so')) and
not os.path.exists(os.path.join(buildtop, 'lib', 'libkdb_ldap.a'))):
- success('Warning: not testing LDAP back end because it is not built')
- exit(0)
+ skip_rest('LDAP KDB tests', 'LDAP KDB module not built')
system_slapd = which('slapd')
if not system_slapd:
- success('Warning: not testing LDAP module because slapd not found')
- exit(0)
+ skip_rest('LDAP KDB tests', 'slapd not found')
ldapdir = os.path.abspath('ldap')
slapd = os.path.join(ldapdir, 'slapd')
ldapmodify = which('ldapmodify')
if not ldapmodify:
- success('Warning: skipping some LDAP tests because ldapmodify not found')
- exit(0)
+ skip_rest('some LDAP KDB tests', 'ldapmodify not found')
def ldap_modify(ldif, args=[]):
proc = subprocess.Popen([ldapmodify, '-H', ldap_uri, '-D', admin_dn,
fail('Unexpected kdb5_ldap_util list output after destroy')
if not core_schema:
- success('Warning: skipping some LDAP tests because core schema not found')
- sys.exit(0)
+ skip_rest('LDAP SASL tests', 'core schema not found')
if runenv.have_sasl != 'yes':
- success('Warning: skipping some LDAP tests because SASL support not built')
- sys.exit(0)
+ skip_rest('LDAP SASL tests', 'SASL support not built')
# Test SASL EXTERNAL auth. Remove the DNs and service password file
# from the DB module config.
try:
from pyrad import packet, dictionary
+except ImportError:
+ skip_rest('OTP tests', 'Python pyrad module not found')
+try:
from multiprocessing import Process, Queue
except ImportError:
- success('Warning: skipping OTP tests due to missing pyrad or old Python')
- exit(0)
+ skip_rest('OTP tests', 'Python version 2.6 required')
# We could use a dictionary file, but since we need so few attributes,
# we'll just include them here.
auth = packet.Packet.CreateAuthenticator()
packet.Packet(authenticator=auth, secret="").ReplyPacket()
except AssertionError:
- success('Warning: skipping UNIX domain socket tests because of pyrad '
- 'assertion bug')
- exit(0)
+ skip_rest('OTP UNIX domain socket tests', 'pyrad assertion bug detected')
## Test Unix fail / custom username
daemon = UnixRadiusDaemon(args=(socket_file, '', 'accept', queue))
# Skip this test if pkinit wasn't built.
if not os.path.exists(os.path.join(plugins, 'preauth', 'pkinit.so')):
- success('Warning: not testing pkinit because it is not built')
- exit(0)
+ skip_rest('PKINIT tests', 'PKINIT module not built')
# Check if soft-pkcs11.so is available.
try:
realm.klist('user@%s' % realm.realm)
realm.run([kvno, realm.host_princ])
else:
- output('soft-pkcs11.so not found: skipping tests with PKCS11 identities\n')
+ skipped('PKINIT PKCS11 tests', 'soft-pkcs11.so not found')
success('Authenticated PKINIT')
# Skip this test if we're missing proxy functionality or parts of the proxy.
if runenv.tls_impl == 'no':
- success('Warning: not testing proxy support because TLS was not enabled')
- exit(0)
+ skip_rest('HTTP proxy tests', 'TLS build support not enabled')
try:
from paste import httpserver
except:
- success('Warning: not testing proxy support because python ' +
- 'paste.httpserver module not found')
- exit(0)
+ skip_rest('HTTP proxy tests', 'Python paste module not found')
try:
import kdcproxy
except:
- success('Warning: not testing proxy support because python ' +
- 'kdcproxy module not found')
- exit(0)
+ skip_rest('HTTP proxy tests', 'Python kdcproxy module not found')
# Construct a krb5.conf fragment configuring the client to use a local proxy
# server.
testnc('Example.COM:xyZ', 'example.com:xyZ', 'R2')
testnc('example.com.::123', 'example.com.::123', '')
-def skip_rest(msg):
- success('Warning: skipping online krb5_sname_to_principal tests: %s' % msg)
- sys.exit(0)
-
if offline:
- skip_rest('offline mode requested')
+ skip_rest('sn2princ tests', 'offline mode requested')
# For the online tests, we rely on ptr-mismatch.kerberos.org forward
# and reverse resolving to these names.
try:
ai = socket.getaddrinfo(oname, None, 0, 0, 0, socket.AI_CANONNAME)
except socket.gaierror:
- skip_rest('cannot forward resolve %s' % oname)
+ skip_rest('sn2princ tests', 'cannot forward resolve %s' % oname)
(family, socktype, proto, canonname, sockaddr) = ai[0]
if canonname.lower() != fname:
- skip_rest('%s forward resolves to %s, not %s' % (oname, canonname, fname))
+ skip_rest('sn2princ tests',
+ '%s forward resolves to %s, not %s' % (oname, canonname, fname))
# Test forward-only canonicalization (rdns=false).
testnr(oname, fname, 'R1')
try:
names = socket.getnameinfo(sockaddr, socket.NI_NAMEREQD)
except socket.gaierror:
- skip_rest('cannot reverse resolve %s' % oname)
+ skip_rest('reverse sn2princ tests', 'cannot reverse resolve %s' % oname)
if names[0].lower() != rname:
- skip_rest('%s reverse resolves to %s, not %s' % (oname, names[0], rname))
+ skip_rest('reverse sn2princ tests',
+ '%s reverse resolves to %s, not %s' % (oname, names[0], rname))
# Test default canonicalization (forward and reverse lookup).
test(oname, rname, 'R3')