#!/usr/share/ucs-test/runner python3
## desc: Test modifying shell for all computer roles (except computers/ipmanagedclient)
## tags: [udm-computers]
## roles: [domaincontroller_master]
## exposure: careful
## packages:
##   - univention-config
##   - univention-directory-manager-tools


import univention.testing.udm as udm_test
import univention.testing.strings as uts
import univention.testing.utils as utils


if __name__ == '__main__':

	with udm_test.UCSTestUDM() as udm:
		for role in udm.COMPUTER_MODULES:
			if role == 'computers/ipmanagedclient':
				continue

			shell = uts.random_string()

			computer = udm.create_object(role, name=uts.random_name())
			udm.modify_object(role, dn=computer, shell=shell)
			utils.verify_ldap_object(computer, {'loginShell': [shell]})
