summaryrefslogtreecommitdiff
path: root/src/tests/t_kadmin_parsing.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/tests/t_kadmin_parsing.py
parent33a9b234e7087f573ef08cd7318c6497ba08b439 (diff)
Notes
Diffstat (limited to 'src/tests/t_kadmin_parsing.py')
-rw-r--r--src/tests/t_kadmin_parsing.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/tests/t_kadmin_parsing.py b/src/tests/t_kadmin_parsing.py
index 92d72d2b08a8a..8de387c647a34 100644
--- a/src/tests/t_kadmin_parsing.py
+++ b/src/tests/t_kadmin_parsing.py
@@ -57,33 +57,27 @@ realm = K5Realm(create_host=False, get_creds=False)
realm.run([kadminl, 'addpol', 'pol'])
for instr, outstr in intervals:
realm.run([kadminl, 'modprinc', '-maxlife', instr, realm.user_princ])
- out = realm.run([kadminl, 'getprinc', realm.user_princ])
- if 'Maximum ticket life: ' + outstr + '\n' not in out:
- fail('princ maxlife: ' + instr)
+ msg = 'Maximum ticket life: ' + outstr + '\n'
+ realm.run([kadminl, 'getprinc', realm.user_princ], expected_msg=msg)
realm.run([kadminl, 'modprinc', '-maxrenewlife', instr, realm.user_princ])
- out = realm.run([kadminl, 'getprinc', realm.user_princ])
- if 'Maximum renewable life: ' + outstr + '\n' not in out:
- fail('princ maxrenewlife: ' + instr)
+ msg = 'Maximum renewable life: ' + outstr + '\n'
+ realm.run([kadminl, 'getprinc', realm.user_princ], expected_msg=msg)
realm.run([kadminl, 'modpol', '-maxlife', instr, 'pol'])
- out = realm.run([kadminl, 'getpol', 'pol'])
- if 'Maximum password life: ' + outstr + '\n' not in out:
- fail('pol maxlife: ' + instr)
+ msg = 'Maximum password life: ' + outstr + '\n'
+ realm.run([kadminl, 'getpol', 'pol'], expected_msg=msg)
realm.run([kadminl, 'modpol', '-minlife', instr, 'pol'])
- out = realm.run([kadminl, 'getpol', 'pol'])
- if 'Minimum password life: ' + outstr + '\n' not in out:
- fail('pol maxlife: ' + instr)
+ msg = 'Minimum password life: ' + outstr + '\n'
+ realm.run([kadminl, 'getpol', 'pol'], expected_msg=msg)
realm.run([kadminl, 'modpol', '-failurecountinterval', instr, 'pol'])
- out = realm.run([kadminl, 'getpol', 'pol'])
- if 'Password failure count reset interval: ' + outstr + '\n' not in out:
- fail('pol maxlife: ' + instr)
+ msg = 'Password failure count reset interval: ' + outstr + '\n'
+ realm.run([kadminl, 'getpol', 'pol'], expected_msg=msg)
realm.run([kadminl, 'modpol', '-lockoutduration', instr, 'pol'])
- out = realm.run([kadminl, 'getpol', 'pol'])
- if 'Password lockout duration: ' + outstr + '\n' not in out:
- fail('pol maxlife: ' + instr)
+ msg = 'Password lockout duration: ' + outstr + '\n'
+ realm.run([kadminl, 'getpol', 'pol'], expected_msg=msg)
success('kadmin command parsing tests')