1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

samba.xattr: Massively simplify copytree_with_xattrs.

This commit is contained in:
Jelmer Vernooij
2012-02-27 02:46:31 +01:00
parent 2c9ff8a4d7
commit 8008228b94
3 changed files with 60 additions and 67 deletions

View File

@ -20,10 +20,16 @@
"""Tests for samba.xattr_native and samba.xattr_tdb."""
import samba.xattr_native, samba.xattr_tdb
from samba.xattr import copytree_with_xattrs
from samba.dcerpc import xattr
from samba.ndr import ndr_pack
from samba.tests import TestCase, TestSkipped
from samba.tests import (
TestCase,
TestCaseInTempDir,
TestSkipped,
)
import random
import shutil
import os
class XattrTests(TestCase):
@ -103,3 +109,20 @@ class XattrTests(TestCase):
finally:
os.unlink(tempf)
os.unlink(eadb_path)
class TestCopyTreeWithXattrs(TestCaseInTempDir):
def test_simple(self):
os.chdir(self.tempdir)
os.mkdir("a")
os.mkdir("a/b")
os.mkdir("a/b/c")
f = open('a/b/c/d', 'w')
try:
f.write("foo")
finally:
f.close()
copytree_with_xattrs("a", "b")
shutil.rmtree("a")
shutil.rmtree("b")