1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/python/samba/tests/bin/cepces-submit
Gabriel Nagy 2d6943a864 gp: Test adding new cert templates enforces changes
Ensure that cepces-submit reporting additional templates and re-applying
will enforce the updated policy.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@samba.org>
2023-08-28 02:04:36 +00:00

19 lines
639 B
Python
Executable File

#!/usr/bin/python3
import optparse
import os, sys, re
sys.path.insert(0, "bin/python")
if __name__ == "__main__":
parser = optparse.OptionParser('cepces-submit [options]')
parser.add_option('--server')
parser.add_option('--auth')
(opts, args) = parser.parse_args()
assert opts.server is not None
assert opts.auth == 'Kerberos'
if 'CERTMONGER_OPERATION' in os.environ and \
os.environ['CERTMONGER_OPERATION'] == 'GET-SUPPORTED-TEMPLATES':
templates = os.environ.get('CEPCES_SUBMIT_SUPPORTED_TEMPLATES', 'Machine').split(',')
print('\n'.join(templates)) # Report the requested templates