Bug 35151 - Test settings dialog of computerroom module
Test settings dialog of computerroom module
Status: RESOLVED FIXED
Product: UCS@school
Classification: Unclassified
Component: ucs-test
UCS@school 3.2 R2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Ammar Najjar
:
Depends on: 35195 35341 35408
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-18 08:26 CEST by Sönke Schwardt-Krummrich
Modified: 2015-11-02 12:22 CET (History)
0 users

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 2014-06-18 08:26:21 CEST
Within the computerroom there is a "settings" dialog that is able to restrict
1) internet access
  1a) set a specific internet rule for the computers of the computerroom
  1b) set a custom internet rule (whitelist) for the computers of the computerroom
  1c) use default settings/no special internet settings
2) printer access
  2a) give access to all printer shares (currently not possible due to Bug 35076)
  2b) use default settings
  2c) deny access to all printer shares
3) share access
  3a) limit share access to the home share
  3b) no limitation
for the computers of the selected room.

Please create one or more test scripts that test the 3 settings above.
The script should create 
- a new OU
- at least 2 new computerrooms
- new computers that are member of one of the computerrooms
  (IP addresses have to be set!)
- new test users

The test scripts should verify that settings for one room do not interfere with settings of another room.

All settings are dependent of the client's IP address. So the test script has to use the network loop from the ucs-test NetworkRedirector helper class for faking the client's IP address.

The test script should also check, if the specified expiration time for the room settings is correctly utilized.
Comment 1 Ammar Najjar univentionstaff 2014-07-21 12:42:11 CEST
This test is devided into three test scripts:

"23_computerroom_time_settings" to test the expiration time for one room:
	- Create new school, new teacher, two computers and a computer room.
	- change the settings of the room to be:
		new_settings = {
				'customRule':	'',
				'printMode':	'none',
				'internetRule': 'none',
				'shareMode':	'home',
				'period':	now + 2 minutes
				}
	- check if atjob is created correctly.
	- check if the "valid until" is displayed correcetly. (Fails because of Bug #35195)
	- wait 2 mins then:
		- check atjobs.
		- check the currect settings.

"22_computerroom_module" to test the change of settings in one room:
	- Create new school, new teacher, two computers and a computer room.
	- Calculate all the possible combinations of: 
	  rules = ['none', 'Kein Internet', 'Unbeschränkt', 'custom']
	  printmodes = ['default', 'all', 'none']
	  sharemodes = ['all', 'home']
	- change the settings of the computer room over all these possible combinations.
	- For each change in the room settings:
		- check if the display values (UMCP get command).
		- check the behaviour (atq, internet access, share access, print access) for the first room.

"27_computerroom_two_rooms_settings_interference" to test the effect of changing the settings in two rooms:
	- Create new school, teacher, two computers and two computer rooms.
	- Calculate all the possible combinations of: 
	  rules = ['none', 'Kein Internet', 'Unbeschränkt', 'custom']
	  printmodes = ['default', 'all', 'none']
	  sharemodes = ['all', 'home']
	- change the settings of the first room over all these possible combinations.
	- For each change in the first room settings:
		- change the second room settings over all the possible combinations.
		- check if the display values (UMCP get command).
		- check the behaviour (atq, internet access, share access, print access) for the first room.


- For now the test always passes, giving "FAIL ..." message in the place where it fails. This is done because the existence of other bugs: Bug #35195, Bug #35341, Bug #35408.
Comment 2 Ammar Najjar univentionstaff 2014-07-22 10:46:08 CEST
All test scripts file names changed to start with "22_".
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2014-12-10 09:49:15 CET
The test script took 234, 267 and 124 minutes to finish during the last test runs.
Please have a look, if there is potential to speed it up.
Comment 4 Ammar Najjar univentionstaff 2014-12-11 10:38:34 CET
The test script should contain the following steps:

Nr of total iterations over settings = 24 * 24 = 576

for (24) iteration:
  1 - getting room1 old(original) settings
  * small improvemts is done by modifying the existing dictionary "room1_old_settings" instead of a creating new one.
  2 - setting room1
  3 - start another (24) iterations (inner loop)
    1- set room1 (incase there was a change in room1 settings after changing room2 settings in a previous iteration)
    2- set room2
    3- check_settings (get request results)
    4 -check_behavior:
      1- check atjobs (average execution time = 0.0058564059 sec):
        if no change in settings → no atjob added.
      2- check internetrules  (average execution time = 0.4476046823 sec):
        check if the rule in control is the expected rule
        * This step included fetching the ban page every iteration is improved by fetching the ban page once before any iteration is done and pass it as a parameter.
      3- check share behavior (average execution time = 3.1209804192 sec):
      if sharemode = 'all' →
        check chare access:
          home read → 0
          home write → 0
          marktplatz read → 0
          marktplatz write → 0
      if sharemode = 'home' →
        check chare access:
          home read → 0
          home write → 0
          marktplatz read → 1
          marktplatz write → 1
      4- check print behavior (average execution time = 1.5679674111 sec):
        if printmode = 'none':
          smbclient hardware printer → 1
          smbclient hardware PDFDrucker → 1
        if printmode = 'default':
          smbclient hardware printer → 0
          smbclient hardware PDFDrucker → 0
        if printmode = 'all':
          smbclient hardware printer → 0
          smbclient hardware PDFDrucker → 0
    5- clean folders:
      * (optional step to reduce the result of smbclient -c dir command)
      '/home/gsmitte/groups/Marktplatz/'
      '/home/%s/lehrer/%s/' % (school, teacher)

I could not see how to improve performance more without affecting the functionality.
Comment 5 Ammar Najjar univentionstaff 2014-12-11 10:40:53 CET
'download.univention.de' is used instead of 'univention.de'
Comment 6 Ammar Najjar univentionstaff 2014-12-15 10:32:30 CET
script "22_computerroom_time_settings" is skipped until bug #35195 is fixed.