Bug 34214 - Samba4 @school test: GPC replication School S4 -> Master LDAP
Samba4 @school test: GPC replication School S4 -> Master LDAP
Status: RESOLVED FIXED
Product: UCS Test
Classification: Unclassified
Component: S4 Connector
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Lukas Oyen
:
Depends on: 34216 38228
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-03 11:49 CET by Arvid Requate
Modified: 2018-11-01 19:52 CET (History)
2 users (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
Test run on Slave, replication from DC-Master (2.02 KB, text/plain)
2015-02-20 12:48 CET, Dmitry Galkin
Details
Test run on Master, replication from DC-Slave (2.59 KB, text/plain)
2015-02-20 12:50 CET, Dmitry Galkin
Details
log.samba (859.54 KB, text/plain)
2015-04-02 11:10 CEST, Ammar Najjar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2014-03-03 11:49:44 CET
In UCS@School the Group Policy Container (GPC) Objects are replicated via OpenLDAP. Some test cases should be implemented to check this:

* Verify that a GPC created in the Samba directory at a school server (UCS@school Samba4 Slave DC) is replicated to the UCS Master LDAP. 

* Link the GPO to the School OU in the Samba directory and verify that this link is replicated to the UCS Master LDAP as well.
Comment 1 Dmitry Galkin univentionstaff 2014-08-26 15:24:27 CEST
r53037:
  * Bug #34214 and #34216:
    90_ucsschool/91_samba4_gpc_two_way_replication: test the GPC objects and 
    links replication from DC-Master to DC-Slave or from DC-Slave to DC-Master;
    90_ucsschool/essential/test_samba4.py: a helper class for Samba4 related
    tests.

Test covers cases in this bug and bug #34216.
Comment 2 Ammar Najjar univentionstaff 2014-12-16 11:31:18 CET
The test script "91_samba4_gpc_two_way_replication" produced a traceback in the last Jenkins run in a single server environment:
http://jenkins.knut.univention.de:8080/job/UCSschool%204.0/job/UCSschool%204.0%20Singleserver/11/SambaVersion=s4/testReport/90_ucsschool/91_samba4_gpc_two_way_replication/test/

Current server role is DC-Master, trying to find a DC-Slave in the domain for the test
### FAIL ###
Could not find at least one IP address of the DC-Slave in the output of the udm list command
###      ###


Maybe it is needed to check if the script is running on a single server or multi server environment, as there is no DC-Slave by default on a single server environment, and it is created manually when needed.
Comment 3 Dmitry Galkin univentionstaff 2014-12-19 16:25:00 CET
(In reply to Ammar Najjar from comment #2)

> Maybe it is needed to check if the script is running on a single server or
> multi server environment, as there is no DC-Slave by default on a single
> server environment, and it is created manually when needed.

Yep, there was such check, but it should have checked the udm output more explicitly, so now should be skipped:

r57023:
  * 90_ucsschool/91_samba4_gpc_two_way_replication: check the udm output
    correctly when looking for DC-Slave in the domain (Bug #34214).
Comment 4 Florian Best univentionstaff 2015-02-05 16:34:46 CET
essential/test_samba4.py:62: undefined name 'utils'
essential/test_samba4.py:67: undefined name 'utils'
essential/test_samba4.py:92: undefined name 'utils'
essential/test_samba4.py:103: undefined name 'utils'
essential/test_samba4.py:125: undefined name 'utils'
essential/test_samba4.py:146: undefined name 'utils'
essential/test_samba4.py:211: undefined name 'utils'
Comment 5 Dmitry Galkin univentionstaff 2015-02-06 10:40:30 CET
(In reply to Florian Best from comment #4)
> essential/test_samba4.py:62: undefined name 'utils'
> essential/test_samba4.py:67: undefined name 'utils'
> essential/test_samba4.py:92: undefined name 'utils'
> essential/test_samba4.py:103: undefined name 'utils'
> essential/test_samba4.py:125: undefined name 'utils'
> essential/test_samba4.py:146: undefined name 'utils'
> essential/test_samba4.py:211: undefined name 'utils'

It's inherited, utils are imported in 9*_samba4_* tests.
Comment 6 Arvid Requate univentionstaff 2015-02-16 19:46:22 CET
I think the "samba-tool gpo create" command requires the -H option here, too, to select the specific server where the GPO should be created. The test currently fails without that:

http://jenkins.knut.univention.de:8080/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/16/SambaVersion=s4-school-only-with-slave/testReport/junit/90_ucsschool/91_samba4_gpc_two_way_replication/test/
Comment 7 Dmitry Galkin univentionstaff 2015-02-20 12:48:19 CET
Created attachment 6706 [details]
Test run on Slave, replication from DC-Master
Comment 8 Dmitry Galkin univentionstaff 2015-02-20 12:50:25 CET
Created attachment 6707 [details]
Test run on Master, replication from DC-Slave
Comment 9 Dmitry Galkin univentionstaff 2015-02-20 12:53:26 CET
(In reply to Arvid Requate from comment #6)
> I think the "samba-tool gpo create" command requires the -H option here,
> too, to select the specific server where the GPO should be created. The test
> currently fails without that:
> 
> http://jenkins.knut.univention.de:8080/job/UCSschool%204.0/job/UCSschool%204.
> 0%20Multiserver/16/SambaVersion=s4-school-only-with-slave/testReport/junit/
> 90_ucsschool/91_samba4_gpc_two_way_replication/test/

The debug message says it is run with '-H' and host specified.

Executing cmd: ('samba-tool', 'gpo', 'create', 'ucs_test_school_gpo_q53gz2ry', '-H', 'ldap://master204.autotest204.local', '-k', 'no', '--username', 'Administrator', '--password', 'univention')

I've checked the test with the setup as 'autotest-201-ucsschool-singleserver-s4-with-slave' jenkins template.
Test works for both cases: DC-Master --> DC-Slave and DC-Slave --> DC-Master. When running on Master the Slave accessed by IP, when running on Slave master accessed by 'ldap://master201.autotest201.local'.
The only thing when GPO is removed after the test -> the host is not specified and samba-tool gives exception, which is just printed.
Comment 10 Ammar Najjar univentionstaff 2015-04-02 11:10:01 CEST
Created attachment 6798 [details]
log.samba

Test failed in the last two Jenkins runs for:
 - SambaVersion=s4-all-components
 - SambaVersion=s4

http://jenkins.knut.univention.de:8080/view/UCSschool/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/30/SambaVersion=s4-all-components/testReport/90_ucsschool/91_samba4_gpc_two_way_replication/test/

http://jenkins.knut.univention.de:8080/view/UCSschool/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/31/SambaVersion=s4-all-components/testReport/90_ucsschool/91_samba4_gpc_two_way_replication/test/

http://jenkins.knut.univention.de:8080/view/UCSschool/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/30/SambaVersion=s4/testReport/90_ucsschool/91_samba4_gpc_two_way_replication/test/

http://jenkins.knut.univention.de:8080/view/UCSschool/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/31/SambaVersion=s4/testReport/90_ucsschool/91_samba4_gpc_two_way_replication/test/

With the failing message:

Executing cmd: ('samba-tool', 'gpo', 'show', '{55FEE9FD-36B3-456D-8F75-A7E389848184}')
### FAIL ###
An error occured while getting the GPO link using 'samba-tool', STDERR: 'ERROR(runtime): uncaught exception - ('Could not find a DC for domain', RuntimeError('NT_STATUS_OBJECT_NAME_NOT_FOUND',))
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/gpo.py", line 513, in run
    self.url = dc_url(self.lp, self.creds, H)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/gpo.py", line 117, in dc_url
    raise RuntimeError("Could not find a DC for domain", e)'
###      ###
 
In the attachment see "log.samba" from the last run #31.
Comment 11 Ammar Najjar univentionstaff 2015-04-02 11:19:54 CEST
Test is skipped with SKIP-UCSSCHOOL tag in both 4.0 & 3.2r2, please enable when this bug is fixed.
Comment 12 Dmitry Galkin univentionstaff 2015-04-10 12:52:33 CEST
(In reply to Ammar Najjar from comment #11)
> Test is skipped with SKIP-UCSSCHOOL tag in both 4.0 & 3.2r2, please enable
> when this bug is fixed.

The test worked in previous test run: http://jenkins.knut.univention.de:8080/view/UCSschool/job/UCSschool%204.0/job/UCSschool%204.0%20Multiserver/29/SambaVersion=s4/artifact/ucs-test.log

where the '98univention-samba4-dns.inst' script executed successfully.

I've opened Bug #38228 and Bug #38229


As a workaround, the hostname might be specified for all samba-tool executions, but I think the test should fail if the samba-tool does not work.
Comment 13 Arvid Requate univentionstaff 2015-04-13 11:33:24 CEST
> As a workaround, the hostname might be specified for all samba-tool executions,

Yes, please do that.

> but I think the test should fail if the samba-tool does not work.

This will happen if -H doesn't fix the issue.
Comment 14 Dmitry Galkin univentionstaff 2015-04-17 11:57:37 CEST
(In reply to Arvid Requate from comment #13)
> > As a workaround, the hostname might be specified for all samba-tool executions,
> 
> Yes, please do that.
> 

I could not reproduce the issue on the 'autotest-203-ucsschool-multiserver-s4' fresh setup..

r59914:

  * 90_ucsschool/91_samba4_gpc_two_way_replication: wait more for replication;
    specify local ip and credentials when running local checks using samba-tool (Bug #34214).


committed to both School 3.2 and 4.0
Comment 15 Lukas Oyen univentionstaff 2017-01-02 16:12:27 CET
The presented test-case will be skipped, if no S4 is found on the UCS@School Master DC. It also checks the replication only via the `samba-tool`.

The test should be reworked to include a check in the OpenLDAP if `server/role` == "domaincontroller_master". In doing so, be aware to not break bug #34216.
Comment 16 Lukas Oyen univentionstaff 2017-01-24 13:27:42 CET
Reworked in r76047 / r76048.
Comment 17 Lukas Oyen univentionstaff 2017-01-24 16:31:33 CET
Updated in r76063 to use `univention.admin.uldap`.