[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Fri Oct 13 04:56:01 UTC 2023
The branch, master has been updated
via d895c98c507 wintest: Fix invalid escape sequences
via 3f70da665bd selftest: Use now() instead of utcnow()
via 44958f363ee s4:torture: Use assertEqual() instead of assertEquals()
via 9e3a858969a s4:dsdb:tests: Use loadTestsFromTestCase() instead of makeSuite()
via bb77f36f49c s4:dsdb:tests: Fix assertion messages
via 1513a4592c0 s4:dsdb:tests: Remove unused variables
via 079306cf34f s4:dsdb:tests: Remove unused imports
via 39a4d27a83c s3:script: Remove semicolons
via 1a4ec25b327 tests/krb5: Fix assertion messages
via 2f5833cbb3a tests/krb5: Use assertEqual() instead of assertEquals()
via f7009e2a35c python:tests: Use now() instead of utcnow()
via af61444d7a5 python:tests: Remove semicolons
via 7efe6b0ab42 python:tests: Correct search expression
via ed97b15fe97 python:tests: Fix comment
via d2196545bb0 python:tests: Fix exception message
via 2fa838d4395 python:tests: Use assertEqual() instead of assertEquals()
via 08dbb35e7e4 python:subunit: Use now() instead of utcnow()
via 7c89c5880ea python:colour: Fix exception message
via 876ee3fb849 examples: Fix invalid escape sequences
via 1f3d49edc6d examples: Don’t use deprecated method ‘has_key()’
via 2870ef951e9 buildtools: Remove semicolons
from afb335664c9 s4-torture: add another test to demonstrate identical functions
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit d895c98c507a72116ef414e07da4dab7c8f61504
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Sep 11 11:59:55 2023 +1200
wintest: Fix invalid escape sequences
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Oct 13 04:55:06 UTC 2023 on atb-devel-224
commit 3f70da665bd7e4946cc5e777c52fdaa1954119d3
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:58:18 2023 +1300
selftest: Use now() instead of utcnow()
utcnow() is deprecated and will be removed in a future version of Python.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 44958f363eef97c3bbc9c69a78d89f53df21edda
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:35:32 2023 +1300
s4:torture: Use assertEqual() instead of assertEquals()
assertEquals() was removed in Python 3.12.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 9e3a858969a035518ed5b1a87c378e2371efd3b5
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:07:54 2023 +1300
s4:dsdb:tests: Use loadTestsFromTestCase() instead of makeSuite()
makeSuite() is deprecated and will be removed in Python 3.13.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit bb77f36f49c7866f8353b68129202a1e7793bc14
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 14:25:52 2023 +1300
s4:dsdb:tests: Fix assertion messages
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 1513a4592c0aa95d52dc5adce45be602cdacc354
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 14:25:16 2023 +1300
s4:dsdb:tests: Remove unused variables
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 079306cf34fb460d87ad1109ff32e889667f7086
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 14:24:49 2023 +1300
s4:dsdb:tests: Remove unused imports
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 39a4d27a83cb59474fc349ae3e68c10374c296d6
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Thu Aug 17 11:20:40 2023 +1200
s3:script: Remove semicolons
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 1a4ec25b3270544c1611ee7f876be43dd68b9806
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:06:45 2023 +1300
tests/krb5: Fix assertion messages
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 2f5833cbb3adc0e3cc666edb62fa860288bf6a36
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:32:10 2023 +1300
tests/krb5: Use assertEqual() instead of assertEquals()
assertEquals() was removed in Python 3.12.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit f7009e2a35ce6dc0113cf373db06f5f9938f6748
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:58:00 2023 +1300
python:tests: Use now() instead of utcnow()
utcnow() is deprecated and will be removed in a future version of Python.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit af61444d7a58d1b05aa8cad552ac778dc56b552a
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Thu Aug 17 11:09:31 2023 +1200
python:tests: Remove semicolons
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 7efe6b0ab42f7b6af5c82a8f6d412f9da16a963b
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:07:16 2023 +1300
python:tests: Correct search expression
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit ed97b15fe9795214b6497e91ead943c933d53325
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:07:03 2023 +1300
python:tests: Fix comment
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit d2196545bb032902ab138809802e5eb2e9fd84a5
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:06:07 2023 +1300
python:tests: Fix exception message
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 2fa838d439571f8669a209445b47ece80e86a2a1
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:34:05 2023 +1300
python:tests: Use assertEqual() instead of assertEquals()
assertEquals() was removed in Python 3.12.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 08dbb35e7e460de95e77c2c2f255f155b02c57e0
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 13:57:43 2023 +1300
python:subunit: Use now() instead of utcnow()
utcnow() is deprecated and will be removed in a future version of Python.
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 7c89c5880ea60c13839a27b244f3c855ecf9e464
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Oct 2 15:05:33 2023 +1300
python:colour: Fix exception message
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 876ee3fb849e12974da58ea08968edf1a4d5c526
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Sep 11 11:59:08 2023 +1200
examples: Fix invalid escape sequences
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 1f3d49edc6d9d8f82b634d1ade3512cf7c4abd8d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Mon Sep 11 11:50:22 2023 +1200
examples: Don’t use deprecated method ‘has_key()’
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 2870ef951e9379b8d6991d301f07e4279e25a40d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date: Tue Aug 29 20:47:58 2023 +1200
buildtools: Remove semicolons
Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_abi.py | 2 +-
buildtools/wafsamba/samba_autoconf.py | 4 +--
buildtools/wafsamba/samba_conftests.py | 2 +-
buildtools/wafsamba/samba_perl.py | 8 +++---
buildtools/wafsamba/samba_pidl.py | 2 +-
examples/logon/ntlogon/ntlogon.py | 12 ++++-----
python/samba/colour.py | 2 +-
python/samba/subunit/run.py | 2 +-
python/samba/tests/__init__.py | 2 +-
.../blackbox/smbcacls_propagate_inhertance.py | 30 +++++++++++-----------
python/samba/tests/gpo.py | 4 +--
python/samba/tests/krb5/kdc_tests.py | 6 ++---
python/samba/tests/krb5/raw_testcase.py | 4 +--
python/samba/tests/ldap_whoami.py | 2 +-
python/samba/tests/reparsepoints.py | 10 ++++----
python/samba/tests/samba_tool/gpo.py | 4 +--
.../tests/samba_tool/user_virtualCryptSHA_gpg.py | 4 +--
.../user_virtualCryptSHA_userPassword.py | 20 +++++++--------
python/samba/tests/segfault.py | 4 +--
python/samba/tests/sid_strings.py | 4 +--
python/samba/tests/smb.py | 2 +-
python/samba/tests/smb2symlink.py | 4 +--
python/samba/tests/smbd_fuzztest.py | 4 +--
selftest/subunithelper.py | 2 +-
source3/script/tests/getset_quota.py | 6 ++---
source3/script/tests/test_smbcquota.py | 2 +-
.../dsdb/tests/python/ad_dc_medley_performance.py | 7 ++---
source4/dsdb/tests/python/ad_dc_multi_bind.py | 3 ++-
source4/dsdb/tests/python/ad_dc_performance.py | 7 ++---
.../tests/python/ad_dc_provision_performance.py | 3 ++-
.../dsdb/tests/python/ad_dc_search_performance.py | 11 +++-----
source4/dsdb/tests/python/ndr_pack_performance.py | 3 ++-
source4/dsdb/tests/python/password_settings.py | 4 +--
source4/dsdb/tests/python/priv_attrs.py | 6 ++---
source4/dsdb/tests/python/user_account_control.py | 29 ++++++---------------
source4/torture/drs/python/getncchanges.py | 4 +--
.../torture/drs/python/samba_tool_drs_critical.py | 4 +--
wintest/test-s4-howto.py | 14 +++++-----
wintest/wintest.py | 18 ++++++-------
39 files changed, 124 insertions(+), 137 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 682f4e897b5..2d9505d255c 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -225,7 +225,7 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
if k in sorted(invmap.keys()):
f.write("\tglobal:\n")
for s in invmap.get(k, []):
- f.write("\t\t%s;\n" % s);
+ f.write("\t\t%s;\n" % s)
f.write("}%s;\n\n" % last_key)
last_key = " %s" % symver
f.write("%s {\n" % current_version)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 7cebcca40c5..546b0daf932 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -963,10 +963,10 @@ def CURRENT_CFLAGS(bld, target, cflags,
if not 'EXTRA_CFLAGS' in bld.env:
list = []
else:
- list = bld.env['EXTRA_CFLAGS'];
+ list = bld.env['EXTRA_CFLAGS']
ret.extend(list)
if not allow_warnings and 'PICKY_CFLAGS' in bld.env:
- list = bld.env['PICKY_CFLAGS'];
+ list = bld.env['PICKY_CFLAGS']
ret.extend(list)
if hide_symbols and bld.env.HAVE_VISIBILITY_ATTR:
ret.append(bld.env.VISIBILITY_CFLAGS)
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index c5e3fc9ecf6..38ce20d968f 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -84,7 +84,7 @@ def CHECK_ICONV(conf, define='HAVE_NATIVE_ICONV'):
@conf
def CHECK_LARGEFILE(conf, define='HAVE_LARGEFILE'):
'''see what we need for largefile support'''
- getconf_cflags = conf.CHECK_COMMAND(['getconf', 'LFS_CFLAGS']);
+ getconf_cflags = conf.CHECK_COMMAND(['getconf', 'LFS_CFLAGS'])
if getconf_cflags is not False:
if (conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
define='WORKING_GETCONF_LFS_CFLAGS',
diff --git a/buildtools/wafsamba/samba_perl.py b/buildtools/wafsamba/samba_perl.py
index b4263137b59..2139d143fc7 100644
--- a/buildtools/wafsamba/samba_perl.py
+++ b/buildtools/wafsamba/samba_perl.py
@@ -34,18 +34,18 @@ def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
perl_arch_install_dir = None
if vendor_prefix == conf.env.PREFIX:
- perl_arch_install_dir = check_perl_config_var('vendorarch');
+ perl_arch_install_dir = check_perl_config_var('vendorarch')
if perl_arch_install_dir is None:
- perl_arch_install_dir = "${LIBDIR}/perl5";
+ perl_arch_install_dir = "${LIBDIR}/perl5"
conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir
perl_lib_install_dir = None
if vendor_prefix == conf.env.PREFIX:
- perl_lib_install_dir = check_perl_config_var('vendorlib');
+ perl_lib_install_dir = check_perl_config_var('vendorlib')
if perl_lib_install_dir is None:
- perl_lib_install_dir = "${DATADIR}/perl5";
+ perl_lib_install_dir = "${DATADIR}/perl5"
conf.start_msg("PERL_LIB_INSTALL_DIR: ")
conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir
diff --git a/buildtools/wafsamba/samba_pidl.py b/buildtools/wafsamba/samba_pidl.py
index 0ce860ca6ae..a161a77bcb5 100644
--- a/buildtools/wafsamba/samba_pidl.py
+++ b/buildtools/wafsamba/samba_pidl.py
@@ -12,7 +12,7 @@ def SAMBA_PIDL(bld, pname, source,
'''Build a IDL file using pidl.
This will produce up to 13 output files depending on the options used'''
- bname = source[0:-4]; # strip off the .idl suffix
+ bname = source[0:-4] # strip off the .idl suffix
bname = os.path.basename(bname)
name = "%s_%s" % (pname, bname.upper())
diff --git a/examples/logon/ntlogon/ntlogon.py b/examples/logon/ntlogon/ntlogon.py
index 53881684382..7213012fa80 100755
--- a/examples/logon/ntlogon/ntlogon.py
+++ b/examples/logon/ntlogon/ntlogon.py
@@ -125,15 +125,15 @@ def buildScript(buf, sections, group, user, ostype, machine, debug, pause):
# that section headers contain user defined text.
#
if s == 'Global':
- hdrstring = '\[ *' + s + ' *\]'
+ hdrstring = r'\[ *' + s + r' *\]'
elif s == 'Group':
- hdrstring = '\[ *' + s + ' *- *' + group + ' *\]'
+ hdrstring = r'\[ *' + s + ' *- *' + group + r' *\]'
elif s == 'User':
- hdrstring = '\[ *' + s + ' *- *' + user + ' *\]'
+ hdrstring = r'\[ *' + s + ' *- *' + user + r' *\]'
elif s == 'OS':
- hdrstring = '\[ *' + s + ' *- *' + ostype + ' *\]'
+ hdrstring = r'\[ *' + s + ' *- *' + ostype + r' *\]'
elif s == 'Machine':
- hdrstring = '\[ *' + s + ' *- *' + machine + ' *\]'
+ hdrstring = r'\[ *' + s + ' *- *' + machine + r' *\]'
#
# See if we have found a section header
@@ -187,7 +187,7 @@ def buildScript(buf, sections, group, user, ostype, machine, debug, pause):
print "Error: No substitution text provided line: %d" % idx
sys.exit(1)
- if macros.has_key(varname):
+ if varname in macros:
print "Warning: macro %s redefined line: %d" % (varname, idx)
macros[varname] = varsub
diff --git a/python/samba/colour.py b/python/samba/colour.py
index 4a33acc3638..1fb6f24fb6a 100644
--- a/python/samba/colour.py
+++ b/python/samba/colour.py
@@ -111,7 +111,7 @@ def is_colour_wanted(*streams, hint='auto'):
return True
if hint not in ('auto', 'tty', 'if-tty', None, ''):
- raise ValueError("unexpected colour hint: {hint}; "
+ raise ValueError(f"unexpected colour hint: {hint}; "
"try always|never|auto")
from os import environ
diff --git a/python/samba/subunit/run.py b/python/samba/subunit/run.py
index 7881db448a8..4cf42b05eaf 100755
--- a/python/samba/subunit/run.py
+++ b/python/samba/subunit/run.py
@@ -436,7 +436,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator):
time = self._time
if time is not None:
return
- time = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
+ time = datetime.datetime.now(tz=datetime.timezone.utc)
self.decorated.time(time)
@property
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index e7811566539..14bf3295f07 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -364,7 +364,7 @@ class TestCaseInTempDir(TestCase):
# os.path.join will happily step out of the tempdir,
# so let's just check.
if os.path.dirname(path) != self.tempdir:
- raise ValueError("{path} might be outside {self.tempdir}")
+ raise ValueError(f"{path} might be outside {self.tempdir}")
try:
_rm(path)
diff --git a/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py b/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py
index 3d069225420..87f4c4f43f5 100644
--- a/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py
+++ b/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py
@@ -334,7 +334,7 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
self.assertTrue(self.file_ace_check(self.f1, child_file_ace) == False)
# nested dir 'oi_dir/nested/' should have CI|I|READ
- child_dir_ace = self.ace_parse_str(dir_inherited_ace_str);
+ child_dir_ace = self.ace_parse_str(dir_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.nested_dir, child_dir_ace))
# nested file 'oi_dir/nested/file-2' should NOT have inherited I/READ
@@ -342,7 +342,7 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
self.assertTrue(self.file_ace_check(self.f2, child_file_ace) == False)
# nested dir 'oi_dir/nested/nested_again' should have CI|I|READ
- child_dir_ace = self.ace_parse_str(dir_inherited_ace_str);
+ child_dir_ace = self.ace_parse_str(dir_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.nested_again_dir, child_dir_ace))
# nested file 'oi_dir/nested/nested_again/file-3' should NOT have inherited I/READ
@@ -410,7 +410,7 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
dir_ace = self.ace_parse_str(dir_acl_str)
self.assertTrue(self.file_ace_check(self.oi_dir, dir_ace) == False)
- child_file_ace = self.ace_parse_str(file_inherited_ace_str);
+ child_file_ace = self.ace_parse_str(file_inherited_ace_str)
# nested file 'oi_dir/file-1' should NOT have inherited I/READ
self.assertTrue(self.file_ace_check(self.f1, child_file_ace) == False)
@@ -481,7 +481,7 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
dir_mod_acl_str, self.oi_dir])
# check top level container 'oi_dir' has CI/CHANGE
- dir_ace = self.ace_parse_str(dir_mod_acl_str);
+ dir_ace = self.ace_parse_str(dir_mod_acl_str)
self.assertTrue(self.file_ace_check(self.oi_dir, dir_ace))
# nested file 'oi_dir/file-1' should NOT have inherited I/CHANGE
@@ -553,23 +553,23 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
self.assertTrue(self.file_ace_check(self.oi_dir, dir_ace))
# nested file 'oi_dir/file-1' should have inherited I/READ
- child_file_ace = self.ace_parse_str(file_inherited_ace_str);
+ child_file_ace = self.ace_parse_str(file_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.f1, child_file_ace))
# nested dir 'oi_dir/nested/' should have OI|CI|I|READ
- child_dir_ace = self.ace_parse_str(dir_inherited_ace_str);
+ child_dir_ace = self.ace_parse_str(dir_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.nested_dir, child_dir_ace))
# nested file 'oi_dir/nested/file-2' should have inherited I/READ
- child_file_ace = self.ace_parse_str(file_inherited_ace_str);
+ child_file_ace = self.ace_parse_str(file_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.f2, child_file_ace))
# nested dir 'oi_dir/nested/nested_again' should have OI|CI|I|READ
- child_dir_ace = self.ace_parse_str(dir_inherited_ace_str);
+ child_dir_ace = self.ace_parse_str(dir_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.nested_again_dir, child_dir_ace))
# nested file 'oi_dir/nested/nested_again/file-3' should have inherited I/READ
- child_file_ace = self.ace_parse_str(file_inherited_ace_str);
+ child_file_ace = self.ace_parse_str(file_inherited_ace_str)
self.assertTrue(self.file_ace_check(self.f3, child_file_ace))
except BlackboxProcessError as e:
@@ -720,24 +720,24 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase):
self.assertTrue(self.file_ace_check(self.oi_dir, dir_ace))
# nested file 'oi_dir/file-1' should have inherited I|CHANGE
- child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str);
- self.assertTrue(self.file_ace_check(self.f1, child_file_ace));
+ child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str)
+ self.assertTrue(self.file_ace_check(self.f1, child_file_ace))
# nested dir 'oi_dir/nested/' should have OI|CI|I|CHANGE
child_dir_ace = self.ace_parse_str(dir_mod_inherited_ace_str)
self.file_ace_check(self.nested_dir, child_dir_ace)
# nested file 'oi_dir/nested/file-2' should have inherited I|CHANGE
- child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str);
- self.assertTrue(self.file_ace_check(self.f2, child_file_ace));
+ child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str)
+ self.assertTrue(self.file_ace_check(self.f2, child_file_ace))
# nested dir 'oi_dir/nested/nested_again' should have OI|CI|I|CHANGE
child_dir_ace = self.ace_parse_str(dir_mod_inherited_ace_str)
self.file_ace_check(self.nested_again_dir, child_dir_ace)
# nested file 'oi_dir/nested/nested_again/file-3' should have inherited I|CHANGE
- child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str);
- self.assertTrue(self.file_ace_check(self.f3, child_file_ace));
+ child_file_ace = self.ace_parse_str(file_mod_inherited_ace_str)
+ self.assertTrue(self.file_ace_check(self.f3, child_file_ace))
except BlackboxProcessError as e:
self.fail(str(e))
diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py
index 744c348302a..c317bd8d15e 100644
--- a/python/samba/tests/gpo.py
+++ b/python/samba/tests/gpo.py
@@ -72,7 +72,7 @@ from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.serialization import Encoding
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from samba.samba3 import param as s3param
def dummy_certificate():
@@ -81,7 +81,7 @@ def dummy_certificate():
os.environ.get('SERVER'))
])
cons = x509.BasicConstraints(ca=True, path_length=0)
- now = datetime.utcnow()
+ now = datetime.now(tz=timezone.utc)
key = rsa.generate_private_key(public_exponent=65537, key_size=2048,
backend=default_backend())
diff --git a/python/samba/tests/krb5/kdc_tests.py b/python/samba/tests/krb5/kdc_tests.py
index b7c8566a1ec..bd1b0069917 100755
--- a/python/samba/tests/krb5/kdc_tests.py
+++ b/python/samba/tests/krb5/kdc_tests.py
@@ -164,7 +164,7 @@ class KdcTests(RawKerberosTest):
self.check_as_reply(rep)
etype = rep['enc-part']['etype']
- self.assertEquals(AES256_CTS_HMAC_SHA1_96, etype)
+ self.assertEqual(AES256_CTS_HMAC_SHA1_96, etype)
def test_arc4_hmac_md5(self):
creds = self.get_user_creds()
@@ -178,7 +178,7 @@ class KdcTests(RawKerberosTest):
self.check_as_reply(rep)
etype = rep['enc-part']['etype']
- self.assertEquals(ARCFOUR_HMAC_MD5, etype)
+ self.assertEqual(ARCFOUR_HMAC_MD5, etype)
def test_aes_rc4(self):
creds = self.get_user_creds()
@@ -192,7 +192,7 @@ class KdcTests(RawKerberosTest):
self.check_as_reply(rep)
etype = rep['enc-part']['etype']
- self.assertEquals(AES256_CTS_HMAC_SHA1_96, etype)
+ self.assertEqual(AES256_CTS_HMAC_SHA1_96, etype)
def test_clock_skew(self):
creds = self.get_user_creds()
diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py
index af30921aa99..2681356f3cf 100644
--- a/python/samba/tests/krb5/raw_testcase.py
+++ b/python/samba/tests/krb5/raw_testcase.py
@@ -4576,9 +4576,9 @@ class RawKerberosTest(TestCase):
continue
if expected_claims:
- empty_msg = ', and {claims_type} were expected'
+ empty_msg = f', and {claims_type} were expected'
else:
- empty_msg = ' for {claims_type} (should be missing)'
+ empty_msg = f' for {claims_type} (should be missing)'
claims_metadata_ndr = ndr_unpack(claims.CLAIMS_SET_METADATA_NDR,
remaining)
diff --git a/python/samba/tests/ldap_whoami.py b/python/samba/tests/ldap_whoami.py
index 95c08cf76d6..607ebce289f 100644
--- a/python/samba/tests/ldap_whoami.py
+++ b/python/samba/tests/ldap_whoami.py
@@ -22,7 +22,7 @@ import os
class LdapWhoami(tests.TestCase):
def test_ldap_whoami(self):
lp = s3param.get_context()
- lp.load(os.getenv("SERVERCONFFILE"));
+ lp.load(os.getenv("SERVERCONFFILE"))
domain=os.getenv("DOMAIN")
username=os.getenv("DC_USERNAME")
diff --git a/python/samba/tests/reparsepoints.py b/python/samba/tests/reparsepoints.py
index 95c41d18525..cb7421df518 100644
--- a/python/samba/tests/reparsepoints.py
+++ b/python/samba/tests/reparsepoints.py
@@ -119,7 +119,7 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
CreateDisposition=libsmb.FILE_CREATE)
b = reparse_symlink.put(0x80000025, 0, b'asdfasdfasdfasdfasdfasdf')
conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
- conn.close(fd);
+ conn.close(fd)
fd,cr,_ = conn.create_ex(
filename,
@@ -133,7 +133,7 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
conn.write(fd, b'x', 1)
conn.delete_on_close(fd, 1)
- conn.close(fd);
+ conn.close(fd)
# Show that directories can carry reparse points
@@ -164,7 +164,7 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
ntstatus.NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED)
conn.delete_on_close(dir_fd, 1)
- conn.close(dir_fd);
+ conn.close(dir_fd)
# Only empty directories can carry reparse points
@@ -215,7 +215,7 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
CreateDisposition=libsmb.FILE_CREATE)
b = reparse_symlink.put(0x80000025, 0, b'asdfasdfasdfasdfasdfasdf')
conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
- conn.close(fd);
+ conn.close(fd)
fd1 = conn.create(
filename,
@@ -233,7 +233,7 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
self.assertEqual(e.exception.args[0],
ntstatus.NT_STATUS_SHARING_VIOLATION)
- conn.delete_on_close(fd1, 1);
+ conn.delete_on_close(fd1, 1)
conn.close(fd1)
if __name__ == '__main__':
diff --git a/python/samba/tests/samba_tool/gpo.py b/python/samba/tests/samba_tool/gpo.py
index f5adccb88a1..39363bc4f75 100644
--- a/python/samba/tests/samba_tool/gpo.py
+++ b/python/samba/tests/samba_tool/gpo.py
@@ -1805,8 +1805,8 @@ class GpoCmdTestCase(SambaToolCmdTest):
self.assertIn('UserPolicy : False', out,
'The test cse should not have User policy enabled')
cse_ext = re.findall(r'^UniqueGUID\s+:\s+(.*)', out)
- self.assertEquals(len(cse_ext), 1,
- 'The test cse GUID was not found')
+ self.assertEqual(len(cse_ext), 1,
+ 'The test cse GUID was not found')
cse_ext = cse_ext[0]
self.assertTrue(check_guid(cse_ext),
'The test cse GUID was not formatted correctly')
diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_gpg.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_gpg.py
index 25c02d9ac2a..1ceaf2d1320 100644
--- a/python/samba/tests/samba_tool/user_virtualCryptSHA_gpg.py
+++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_gpg.py
@@ -219,8 +219,8 @@ class UserCmdCryptShaTestCaseGPG(UserCmdCryptShaTestCase):
out = self._get_password("virtualCryptSHA256;rounds=2561," +
"virtualCryptSHA512;rounds=5129",
True)
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
# The returned hashes should specify the correct number of rounds
self.assertTrue(sha256.startswith("{CRYPT}$5$rounds=2561"))
diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_userPassword.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_userPassword.py
index 98619a43fae..75a9fe57325 100644
--- a/python/samba/tests/samba_tool/user_virtualCryptSHA_userPassword.py
+++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_userPassword.py
@@ -92,8 +92,8 @@ class UserCmdCryptShaTestCaseUserPassword(UserCmdCryptShaTestCase):
sha512 = _get_attribute(out, "virtualCryptSHA512")
out = self._get_password("virtualCryptSHA256,virtualCryptSHA512")
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
# gpg decryption not enabled.
# both virtual attributes specified, rounds specified
@@ -115,8 +115,8 @@ class UserCmdCryptShaTestCaseUserPassword(UserCmdCryptShaTestCase):
sha512 = _get_attribute(out, "virtualCryptSHA512")
out = self._get_password("virtualCryptSHA256,virtualCryptSHA512")
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
# gpg decryption not enabled.
# both virtual attributes specified, rounds specified
@@ -142,8 +142,8 @@ class UserCmdCryptShaTestCaseUserPassword(UserCmdCryptShaTestCase):
out = self._get_password("virtualCryptSHA256;rounds=2561," +
"virtualCryptSHA512;rounds=5129")
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
# Number of rounds should match that specified
self.assertTrue(sha256.startswith("{CRYPT}$5$rounds=2561"))
@@ -174,12 +174,12 @@ class UserCmdCryptShaTestCaseUserPassword(UserCmdCryptShaTestCase):
out = self._get_password("virtualCryptSHA256;rounds=4000," +
"virtualCryptSHA512;rounds=5000")
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
# As the number of rounds did not match, should have returned the
# first hash of the corresponding scheme
out = self._get_password("virtualCryptSHA256," +
"virtualCryptSHA512")
- self.assertEquals(sha256, _get_attribute(out, "virtualCryptSHA256"))
- self.assertEquals(sha512, _get_attribute(out, "virtualCryptSHA512"))
+ self.assertEqual(sha256, _get_attribute(out, "virtualCryptSHA256"))
+ self.assertEqual(sha512, _get_attribute(out, "virtualCryptSHA512"))
diff --git a/python/samba/tests/segfault.py b/python/samba/tests/segfault.py
index 4f1788cd62f..faf858e45c5 100644
--- a/python/samba/tests/segfault.py
+++ b/python/samba/tests/segfault.py
@@ -187,8 +187,8 @@ class SegfaultTests(samba.tests.TestCase):
@segfault_detector
def test_dcerpc_idl_set_inline_arrays(self):
"""Setting an inline array was incorrectly handled."""
- a = dnsserver.DNS_EXTENSION();
- x = dnsserver.DNS_RPC_DP_INFO();
+ a = dnsserver.DNS_EXTENSION()
+ x = dnsserver.DNS_RPC_DP_INFO()
x.pwszReserved = [a, a, a]
@no_gdb_backtrace
diff --git a/python/samba/tests/sid_strings.py b/python/samba/tests/sid_strings.py
index 5ff1edc0642..9f174bfd2aa 100644
--- a/python/samba/tests/sid_strings.py
+++ b/python/samba/tests/sid_strings.py
@@ -545,7 +545,7 @@ class SidStringsAsDnSearchWithDnObject(SidStringBase):
@DynamicTestCase
class SidStringsAsDnInSearchFilter(SidStringBase):
- """How does a bad <SID=x> dn work is a search filter?
+ """How does a bad <SID=x> dn work in a search filter?
Answer: on Windows it always works.
"""
@@ -560,7 +560,7 @@ class SidStringsAsDnInSearchFilter(SidStringBase):
--
Samba Shared Repository
More information about the samba-cvs
mailing list