Univention Bugzilla – Bug 34225
Samba4 @school test: SYSVOL replication
Last modified: 2023-03-25 06:48:58 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.
r52757: * Bug #34225: 90_samba4_sysvol_replication: Test sysvol replication with multi-school domain setup. Opened: Bug #35619
As there are more Samba tests to write, the test will be updated using test class from essential/test_samba4.py
r53158: * 90_samba4_sysvol_replication: optimized the test using test class from essential/test_samba4.py (Bug #34225); * essential/test_samba4.py: cosmetic changes.
* 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
(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.
(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.
(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.
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.
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.
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.
(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
Ok.