]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Note skipped tests
authorGreg Hudson <ghudson@mit.edu>
Sun, 4 Jan 2015 01:14:31 +0000 (20:14 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 22 Jan 2015 23:58:27 +0000 (18:58 -0500)
In Python test scripts, use skipped() or skip_rest() as appropriate
when skipping tests.  For Makefile-conditionalized tests, append to
$(SKIPTESTS) when skipping.

src/kadmin/testing/util/Makefile.in
src/lib/krb5/ccache/t_cccol.py
src/lib/krb5/os/Makefile.in
src/lib/rpc/unit-test/Makefile.in
src/tests/dejagnu/Makefile.in
src/tests/t_ccache.py
src/tests/t_kdb.py
src/tests/t_otp.py
src/tests/t_pkinit.py
src/tests/t_proxy.py
src/tests/t_sn2princ.py

index 6bb6f60c0b8c071be7a15b9ca1e98240fa913c30..3d601776f4c46003eef2d3be137091ac3b445953 100644 (file)
@@ -23,6 +23,7 @@ all-::
        @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)
 
index e6d715cbaf1d76cfda0f0a9812153930e0d00464..f7f17856476cdec4b6e81f7c5251d31025129c1e 100644 (file)
@@ -7,6 +7,8 @@ keyctl = which('keyctl')
 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')])
index e8155beb19d6c3c2ea143630b7dfd54536c6c169..42f4a75d9d0ea8dfd5166f760cd9e4f656e54724 100644 (file)
@@ -220,9 +220,11 @@ check-unix-locate:: t_locate_kdc
                $(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
index b72487c68711f9fb6c383c2a7e93cb243665e5b3..0ba9984808abaa1688ec0035fe2917511a155d4e 100644 (file)
@@ -37,6 +37,7 @@ unit-test-:
        @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
 
index 2dd831d90096f761b546670e353f66096480ffe3..81df5747568400bfede3147c52fe0e5e07121363 100644 (file)
@@ -16,6 +16,7 @@ check-runtest-no::
        @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
index b33026e42f150433baa82e2dfeea954998d578b4..b1b53f7a3a46e2f6d29b801e12a5767be46d99ee 100644 (file)
@@ -29,6 +29,8 @@ keyctl = which('keyctl')
 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])
index a0bc096dac2c69ee0ce9fdb697190e75e4121f30..a52a49d78cb69c20879154642b5f305553eba0ab 100644 (file)
@@ -10,13 +10,11 @@ realm.run(['./kdbtest'])
 
 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')
@@ -114,8 +112,7 @@ kldaputil(['destroy', '-f'])
 
 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,
@@ -363,12 +360,10 @@ if out:
     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.
index c2ec48d2b691b18458f5cca0ca16b5d9f8de824f..defe5c7bf91fbc59b71a6c4dd5dfb860ea46ef9e 100644 (file)
@@ -37,10 +37,12 @@ import struct
 
 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.
@@ -198,9 +200,7 @@ try:
     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))
index 762e32276bcc607ff0a07881a04eebfe6a340f09..23889c4ab64ccdb0ce53b0314aba85adcdace55e 100644 (file)
@@ -3,8 +3,7 @@ from k5test import *
 
 # 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:
@@ -316,6 +315,6 @@ if have_soft_pkcs11:
     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')
index a9ba67e2c0dfe7d8f6a4b28f36bfd711d1fedd6e..4e86fce8fbca87a1a91ffae4c638447f845546be 100644 (file)
@@ -3,20 +3,15 @@ from k5test import *
 
 # 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.
index de6bb0e6a119fb02b939bdca98478a9b8883379d..4d27c6f5235b307c2d6a501ce6fe4f76029017ed 100644 (file)
@@ -62,12 +62,8 @@ testnc('example.com.:123', 'example.com:123', 'R2')
 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.
@@ -79,10 +75,11 @@ rname = 'kerberos-org.mit.edu'
 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')
@@ -93,9 +90,10 @@ testnr(oname + ':xyZ', fname + ':xyZ', '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')