From 9db01a2c7291493a3f20987e53b1e688123a246a Mon Sep 17 00:00:00 2001 From: Gabriel Nagy Date: Fri, 18 Aug 2023 17:06:43 +0300 Subject: [PATCH] gp: Test with binary content for certificate data This fails all GPO-related tests that call `gpupdate --rsop`. Signed-off-by: Gabriel Nagy Reviewed-by: Joseph Sutton Reviewed-by: David Mulder (cherry picked from commit 1ef722cf66f9ec99f52939f1cfca031c5fe1ad70) --- python/samba/tests/gpo.py | 8 ++++---- selftest/knownfail.d/gpo | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 selftest/knownfail.d/gpo diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index e4b75cc62a4..963f873f755 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -6783,14 +6783,14 @@ class GPOTests(tests.TestCase): ldb.add({'dn': certa_dn, 'objectClass': 'certificationAuthority', 'authorityRevocationList': ['XXX'], - 'cACertificate': 'XXX', + 'cACertificate': b'0\x82\x03u0\x82\x02]\xa0\x03\x02\x01\x02\x02\x10I', 'certificateRevocationList': ['XXX'], }) # Write the dummy pKIEnrollmentService enroll_dn = 'CN=%s,CN=Enrollment Services,%s' % (ca_cn, confdn) ldb.add({'dn': enroll_dn, 'objectClass': 'pKIEnrollmentService', - 'cACertificate': 'XXXX', + 'cACertificate': b'0\x82\x03u0\x82\x02]\xa0\x03\x02\x01\x02\x02\x10I', 'certificateTemplates': ['Machine'], 'dNSHostName': hostname, }) @@ -7201,14 +7201,14 @@ class GPOTests(tests.TestCase): ldb.add({'dn': certa_dn, 'objectClass': 'certificationAuthority', 'authorityRevocationList': ['XXX'], - 'cACertificate': 'XXX', + 'cACertificate': b'0\x82\x03u0\x82\x02]\xa0\x03\x02\x01\x02\x02\x10I', 'certificateRevocationList': ['XXX'], }) # Write the dummy pKIEnrollmentService enroll_dn = 'CN=%s,CN=Enrollment Services,%s' % (ca_cn, confdn) ldb.add({'dn': enroll_dn, 'objectClass': 'pKIEnrollmentService', - 'cACertificate': 'XXXX', + 'cACertificate': b'0\x82\x03u0\x82\x02]\xa0\x03\x02\x01\x02\x02\x10I', 'certificateTemplates': ['Machine'], 'dNSHostName': hostname, }) diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo new file mode 100644 index 00000000000..0aad59607c2 --- /dev/null +++ b/selftest/knownfail.d/gpo @@ -0,0 +1,13 @@ +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_gp_user_centrify_crontab_ext +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_gp_user_scripts_ext +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_access +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_files +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_issue +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_motd +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_openssh +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_startup_scripts +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_sudoers +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_symlink +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_advanced_gp_cert_auto_enroll_ext +^samba.tests.gpo.samba.tests.gpo.GPOTests.test_gp_cert_auto_enroll_ext -- 2.34.1