selftest: enable py3 for samba.tests.xattr
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 5 Apr 2018 02:49:55 +0000 (14:49 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 Apr 2018 06:59:09 +0000 (08:59 +0200)
Fix bytes and str issue.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/xattr.py

index b024175a8d6b1720c62b1b0d17d7e43a008ed855..8e6178bed75b088cc57d3a411b952e1c1fc90dec 100644 (file)
@@ -58,7 +58,7 @@ class XattrTests(TestCase):
         if not samba.xattr_native.is_xattr_supported():
             raise SkipTest()
         tempf = self._tmpfilename()
-        reftxt = "this is a test"
+        reftxt = b"this is a test"
         open(tempf, 'w').write("empty")
         try:
             samba.xattr_native.wrap_setxattr(tempf, "user.unittests", reftxt)
@@ -96,7 +96,7 @@ class XattrTests(TestCase):
     def test_set_and_get_tdb(self):
         tempf = self._tmpfilename()
         eadb_path = self._eadbpath()
-        reftxt = "this is a test"
+        reftxt = b"this is a test"
         open(tempf, 'w').write("empty")
         try:
             samba.xattr_tdb.wrap_setxattr(eadb_path, tempf, "user.unittests",
@@ -124,7 +124,7 @@ class XattrTests(TestCase):
     def test_set_and_get_posix_eadb(self):
         tempf = self._tmpfilename()
         eadb_path = self._eadbpath()
-        reftxt = "this is a test"
+        reftxt = b"this is a test"
         open(tempf, 'w').write("empty")
         try:
             samba.posix_eadb.wrap_setxattr(eadb_path, tempf, "user.unittests",