diff options
Diffstat (limited to 'src/tests/t_general.py')
-rwxr-xr-x | src/tests/t_general.py | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/tests/t_general.py b/src/tests/t_general.py index 6d523fe4513d..91ad0cb8a060 100755 --- a/src/tests/t_general.py +++ b/src/tests/t_general.py @@ -3,10 +3,9 @@ from k5test import * for realm in multipass_realms(create_host=False): # Check that kinit fails appropriately with the wrong password. - output = realm.run([kinit, realm.user_princ], input='wrong\n', - expected_code=1) - if 'Password incorrect while getting initial credentials' not in output: - fail('Expected error message not seen in kinit output') + msg = 'Password incorrect while getting initial credentials' + realm.run([kinit, realm.user_princ], input='wrong\n', expected_code=1, + expected_msg=msg) # Check that we can kinit as a different principal. realm.kinit(realm.admin_princ, password('admin')) @@ -30,6 +29,7 @@ conf={'plugins': {'pwqual': {'disable': 'empty'}}} realm = K5Realm(create_user=False, create_host=False, krb5_conf=conf) realm.run([kadminl, 'addprinc', '-pw', '', 'user']) realm.run(['./icred', 'user', '']) +realm.run(['./icred', '-s', 'user', '']) realm.stop() realm = K5Realm(create_host=False) @@ -42,26 +42,17 @@ realm.run(['./responder', '-r', 'password=%s' % password('user'), # Test that WRONG_REALM responses aren't treated as referrals unless # they contain a crealm field pointing to a different realm. # (Regression test for #8060.) -out = realm.run([kinit, '-C', 'notfoundprinc'], expected_code=1) -if 'not found in Kerberos database' not in out: - fail('Expected error message not seen in kinit -C output') +realm.run([kinit, '-C', 'notfoundprinc'], expected_code=1, + expected_msg='not found in Kerberos database') # Spot-check KRB5_TRACE output -tracefile = os.path.join(realm.testdir, 'trace') -realm.run(['env', 'KRB5_TRACE=' + tracefile, kinit, realm.user_princ], - input=(password('user') + "\n")) -f = open(tracefile, 'r') -trace = f.read() -f.close() -expected = ('Sending initial UDP request', - 'Received answer', - 'Selected etype info', - 'AS key obtained', - 'Decrypted AS reply', - 'FAST negotiation: available', - 'Storing user@KRBTEST.COM') -for e in expected: - if e not in trace: - fail('Expected output not in kinit trace log') +expected_trace = ('Sending initial UDP request', + 'Received answer', + 'Selected etype info', + 'AS key obtained', + 'Decrypted AS reply', + 'FAST negotiation: available', + 'Storing user@KRBTEST.COM') +realm.kinit(realm.user_princ, password('user'), expected_trace=expected_trace) success('FAST kinit, trace logging') |