[SCM] Samba Shared Repository - branch v4-19-test updated

Jule Anger janger at samba.org
Tue Nov 21 11:16:01 UTC 2023


The branch, v4-19-test has been updated
       via  b6c13c49153 python:tests: SHA1 is no longer supported by cryptography module
       via  2f5a1ac1c96 python:tests: Fix assertEquals which doesn't exist in Python 3.12
       via  ec4893eea9c third_party: Build pypamtest with -Wno-error=declaration-after-statement
       via  ec5885982af Use python.h from libreplace
       via  2feaa755e25 lib:replace: Add python.h
       via  95af9424ccc smbd: fix close order of base_fsp and stream_fsp in smb_fname_fsp_destructor()
      from  a5b61b469a2 pytests: sid_strings: do not fail if epoch ending has zeros

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-19-test


- Log -----------------------------------------------------------------
commit b6c13c49153a4de962f14fd03537eb8afe9c8961
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 9 22:27:03 2023 +0100

    python:tests: SHA1 is no longer supported by cryptography module
    
    See https://github.com/pyca/cryptography/issues/8213#issuecomment-1419060001
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 938afb8b28973b0065cc3509b70ebe3f6986de47)
    
    Autobuild-User(v4-19-test): Jule Anger <janger at samba.org>
    Autobuild-Date(v4-19-test): Tue Nov 21 11:15:30 UTC 2023 on atb-devel-224

commit 2f5a1ac1c964ca509aa531ad3fefa151a8666ce2
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 9 21:43:54 2023 +0100

    python:tests: Fix assertEquals which doesn't exist in Python 3.12
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 362b0d69b16c5bbcd0ff7dd7ba12e1ac037a6b3d)

commit ec4893eea9cd7ee1490487b11789b1987eaf7534
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 9 17:16:17 2023 +0100

    third_party: Build pypamtest with -Wno-error=declaration-after-statement
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit c290052fd28bbfa5b885119f322cb0718073e507)

commit ec5885982af6ad9d2b7330f199ddc29ed1678554
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 9 11:35:56 2023 +0100

    Use python.h from libreplace
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 9621a3d7a6949aa833425884cd22379387738cfa)

commit 2feaa755e25a980cd00ee24612917d9f6f96f3bc
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 9 11:32:58 2023 +0100

    lib:replace: Add python.h
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit f337fd995024283f6e1b3f8ec1cc2b3aeb55a2a6)

commit 95af9424ccca96054a4350d0fa2f5d9200c93c27
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Nov 16 10:50:32 2023 +0100

    smbd: fix close order of base_fsp and stream_fsp in smb_fname_fsp_destructor()
    
    VFS modules like streams_xattr use the function fsp_is_alternate_stream() on the
    fsp to determine in an fsp is a stream, eg in streams_xattr_close(). If
    fspo->base_fsp is arlready set to NULL, this won't work anymore.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15521
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Nov 16 18:31:17 UTC 2023 on atb-devel-224
    
    (cherry picked from commit 4481a67c1b20549a71d6c5132b637798a09f966d)

-----------------------------------------------------------------------

Summary of changes:
 auth/credentials/pycredentials.c                   |   2 +-
 buildtools/wafsamba/samba_autoconf.py              |   3 +
 lib/compression/pycompression.c                    |   2 +-
 lib/crypto/py_crypto.c                             |   2 +-
 lib/ldb-samba/pyldb.c                              |   2 +-
 lib/ldb/pyldb.c                                    |   2 +-
 lib/ldb/pyldb_util.c                               |   2 +-
 .../hash_inode.h => lib/replace/system/python.h    |  19 +-
 lib/smbconf/pysmbconf.c                            |   2 +-
 lib/smbconf/pysmbconf.h                            |   2 +-
 lib/talloc/pytalloc.c                              |   2 +-
 lib/talloc/pytalloc_util.c                         |   2 +-
 lib/talloc/test_pytalloc.c                         |   2 +-
 lib/tdb/pytdb.c                                    |   2 +-
 lib/tevent/pytevent.c                              |   2 +-
 libcli/nbt/pynbt.c                                 |   2 +-
 libcli/security/pysecurity.c                       |   2 +-
 libcli/smb/py_reparse_symlink.c                    |   2 +-
 libgpo/pygpo.c                                     |   2 +-
 pidl/lib/Parse/Pidl/Samba4/Python.pm               |   2 +-
 python/modules.c                                   |   2 +-
 python/py3compat.h                                 |   2 +-
 python/pyglue.c                                    |   2 +-
 python/samba/tests/gpo.py                          | 204 ++++++++++-----------
 python/samba/tests/krb5/pkinit_tests.py            |  24 +--
 source3/lib/smbconf/pys3smbconf.c                  |   2 +-
 source3/libsmb/pylibsmb.c                          |   2 +-
 source3/param/pyparam.c                            |   2 +-
 source3/param/pyparam_util.c                       |   2 +-
 source3/passdb/py_passdb.c                         |   2 +-
 source3/rpc_client/py_mdscli.c                     |   2 +-
 source3/smbd/files.c                               |  24 +--
 source3/smbd/pysmbd.c                              |   2 +-
 source3/utils/py_net.c                             |   2 +-
 source4/auth/gensec/pygensec.c                     |   2 +-
 source4/auth/pyauth.c                              |   2 +-
 source4/dns_server/pydns.c                         |   2 +-
 source4/dsdb/pydsdb.c                              |   2 +-
 source4/lib/messaging/pymessaging.c                |   2 +-
 source4/lib/policy/pypolicy.c                      |   2 +-
 source4/lib/registry/pyregistry.c                  |   2 +-
 source4/libnet/py_net.c                            |   2 +-
 source4/libnet/py_net_dckeytab.c                   |   2 +-
 source4/librpc/ndr/py_auth.c                       |   2 +-
 source4/librpc/ndr/py_lsa.c                        |   2 +-
 source4/librpc/ndr/py_misc.c                       |   2 +-
 source4/librpc/ndr/py_security.c                   |  26 +--
 source4/librpc/ndr/py_xattr.c                      |   2 +-
 source4/librpc/rpc/pyrpc.c                         |   2 +-
 source4/librpc/rpc/pyrpc_util.c                    |   2 +-
 source4/ntvfs/posix/python/pyposix_eadb.c          |   2 +-
 source4/ntvfs/posix/python/pyxattr_native.c        |   2 +-
 source4/ntvfs/posix/python/pyxattr_tdb.c           |   2 +-
 source4/param/provision.c                          |   2 +-
 source4/param/pyparam.c                            |   2 +-
 source4/param/pyparam_util.c                       |   2 +-
 source4/scripting/bin/gen_ntstatus.py              |   2 +-
 source4/scripting/bin/gen_werror.py                |   2 +-
 third_party/pam_wrapper/wscript                    |   5 +
 59 files changed, 201 insertions(+), 208 deletions(-)
 copy source3/modules/hash_inode.h => lib/replace/system/python.h (60%)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index bd877941a9a..3687050bde9 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -16,7 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "python/py3compat.h"
 #include "includes.h"
 #include "python/modules.h"
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 8541d003e2a..34fd5fab2c0 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -817,6 +817,9 @@ int main(void) {
         if CHECK_CFLAGS(conf, ["-Wno-error=array-bounds"]):
             conf.define('HAVE_WNO_ERROR_ARRAY_BOUNDS', 1)
 
+        if CHECK_CFLAGS(conf, ["-Wno-error=declaration-after-statement"]):
+            conf.define('HAVE_WNO_ERROR_DECLARATION_AFTER_STATEMENT', 1)
+
         if not Options.options.disable_warnings_as_errors:
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror -Wno-error=deprecated-declarations', testflags=True)
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True)
diff --git a/lib/compression/pycompression.c b/lib/compression/pycompression.c
index 3be3620b1cf..5c3fd82a00a 100644
--- a/lib/compression/pycompression.c
+++ b/lib/compression/pycompression.c
@@ -26,7 +26,7 @@
 
 #include "includes.h"
 #include <talloc.h>
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "lzxpress.h"
 #include "lzxpress_huffman.h"
 
diff --git a/lib/crypto/py_crypto.c b/lib/crypto/py_crypto.c
index 5b3c307057a..4d89e12376f 100644
--- a/lib/crypto/py_crypto.c
+++ b/lib/crypto/py_crypto.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "includes.h"
 #include "python/py3compat.h"
 
diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c
index 01ed065947a..2241abc01df 100644
--- a/lib/ldb-samba/pyldb.c
+++ b/lib/ldb-samba/pyldb.c
@@ -19,7 +19,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "python/py3compat.h"
 #include "includes.h"
 #include <ldb.h>
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 8981e5ea45c..a0383ab8166 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -28,7 +28,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "ldb_private.h"
 #include "ldb_handlers.h"
 #include "pyldb.h"
diff --git a/lib/ldb/pyldb_util.c b/lib/ldb/pyldb_util.c
index 665e34426bc..1256b16ddad 100644
--- a/lib/ldb/pyldb_util.c
+++ b/lib/ldb/pyldb_util.c
@@ -23,7 +23,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "ldb.h"
 #include "pyldb.h"
 
diff --git a/source3/modules/hash_inode.h b/lib/replace/system/python.h
similarity index 60%
copy from source3/modules/hash_inode.h
copy to lib/replace/system/python.h
index e08fc48aa15..b242baecb1c 100644
--- a/source3/modules/hash_inode.h
+++ b/lib/replace/system/python.h
@@ -1,7 +1,5 @@
 /*
- * Unix SMB/Netbios implementation.
- *
- * Copyright (c) 2019      Andreas Schneider <asn at samba.org>
+ * Copyright (c) 2023      Andreas Schneider <asn at samba.org>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,9 +15,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _HASH_INODE_H
-#define _HASH_INODE_H
+#ifndef _SAMBA_PYTHON_H
+#define _SAMBA_PYTHON_H
 
-SMB_INO_T hash_inode(const SMB_STRUCT_STAT *sbuf, const char *sname);
+/*
+ * With Python 3.6 Cpython started to require C99. With Python 3.12 they
+ * started to mix code and variable declarations so disable the warnings.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
+#include <Python.h>
+#pragma GCC diagnostic pop
 
-#endif /* _HASH_INODE_H */
+#endif /* _SAMBA_PYTHON_H */
diff --git a/lib/smbconf/pysmbconf.c b/lib/smbconf/pysmbconf.c
index 20041d3a580..2538127b1ba 100644
--- a/lib/smbconf/pysmbconf.c
+++ b/lib/smbconf/pysmbconf.c
@@ -18,7 +18,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "includes.h"
 #include "python/py3compat.h"
 
diff --git a/lib/smbconf/pysmbconf.h b/lib/smbconf/pysmbconf.h
index e8c6c9998e3..1e57bfb19dd 100644
--- a/lib/smbconf/pysmbconf.h
+++ b/lib/smbconf/pysmbconf.h
@@ -21,7 +21,7 @@
 #ifndef _PYSMBCONF_H_
 #define _PYSMBCONF_H_
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "lib/smbconf/smbconf.h"
 
 typedef struct {
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index 9d62eed455e..f6f068108d6 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -21,7 +21,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include <talloc.h>
 #include <pytalloc.h>
 #include "pytalloc_private.h"
diff --git a/lib/talloc/pytalloc_util.c b/lib/talloc/pytalloc_util.c
index 064957ffd6f..766938a82c8 100644
--- a/lib/talloc/pytalloc_util.c
+++ b/lib/talloc/pytalloc_util.c
@@ -21,7 +21,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "replace.h"
 #include <talloc.h>
 #include "pytalloc.h"
diff --git a/lib/talloc/test_pytalloc.c b/lib/talloc/test_pytalloc.c
index aa05d8c342b..fb385852a39 100644
--- a/lib/talloc/test_pytalloc.c
+++ b/lib/talloc/test_pytalloc.c
@@ -26,7 +26,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include <talloc.h>
 #include <pytalloc.h>
 
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
index ed22803328c..4d75d7a9041 100644
--- a/lib/tdb/pytdb.c
+++ b/lib/tdb/pytdb.c
@@ -24,7 +24,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "replace.h"
 #include "system/filesys.h"
 
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c
index aa2331c1d6c..bbe29f6c693 100644
--- a/lib/tevent/pytevent.c
+++ b/lib/tevent/pytevent.c
@@ -22,7 +22,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "replace.h"
 #include <tevent.h>
 
diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c
index 0908a6bce3c..e0a72fa8451 100644
--- a/libcli/nbt/pynbt.c
+++ b/libcli/nbt/pynbt.c
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "includes.h"
 #include "python/py3compat.h"
 #include "libcli/util/pyerrors.h"
diff --git a/libcli/security/pysecurity.c b/libcli/security/pysecurity.c
index 80730485242..c7eaa91a71b 100644
--- a/libcli/security/pysecurity.c
+++ b/libcli/security/pysecurity.c
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "python/py3compat.h"
 #include "includes.h"
 #include "python/modules.h"
diff --git a/libcli/smb/py_reparse_symlink.c b/libcli/smb/py_reparse_symlink.c
index 57dc6032f99..470aab8d679 100644
--- a/libcli/smb/py_reparse_symlink.c
+++ b/libcli/smb/py_reparse_symlink.c
@@ -16,7 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "replace.h"
 #include "python/modules.h"
 #include "python/py3compat.h"
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c
index bf63a60522f..adbd5b4688d 100644
--- a/libgpo/pygpo.c
+++ b/libgpo/pygpo.c
@@ -16,7 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "includes.h"
 #include "version.h"
 #include "param/pyparam.h"
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 6eb59a0557e..7867eabad92 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -2293,7 +2293,7 @@ sub Parse($$$$$)
     $self->pidl_hdr("
 /* Python wrapper functions auto-generated by pidl */
 #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
-#include <Python.h>
+#include \"lib/replace/system/python.h\"
 #include \"python/py3compat.h\"
 #include \"includes.h\"
 #include \"python/modules.h\"
diff --git a/python/modules.c b/python/modules.c
index ca563ff07d2..577eb552750 100644
--- a/python/modules.c
+++ b/python/modules.c
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "py3compat.h"
 #include "includes.h"
 #include "python/modules.h"
diff --git a/python/py3compat.h b/python/py3compat.h
index 01108214783..bfee82f92b3 100644
--- a/python/py3compat.h
+++ b/python/py3compat.h
@@ -19,7 +19,7 @@
 
 #ifndef _SAMBA_PY3COMPAT_H_
 #define _SAMBA_PY3COMPAT_H_
-#include <Python.h>
+#include "lib/replace/system/python.h"
 
 /* Quick docs:
  * Syntax for module initialization is as in Python 3, except the entrypoint
diff --git a/python/pyglue.c b/python/pyglue.c
index 901a9a37be5..b35b2d21104 100644
--- a/python/pyglue.c
+++ b/python/pyglue.c
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <Python.h>
+#include "lib/replace/system/python.h"
 #include "python/py3compat.h"
 #include "includes.h"
 #include "python/modules.h"
diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py
index f5e25e71041..e4b75cc62a4 100644
--- a/python/samba/tests/gpo.py
+++ b/python/samba/tests/gpo.py
@@ -5314,7 +5314,7 @@ class GPOTests(tests.TestCase):
             with TemporaryDirectory(sections[keyname]) as dname:
                 ext.process_group_policy([], gpos, dname)
                 scripts = os.listdir(dname)
-                self.assertEquals(len(scripts), 1,
+                self.assertEqual(len(scripts), 1,
                     'The %s script was not created' % keyname.decode())
                 out, _ = Popen([os.path.join(dname, scripts[0])], stdout=PIPE).communicate()
                 self.assertIn(b'hello world', out,
@@ -5322,14 +5322,14 @@ class GPOTests(tests.TestCase):
 
                 # Check that a call to gpupdate --rsop also succeeds
                 ret = rsop(self.lp)
-                self.assertEquals(ret, 0, 'gpupdate --rsop failed!')
+                self.assertEqual(ret, 0, 'gpupdate --rsop failed!')
 
                 # Remove policy
                 gp_db = store.get_gplog(machine_creds.get_username())
                 del_gpos = get_deleted_gpos_list(gp_db, [])
                 ext.process_group_policy(del_gpos, [])
-                self.assertEquals(len(os.listdir(dname)), 0,
-                                  'Unapply failed to cleanup scripts')
+                self.assertEqual(len(os.listdir(dname)), 0,
+                                 'Unapply failed to cleanup scripts')
 
             # Unstage the Registry.pol file
             unstage_file(reg_pol)
@@ -5369,21 +5369,21 @@ class GPOTests(tests.TestCase):
         with TemporaryDirectory() as dname:
             ext.process_group_policy([], gpos, dname)
             sudoers = os.listdir(dname)
-            self.assertEquals(len(sudoers), 1, 'The sudoer file was not created')
+            self.assertEqual(len(sudoers), 1, 'The sudoer file was not created')
             self.assertIn(e.data,
                     open(os.path.join(dname, sudoers[0]), 'r').read(),
                     'The sudoers entry was not applied')
 
             # Check that a call to gpupdate --rsop also succeeds
             ret = rsop(self.lp)
-            self.assertEquals(ret, 0, 'gpupdate --rsop failed!')
+            self.assertEqual(ret, 0, 'gpupdate --rsop failed!')
 
             # Remove policy
             gp_db = store.get_gplog(machine_creds.get_username())
             del_gpos = get_deleted_gpos_list(gp_db, [])
             ext.process_group_policy(del_gpos, [])
-            self.assertEquals(len(os.listdir(dname)), 0,
-                              'Unapply failed to cleanup scripts')
+            self.assertEqual(len(os.listdir(dname)), 0,
+                             'Unapply failed to cleanup scripts')
 
         # Unstage the Registry.pol file
         unstage_file(reg_pol)
@@ -5464,7 +5464,7 @@ class GPOTests(tests.TestCase):
         with TemporaryDirectory() as dname:
             ext.process_group_policy([], gpos, dname)
             sudoers = os.listdir(dname)
-            self.assertEquals(len(sudoers), 3, 'The sudoer file was not created')
+            self.assertEqual(len(sudoers), 3, 'The sudoer file was not created')
             output = open(os.path.join(dname, sudoers[0]), 'r').read() + \
                      open(os.path.join(dname, sudoers[1]), 'r').read() + \
                      open(os.path.join(dname, sudoers[2]), 'r').read()
@@ -5477,14 +5477,14 @@ class GPOTests(tests.TestCase):
 
             # Check that a call to gpupdate --rsop also succeeds
             ret = rsop(self.lp)
-            self.assertEquals(ret, 0, 'gpupdate --rsop failed!')
+            self.assertEqual(ret, 0, 'gpupdate --rsop failed!')
 
             # Remove policy
             gp_db = store.get_gplog(machine_creds.get_username())
             del_gpos = get_deleted_gpos_list(gp_db, [])
             ext.process_group_policy(del_gpos, [])
-            self.assertEquals(len(os.listdir(dname)), 0,
-                              'Unapply failed to cleanup scripts')
+            self.assertEqual(len(os.listdir(dname)), 0,
+                             'Unapply failed to cleanup scripts')
 
         # Unstage the Registry.pol file
         unstage_file(manifest)
@@ -5510,8 +5510,8 @@ class GPOTests(tests.TestCase):
                 self.fail('Failed to parse utf-16')
             self.assertIn('Kerberos Policy', inf_conf.keys(),
                           'Kerberos Policy was not read from the file')
-            self.assertEquals(inf_conf.get('Kerberos Policy', 'MaxTicketAge'),
-                              '99', 'MaxTicketAge was not read from the file')
+            self.assertEqual(inf_conf.get('Kerberos Policy', 'MaxTicketAge'),
+                             '99', 'MaxTicketAge was not read from the file')
 
         with NamedTemporaryFile() as f:
             with codecs.open(f.name, 'w', 'utf-8') as w:
@@ -5519,8 +5519,8 @@ class GPOTests(tests.TestCase):
             inf_conf = ext.read(f.name)
             self.assertIn('Kerberos Policy', inf_conf.keys(),
                           'Kerberos Policy was not read from the file')
-            self.assertEquals(inf_conf.get('Kerberos Policy', 'MaxTicketAge'),
-                              '99', 'MaxTicketAge was not read from the file')
+            self.assertEqual(inf_conf.get('Kerberos Policy', 'MaxTicketAge'),
+                             '99', 'MaxTicketAge was not read from the file')
 
     def test_rsop(self):
         cache_dir = self.lp.get('cache directory')
@@ -5584,8 +5584,8 @@ class GPOTests(tests.TestCase):
                 ext = ext(self.lp, machine_creds,
                           machine_creds.get_username(), store)
                 ret = ext.rsop(g)
-                self.assertEquals(len(ret.keys()), 1,
-                                  'A single policy should have been displayed')
+                self.assertEqual(len(ret.keys()), 1,
+                                 'A single policy should have been displayed')
 
                 # Check the Security Extension
                 if type(ext) == gp_krb_ext:
@@ -5593,8 +5593,8 @@ class GPOTests(tests.TestCase):
                                   'Kerberos Policy not found')
                     self.assertIn('MaxTicketAge', ret['Kerberos Policy'],
                                   'MaxTicketAge setting not found')
-                    self.assertEquals(ret['Kerberos Policy']['MaxTicketAge'], '99',
-                                      'MaxTicketAge was not set to 99')
+                    self.assertEqual(ret['Kerberos Policy']['MaxTicketAge'], '99',
+                                     'MaxTicketAge was not set to 99')
                 # Check the Scripts Extension
                 elif type(ext) == gp_scripts_ext:
                     self.assertIn('Daily Scripts', ret.keys(),
@@ -5614,18 +5614,18 @@ class GPOTests(tests.TestCase):
                                   'apply group policies was not applied')
                     self.assertIn(e3.valuename, ret['smb.conf'],
                                   'apply group policies was not applied')
-                    self.assertEquals(ret['smb.conf'][e3.valuename], e3.data,
-                                      'apply group policies was not set')
+                    self.assertEqual(ret['smb.conf'][e3.valuename], e3.data,
+                                     'apply group policies was not set')
                 # Check the Messages Extension
                 elif type(ext) == gp_msgs_ext:
                     self.assertIn('/etc/issue', ret,
                                   'Login Prompt Message not applied')
-                    self.assertEquals(ret['/etc/issue'], e4.data,
-                                      'Login Prompt Message not set')
+                    self.assertEqual(ret['/etc/issue'], e4.data,
+                                     'Login Prompt Message not set')
 
                 # Check that a call to gpupdate --rsop also succeeds
                 ret = rsop(self.lp)
-                self.assertEquals(ret, 0, 'gpupdate --rsop failed!')
+                self.assertEqual(ret, 0, 'gpupdate --rsop failed!')
 
             unstage_file(gpofile % g.name)
             unstage_file(reg_pol % g.name)
@@ -5762,17 +5762,17 @@ class GPOTests(tests.TestCase):
             lp = LoadParm(f.name)
 
             template_homedir = lp.get('template homedir')
-            self.assertEquals(template_homedir, '/home/samba/%D/%U',
+            self.assertEqual(template_homedir, '/home/samba/%D/%U',
                               'template homedir was not applied')
             apply_group_policies = lp.get('apply group policies')
             self.assertTrue(apply_group_policies,
                             'apply group policies was not applied')
             ldap_timeout = lp.get('ldap timeout')
-            self.assertEquals(ldap_timeout, 9999, 'ldap timeout was not applied')
+            self.assertEqual(ldap_timeout, 9999, 'ldap timeout was not applied')
 
             # Check that a call to gpupdate --rsop also succeeds
             ret = rsop(self.lp)
-            self.assertEquals(ret, 0, 'gpupdate --rsop failed!')
+            self.assertEqual(ret, 0, 'gpupdate --rsop failed!')
 
             # Remove policy
             gp_db = store.get_gplog(machine_creds.get_username())
@@ -5782,13 +5782,13 @@ class GPOTests(tests.TestCase):
             lp = LoadParm(f.name)
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list