diff options
author | Tim Beale <timbeale@catalyst.net.nz> | 2018-12-05 12:51:22 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-12-12 04:38:13 +0100 |
commit | da30c824b8240e92ad4bcdcd174d56c39235412e (patch) | |
tree | ac72bdb80954f8b4ee7c0725f0a7fd9867be4703 | |
parent | 629a41fc6542cda9c2d60f99e8d7856aa1e081e5 (diff) | |
download | samba-da30c824b8240e92ad4bcdcd174d56c39235412e.tar.gz |
tests: Extend SMB test_save_load_text case to check overwrite
Extend the test case to check overwriting a file as well. Currently this
has the behaviour of appending to the existing file, rather than
overwriting the file with new contents.
It's not clear from the API that this is the intended behaviour in this
case, so I've marked it as a failure.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | python/samba/tests/smb.py | 7 | ||||
-rw-r--r-- | selftest/knownfail.d/smb | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/python/samba/tests/smb.py b/python/samba/tests/smb.py index 70d6cd8ef2d..e3af777ab77 100644 --- a/python/samba/tests/smb.py +++ b/python/samba/tests/smb.py @@ -134,6 +134,13 @@ class SMBTests(samba.tests.TestCase): self.assertEquals(contents.decode('utf8'), test_contents, msg='contents of test file did not match what was written') + # check we can overwrite the file with new contents + new_contents = 'wxyz' * 128 + self.conn.savefile(test_file, new_contents.encode('utf8')) + contents = self.conn.loadfile(test_file) + self.assertEquals(contents.decode('utf8'), new_contents, + msg='contents of test file did not match what was written') + # with python2 this will save/load str type (with embedded nulls) # with python3 this will save/load bytes type def test_save_load_string_bytes(self): diff --git a/selftest/knownfail.d/smb b/selftest/knownfail.d/smb new file mode 100644 index 00000000000..32989a81374 --- /dev/null +++ b/selftest/knownfail.d/smb @@ -0,0 +1,3 @@ +# currently savefile appends rather than overwriting +samba.tests.smb.samba.tests.smb.SMBTests.test_save_load_text\(ad_dc:local\) +samba.tests.smb.python2.samba.tests.smb.SMBTests.test_save_load_text\(ad_dc:local\) |