univention.testing.ucsschool package
Contents
univention.testing.ucsschool package¶
Submodules¶
univention.testing.ucsschool.acl module¶
univention.testing.ucsschool.computerroom module¶
univention.testing.ucsschool.conftest module¶
univention.testing.ucsschool.distribution module¶
Class Distribution
- class univention.testing.ucsschool.distribution.Distribution(school, connection=None, sender=None, flavor=None, ucr=None, description=None, name=None, distributeType='manual', distributeTime=None, distributeDate=None, collectType='manual', collectTime=None, collectDate=None, files=[], recipients=[])[source]¶
Bases:
object
Contains the needed functionality for Materials distribution. By default the distribution is manual.
- Parameters
school (str) – name of the ou
connection (UMC connection object) –
ucr (UCR object) –
name (str) – name of distribution project to be added later
description (str) – description of distribution project to be added later
sender (str) – name of the creater user (teacher or admin)
flavor (str ('teacher' or 'admin')) – flavor of the acting user
distributeTime (str ('%I:%M')) – time for automatic distribution
distributionDate (str ('%Y-%m-%d)) – date for automatic distribution
collectionTime (str ('%I:%M')) – time for automatic collection
collectionDate (str ('%Y-%m-%d)) – date for automatic collection
distributeType – type of the distribution
collectionTye – type of the collection
files (list of str) – names of material files for the distribution project
recipients (list of group objects) – groups which are included in the distribution project
- property files¶
- property files_encoded¶
- query(filt='private', pattern='')[source]¶
Calles ‘distribution/query’ :param pattern: the pattern to use in the search :type pattern: str
- idir(path)[source]¶
Dir a specific path.
- Parameters
path (str) – wanted path
- Returns
list of file names
- genData(file_name, content_type, boundary, flavor, override_file_name=None)[source]¶
Generates data in the form to be sent via http POST request.
- uploadFile(file_name, content_type=None, override_file_name=None)[source]¶
Uploads a file via http POST request.
- put(description=None, distributeType=None, distributeTime=None, distributeDate=None, collectType=None, collectTime=None, collectDate=None, files=[], recipients=[])[source]¶
Modifies the already existing project.
- Parameters
description (str) – description of the project to be added later
distributeTime (str ('%I:%M')) – time for automatic distribution
distributionDate (str ('%Y-%m-%d)) – date for automatic distribution
collectionTime (str ('%I:%M')) – time for automatic collection
collectionDate (str ('%Y-%m-%d)) – date for automatic collection
distributeType – type of the distribution
collectionTye – type of the collection
files (list of str) – names of material files for the distribution project
recipients (list of group objects) – groups which are included in the project
- check_put(previousGetResult)[source]¶
Calls ‘distribution/get’ and check the modified project :param previousGetResult: info from previous get :type previousGetResult: dict check changing sates for distribution and collection
- put_fail(before_type, after_type, before_time, after_time, before_atJob, after_atJob)[source]¶
Checks if the atjobs are in the expected formats :param before_type: type before using put command :type before_type: str :param after_type: type after using put command :type after_type: str :param before_atJob: atJobNum before using put command :type before_atJob: str or None :param after_atJob: atJobNum after using put command :type after_atJob: str or None :param before_time: time before using put command :type before_time: str :param after_time: time after using put command :type after_time: str
- check_distribute(users)[source]¶
Checks if the distribution was successful by checking the file system.
- Parameters
users (list of str) – names of users to have the material distributed for
univention.testing.ucsschool.exam module¶
Class Exam
- univention.testing.ucsschool.exam.wait_replications_check_rejected_uniqueMember(existing_rejects)[source]¶
- class univention.testing.ucsschool.exam.Exam(school, room, examEndTime, recipients, name=None, directory=None, files=[], shareMode='home', internetRule='none', customRule='', connection=None)[source]¶
Bases:
object
Contains the needed functionality for exam module.
- Parameters
school (str) – name of the school
room (str) – name of room of the exam
examEndTime (str in format "HH:mm") – exam end time
name (str) – name of the exam to be created later
recipients (list of str) – names of the classes to make the exam
directory (str) – name of the directory for the exam, default=name
files (list of str) – list of files to be uploaded to the exam directory
sharemode (str either "home" or "all") – sharemode
internetRule (str) – name of the internet Rule to be applied in the exam
customRule (str) – cutom internet rule
connection (UMC connection object) –
- save(update=False, fields=None)[source]¶
Saves an exam. If fields is a list only the given values are set in the request
- genData(file_name, content_type, boundary, override_file_name=None)[source]¶
Generates data in the form to be sent via http POST request.
univention.testing.ucsschool.import_factory_test_classes module¶
univention.testing.ucsschool.importcomputers module¶
univention.testing.ucsschool.importgroups module¶
univention.testing.ucsschool.importnetworks module¶
univention.testing.ucsschool.importou module¶
univention.testing.ucsschool.importprinters module¶
univention.testing.ucsschool.importusers module¶
univention.testing.ucsschool.importusers_cli_v2 module¶
univention.testing.ucsschool.importusers_http module¶
univention.testing.ucsschool.internetrule module¶
univention.testing.ucsschool.kelvin_api module¶
univention.testing.ucsschool.klasse module¶
univention.testing.ucsschool.radius module¶
univention.testing.ucsschool.randomdomain module¶
univention.testing.ucsschool.school module¶
univention.testing.ucsschool.schoolroom module¶
univention.testing.ucsschool.simplecurl module¶
- class univention.testing.ucsschool.simplecurl.SimpleCurl(proxy, username=None, password=None, bFollowLocation=1, maxReDirs=5, connectTimout=10, timeOut=10, port=3128, auth=pycurl.HTTPAUTH_BASIC, cookie=None)[source]¶
Bases:
object
pycurl simple class implementation
- Parameters
univention.testing.ucsschool.test_samba4 module¶
- class univention.testing.ucsschool.test_samba4.TestSamba4[source]¶
Bases:
object
Test class constructor
- create_and_run_process(cmd, stdin=None, std_input=None, shell=False, stdout=- 1)[source]¶
Creates a process as a Popen instance with a given ‘cmd’ and executes it. When stdin is needed, it can be provided with kwargs. To write to a file an istance can be provided to stdout.
- start_stop_service(service, action)[source]¶
Starts, stops or restarts the given ‘service’ depending on the given ‘action’ is ‘start’, ‘stop’, ‘restart’ respectively.
- dc_master_has_samba4()[source]¶
Returns ‘True’ when Primary Directory Node has Samba4 according to “service=Samba 4”
- is_a_school_branch_site(host_dn)[source]¶
Returns True if the given ‘host_dn’ is located in the School branch site.
- grep_for_key(grep_in, key)[source]¶
Runs grep on given ‘grep_in’ with a given ‘key’. Returns the output.
- get_udm_list_dcs(dc_type, with_samba4=True, with_ucsschool=False)[source]¶
Runs the “udm computers/’dc_type’ list” and returns the output. If ‘with_samba4’ is ‘True’ returns only those running Samba 4.
- get_udm_list_dc_slaves_with_samba4(with_ucsschool=False)[source]¶
Returns the output of “udm computers/domaincontroller_slave list –filter service=Samba 4” command.
- select_school_ou(schoolname_only=False)[source]¶
Returns the first found School OU from the list of Replica Directory Nodes in domain.