#!/usr/share/ucs-test/runner python3
## desc: Create groups/group with name which is already in use
## tags: [udm,apptest]
## roles: [domaincontroller_master]
## exposure: careful
## packages:
##   - univention-config
##   - univention-directory-manager-tools


import sys
import univention.testing.utils as utils
import univention.testing.udm as udm_test

if __name__ == '__main__':
	with udm_test.UCSTestUDM() as udm:
		group_name = udm.create_group()[1]

		try:
			udm.create_group(name=group_name)
		except udm_test.UCSTestUDM_CreateUDMObjectFailed:
			sys.exit(0)

		utils.fail('UDM did not report an error while trying to create a group with a name which is already in use')
