Bug 34225 - Samba4 @school test: SYSVOL replication
Samba4 @school test: SYSVOL replication
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: Samba
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Dmitry Galkin
Arvid Requate
:
Depends on: 35920
Blocks: 37979
  Show dependency treegraph
 
Reported: 2014-03-03 13:49 CET by Arvid Requate
Modified: 2023-03-25 06:48 CET (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 Arvid Requate univentionstaff 2014-03-03 13:49:44 CET
In the UCS Samba4 integration packages the sysvol share is periodically replicated bidirectionally between the DC Master and other Samba4 DCs.

In UCS@School multi-school domains there is a special case, where Samba4 may not be installed on the UCS Master but the sysvol replication must still work.

Create a GPO on the school DC Slave (e.g. via samba-tool gpo create). Then directly trigger sysvol-sync.sh on the Slave and check that the new GPO files have been replicated to the DC Master.
Comment 1 Dmitry Galkin univentionstaff 2014-08-15 17:25:25 CEST
r52757:

  * Bug #34225: 90_samba4_sysvol_replication: Test sysvol replication
    with multi-school domain setup.


Opened: Bug #35619
Comment 2 Dmitry Galkin univentionstaff 2014-08-26 16:58:47 CEST
As there are more Samba tests to write, the test will be updated using test class from essential/test_samba4.py
Comment 3 Dmitry Galkin univentionstaff 2014-08-29 12:04:33 CEST
r53158:
  * 90_samba4_sysvol_replication: optimized the test using
    test class from essential/test_samba4.py (Bug #34225);
  * essential/test_samba4.py: cosmetic changes.
Comment 4 Arvid Requate univentionstaff 2014-09-11 17:38:46 CEST
* the test currently fails if a non-samba4 slave is in the domain.
* the test does not cover DC Backups.

Please adjust the search filter to match for "univentionService=Samba 4" instead.

Other suggestions:
* why look for displayName instead of the canonical "cn"?
* search_result.replace("displayName: ", "") is not anchored on sart of line, maybe better use regexp (or sed).
* Fix typo:  Obtatining
Comment 5 Dmitry Galkin univentionstaff 2014-09-12 13:21:14 CEST
(In reply to Arvid Requate from comment #4)
> * the test currently fails if a non-samba4 slave is in the domain.

The test depends on ## packages: [univention-samba4], thus without it should be skipped by the test-runner. If you start it with '-f' flag, most likely it will be forced to run also on S3, but obviously will fail.

Or, if you mean that there a mixture of DCs running with S4 and S3 in one domain, than AFAIK such configurations should not be used at all.

Also, have not seen it failing in any of our Jenkins jobs, checked all School jobs we have..

> * the test does not cover DC Backups.

Initially, the bug was assigned by Sönke and he explained the logic of how the test should work including the fact that the test should run on DC-Slave(s) only.

Also, I don't see any Jenkins jobs for School that have DC-Backups, except for performance tests and according to http://jenkins.knut.univention.de:8080/ they are being disabled for more than 1 year.

So, if the test should work for environment with Backups, first such jobs should be created (although, I'm not aware if customers have such setups).

> 
> Please adjust the search filter to match for "univentionService=Samba 4"
> instead.

If the LDAP search pattern will be adjusted to "univentionService=Samba 4" than the search will deliver all the DCs (including DC-Backup(s)) in the domain, that was not intended originally.

> 
> Other suggestions:
> * why look for displayName instead of the canonical "cn"?

Looking for "cn" might return more results than one, while the "displayName" entry is always one. Or?

> * search_result.replace("displayName: ", "") is not anchored on sart of
> line, maybe better use regexp (or sed).

I'm not sure I got the idea, please explain what do you mean with 'sart' here?

> * Fix typo:  Obtatining

Yep, thanks, fixed.
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2014-09-12 14:57:51 CEST
(In reply to Dmitry Galkin from comment #5)
> (In reply to Arvid Requate from comment #4)
> > * the test does not cover DC Backups.
> 
> Initially, the bug was assigned by Sönke and he explained the logic of how
> the test should work including the fact that the test should run on
> DC-Slave(s) only.

Most of the test cases are run on a DC slave or a single DC master.
I created bug 35920 to create a jenkins job that runs the ucs-test suite on a UCS@school DC backup.

> So, if the test should work for environment with Backups, first such jobs
> should be created (although, I'm not aware if customers have such setups).

Yep, they have. Please try to adjust the test script accordingly. A jenkins job will be created via the bug 35920.
Comment 7 Dmitry Galkin univentionstaff 2014-09-12 15:09:54 CEST
(In reply to Dmitry Galkin from comment #5)
> > * search_result.replace("displayName: ", "") is not anchored on sart of
> > line, maybe better use regexp (or sed).
> 
> I'm not sure I got the idea, please explain what do you mean with 'sart'
> here?

Ok, it's start of the line:) Yes, it is not anchored on the line start, but it works for exact match only, so is there any chance the node name will include exactly the "displayName: " (with ":" and a space after)? In our test envs probably not and AFAIK in customer envs the tests marked as 'dangerous' should not be run.
Comment 8 Dmitry Galkin univentionstaff 2014-09-19 17:49:52 CEST
r53804:
  * Bug #34225:
    90_ucsschool/90_samba4_sysvol_replication: add support for DC-Backup;
    select DCs basing on "univentionService: Samba 4"; poll the remote sysvol
    folder every 10 seconds instead of waiting full cron job time.
Comment 9 Arvid Requate univentionstaff 2015-02-05 19:26:48 CET
Two things:

1. Please check the test, the result seems to be flaky, the run today succeeded, but the previous runs failed, e.g. the one before (from 15.01.2015):

http://jenkins.knut.univention.de:8080/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/SambaVersion=s4-school-only/15/testReport/90_ucsschool/90_samba4_sysvol_replication/test/


From the output of the test I guess that this check in create_samba_gpo simply needs to be removed:

        if stderr:
            utils.fail("An error occured while creating a GPO using "
                       "'samba-tool': '%s'" % stderr)


2. When writing another test I discovered that "samba-tool gpo create" not always creates the GPO on the local system but dynamically chooses a DC (don't know which ones it considers). So please add the option "-H ldap://$(hostname -f)" or some python equivalent to the samba-tool command line. There are so many UCS@school scenarios already by now that it's best to nail the tests down to the most deterministic behaviour.
Comment 10 Arvid Requate univentionstaff 2015-02-05 20:31:58 CET
Ah, fine, Bug 37362 already fixed the stderr check in a generic way a couple of days after that test run I checked above. Then simply add the "-H" line to the GPO creation and check if Bug 37362 Comment 3 indicates a problem for UCS@school or if something is flaky only in the Jenkins test environment. Please open a UCs@school Bug if the test results point in that direction.
Comment 11 Dmitry Galkin univentionstaff 2015-02-06 15:03:16 CET
(In reply to Arvid Requate from comment #10)
> Ah, fine, Bug 37362 already fixed the stderr check in a generic way a couple
> of days after that test run I checked above. Then simply add the "-H" line
> to the GPO creation

r57839:
  * 90_ucsschool/90_samba4_sysvol_replication:
    specify host for samba-tool (Bug #34225).

> and check if Bug 37362 Comment 3 indicates a problem for
> UCS@school or if something is flaky only in the Jenkins test environment.
> Please open a UCs@school Bug if the test results point in that direction.

I've created a setup like jenkins template 203* with two DC-slave(s) and run the test on both by one, as of now it all works:

http://hutten.knut.univention.de/pastebin/m1665fccf

http://hutten.knut.univention.de/pastebin/m4ed4196d
Comment 12 Arvid Requate univentionstaff 2015-02-16 18:49:39 CET
Ok.