summaryrefslogtreecommitdiff
path: root/src/appl/gss-sample/t_gss_sample.py
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2018-04-03 19:36:00 +0000
committerCy Schubert <cy@FreeBSD.org>2018-04-03 19:36:00 +0000
commitb0e4d68d5124581ae353493d69bea352de4cff8a (patch)
tree43300ec43e83eccd367fd76fdfdefba2dcd7d8f4 /src/appl/gss-sample/t_gss_sample.py
parent33a9b234e7087f573ef08cd7318c6497ba08b439 (diff)
Notes
Diffstat (limited to 'src/appl/gss-sample/t_gss_sample.py')
-rwxr-xr-xsrc/appl/gss-sample/t_gss_sample.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/appl/gss-sample/t_gss_sample.py b/src/appl/gss-sample/t_gss_sample.py
index 8a6b0304f890..0299e45904b8 100755
--- a/src/appl/gss-sample/t_gss_sample.py
+++ b/src/appl/gss-sample/t_gss_sample.py
@@ -31,22 +31,20 @@ gss_server = os.path.join(appdir, 'gss-server')
# Run a gss-server process and a gss-client process, with additional
# gss-client flags given by options and additional gss-server flags
# given by server_options. Return the output of gss-client.
-def run_client_server(realm, options, server_options, expected_code=0):
+def run_client_server(realm, options, server_options, **kwargs):
portstr = str(realm.server_port())
server_args = [gss_server, '-export', '-port', portstr]
server_args += server_options + ['host']
server = realm.start_server(server_args, 'starting...')
- out = realm.run([gss_client, '-port', portstr] + options +
- [hostname, 'host', 'testmsg'], expected_code=expected_code)
+ realm.run([gss_client, '-port', portstr] + options +
+ [hostname, 'host', 'testmsg'], **kwargs)
stop_daemon(server)
- return out
# Run a gss-server and gss-client process, and verify that gss-client
# displayed the expected output for a successful negotiation.
def server_client_test(realm, options, server_options):
- out = run_client_server(realm, options, server_options)
- if 'Signature verified.' not in out:
- fail('Expected message not seen in gss-client output')
+ run_client_server(realm, options, server_options,
+ expected_msg='Signature verified.')
# Make up a filename to hold user's initial credentials.
def ccache_savefile(realm):
@@ -81,10 +79,10 @@ def pw_test(realm, options, server_options=[]):
# IAKERB, gss_aqcuire_cred_with_password() otherwise).
def wrong_pw_test(realm, options, server_options=[], iakerb=False):
options = options + ['-user', realm.user_princ, '-pass', 'wrongpw']
- out = run_client_server(realm, options, server_options, expected_code=1)
failed_op = 'initializing context' if iakerb else 'acquiring creds'
- if 'GSS-API error ' + failed_op not in out:
- fail('Expected error not seen in gss-client output')
+ msg = 'GSS-API error ' + failed_op
+ run_client_server(realm, options, server_options, expected_code=1,
+ expected_msg=msg)
# Perform a test of the server and client with initial credentials
# obtained with the client keytab