#!/usr/share/ucs-test/runner python3
## desc: Check whether a simple-auth-account appears in the license-check
## tags: [udm]
## roles: [domaincontroller_master]
## Bugs: [13721]
## exposure: careful
## packages:
##   - univention-config
##   - univention-directory-manager-tools


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


if __name__ == '__main__':
	license_before = subprocess.Popen(['univention-license-check'], stdout=subprocess.PIPE).communicate()[0]

	with udm_test.UCSTestUDM() as udm:
		udm.create_ldap_user()
		license_after = subprocess.Popen(['univention-license-check'], stdout=subprocess.PIPE).communicate()[0]

	if license_before != license_after:
		utils.fail('The license before creating a simple-auth user differs from the license after creating the user')
