Bug 30832 - Exam mode: backend
Exam mode: backend
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 3.1
Other Linux
: P5 normal (vote)
: UCS@school 3.1 R2
Assigned To: Arvid Requate
Alexander Kläser
: interim-1
Depends on:
Blocks: 31537
  Show dependency treegraph
 
Reported: 2013-03-20 11:45 CET by Sönke Schwardt-Krummrich
Modified: 2013-06-07 21:39 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2013-03-20 11:45:17 CET
For the exam mode, the backend has to perform some special actions:
1) duplicate the user objects for a selected group of users; the new UID gets a prefix/suffix and a special home directory is set; password hashes have to be copied from original object

2) if the LDAP replication is complete, an optional windows profile may have to be copied to the new special user home directories

3) configuration of the involved windows clients (limit the group of valid login users)

4) cleanup while shutting down the exam mode

Important: the backend should always wait for the LDAP replication to get a consistent state.
Comment 1 Alexander Kläser univentionstaff 2013-04-16 17:55:25 CEST
I get a traceback when the exam group does not exist, probably some missing options?

> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute
>     func( request )
>   File "/usr/lib/pymodules/python2.6/ucsschool/lib/schoolldap.py", line 209, in wrapper_func
>     return func( *args, **kwargs )
>   File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolexam-master/__init__.py", line 335, in set_computerroom_exammode
>     examGroup = self.examGroup
>   File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolexam-master/__init__.py", line 97, in examGroup
>     self._examGroup.create()
>   File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 332, in create
>     return self._create()
>   File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 629, in _create
>     al=self._ldap_addlist()
>   File "/usr/lib/pymodules/python2.6/univention/admin/handlers/groups/group.py", line 530, in _ldap_addlist
>     if 'samba' in self.options and self.gidNum:
> AttributeError: 'object' object has no attribute 'options'
Comment 2 Arvid Requate univentionstaff 2013-04-16 19:42:35 CEST
The object needed an open() before creation.
Comment 3 Arvid Requate univentionstaff 2013-04-24 15:50:10 CEST
The UMC module offers four commands for use by authenticated machine accounts:

* schoolexam-master/create-exam-user
* schoolexam-master/remove-exam-user
* schoolexam-master/set-computerroom-exammode
* schoolexam-master/unset-computerroom-exammode


UCR-Variables:

* ucsschool/ldap/default/groupname/exam?"OU%(ou)s-Klassenarbeit"
  Set by the join script 35ucs-school-umc-exam-master.inst
  (used+defined in schoolldap)

Default values for UCR variables that are not not set explicitely:

* ucsschool/ldap/default/container/exam:   'examusers'
  (used+defined in the create_ou hook script and in schoolldap)

* ucsschool/ldap/default/userprefix/exam:  'exam-'
  (used+defined only in the schoolexam-master UMC module)

The per schoolOU examusers-container and exam-group are initially created by a ou_create_post.d/60schoolexam-master hook script during the create_ou.
If they do not exist during schoolexam-master commands they are created on the fly.
Comment 4 Alexander Kläser univentionstaff 2013-04-24 19:07:42 CEST
(In reply to comment #3)
> The UMC module offers four commands for use by authenticated machine accounts:
> 
> * schoolexam-master/create-exam-user
> * schoolexam-master/remove-exam-user
> * schoolexam-master/set-computerroom-exammode
> * schoolexam-master/unset-computerroom-exammode

These commands work fine → OK
 
> UCR-Variables:
> 
> * ucsschool/ldap/default/groupname/exam?"OU%(ou)s-Klassenarbeit"
>   Set by the join script 35ucs-school-umc-exam-master.inst
>   (used+defined in schoolldap)

My group is named OUmyschool-Klassenarbeit, probably a typo → FAIL

> Default values for UCR variables that are not not set explicitely:
> 
> * ucsschool/ldap/default/container/exam:   'examusers'
>   (used+defined in the create_ou hook script and in schoolldap)
> 
> * ucsschool/ldap/default/userprefix/exam:  'exam-'
>   (used+defined only in the schoolexam-master UMC module)
> 
> The per schoolOU examusers-container and exam-group are initially created by a
> ou_create_post.d/60schoolexam-master hook script during the create_ou.
> If they do not exist during schoolexam-master commands they are created on the
> fly.

hook script exists → OK

exam-group is created by ou_create → OK

examusers-container is not created by ou_create → FAIL (could not find the container on a fresh installation)

UCR variables can be adjusted → OK

Changelog → OK (together with Bug 30832)
Comment 5 Arvid Requate univentionstaff 2013-04-24 20:25:34 CEST
examusers-container creation via create_ou hook shoould be fixed now.

> > * ucsschool/ldap/default/groupname/exam?"OU%(ou)s-Klassenarbeit"
> My group is named OUmyschool-Klassenarbeit, probably a typo → FAIL

No, it's Python formatstring syntax.
Comment 6 Alexander Kläser univentionstaff 2013-04-25 07:59:12 CEST
(In reply to comment #5)
> examusers-container creation via create_ou hook shoould be fixed now.
> 
> > > * ucsschool/ldap/default/groupname/exam?"OU%(ou)s-Klassenarbeit"
> > My group is named OUmyschool-Klassenarbeit, probably a typo → FAIL
> 
> No, it's Python formatstring syntax.

Shouldn't it be rather myschool-Klassenarbeit than OUmyschool-Klassenarbeit?
Comment 7 Alexander Kläser univentionstaff 2013-04-25 12:36:38 CEST
(In reply to comment #5)
> examusers-container creation via create_ou hook shoould be fixed now.

looks good now → OK

(In reply to comment #6)
> > > > * ucsschool/ldap/default/groupname/exam?"OU%(ou)s-Klassenarbeit"
> > > My group is named OUmyschool-Klassenarbeit, probably a typo → FAIL
> > 
> > No, it's Python formatstring syntax.
> 
> Shouldn't it be rather myschool-Klassenarbeit than OUmyschool-Klassenarbeit?

the prefix "OU" has been chosen intentionally to comply with naming converntions of other groups → OK

otherwise the commands work as expected → OK
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2013-06-07 21:39:15 CEST
UCS@school 3.1 R2 has been released:
http://download.univention.de/doc/release-notes-ucsschool-3.1-rev2.pdf

If this error occurs again, please use "Clone This Bug".