From af61444d7a58d1b05aa8cad552ac778dc56b552a Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 17 Aug 2023 11:09:31 +1200 Subject: [PATCH] python:tests: Remove semicolons Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- .../blackbox/smbcacls_propagate_inhertance.py | 30 +++++++++---------- python/samba/tests/ldap_whoami.py | 2 +- python/samba/tests/reparsepoints.py | 10 +++---- python/samba/tests/segfault.py | 4 +-- python/samba/tests/smb.py | 2 +- python/samba/tests/smb2symlink.py | 4 +-- python/samba/tests/smbd_fuzztest.py | 4 +-- 7 files changed, 28 insertions(+), 28 deletions(-) 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/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/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/smb.py b/python/samba/tests/smb.py index 46080c79439..61c1719b330 100644 --- a/python/samba/tests/smb.py +++ b/python/samba/tests/smb.py @@ -147,7 +147,7 @@ class SMBTests(samba.tests.TestCase): """Returns whether a regular file exists (by trying to open it)""" try: self.smb_conn.loadfile(filepath) - exists = True; + exists = True except NTSTATUSError as err: if (err.args[0] == NT_STATUS_OBJECT_NAME_NOT_FOUND or err.args[0] == NT_STATUS_OBJECT_PATH_NOT_FOUND): diff --git a/python/samba/tests/smb2symlink.py b/python/samba/tests/smb2symlink.py index a2084c6a5de..f501a549ec6 100644 --- a/python/samba/tests/smb2symlink.py +++ b/python/samba/tests/smb2symlink.py @@ -95,7 +95,7 @@ class Smb2SymlinkTests(samba.tests.libsmb.LibsmbTests): target="foo" suffix="bar" - self.create_symlink(smb1, target, symlink); + self.create_symlink(smb1, target, symlink) with self.assertRaises(NTSTATUSError) as e: fd = smb2.create_ex(f'{symlink}\\{suffix}') @@ -115,7 +115,7 @@ class Smb2SymlinkTests(samba.tests.libsmb.LibsmbTests): symlink="syml" target="foo" - self.create_symlink(smb1, target, symlink); + self.create_symlink(smb1, target, symlink) with self.assertRaises(NTSTATUSError) as e: fd = smb2.create_ex(f'{symlink}') diff --git a/python/samba/tests/smbd_fuzztest.py b/python/samba/tests/smbd_fuzztest.py index a2891060ba1..5b0726e0859 100644 --- a/python/samba/tests/smbd_fuzztest.py +++ b/python/samba/tests/smbd_fuzztest.py @@ -27,7 +27,7 @@ class fuzzsmbd(samba.tests.TestCase): # terminated SMB1 Negprot, with a valid SessionSetup after. # BUG: #14205 causes the smbd server to crash. # - state = True; + state = True badblob = binascii.a2b_base64("AAAA1P9TTUJyAAAAABhDyAAAAAAAAAAAAAAAACcA/v8AAAAAALEAAlBDIE5F" "VFdPUksgUFJPR1JBTSD//jAAAk1JQ1JPU09GVCBOR1RXT1JLUyAxLjANDAJN" "SR3hkXOl0mb+QXW4Da/jp0f+AAAA1P9TTUJyAAAAABgDyAAABDQAAAAAAAAA" @@ -71,6 +71,6 @@ class fuzzsmbd(samba.tests.TestCase): for line in open(os.environ['SMBD_TEST_LOG']): if "INTERNAL ERROR: Signal 11 in pid" in line: print("Found crash in smbd log") - state = False; + state = False break self.assertTrue(state)