diff options
author | Noel Power <noel.power@suse.com> | 2020-07-27 16:51:12 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-08-31 17:44:38 +0000 |
commit | c681f5bfe3669f913a6e592844458e1fd6a9fa13 (patch) | |
tree | f2a6f546bd0ef1538a1d0f33b2abac541a7d288c /python | |
parent | 8826d74ae8cd807af84213abde5292b6f5ff293e (diff) | |
download | samba-c681f5bfe3669f913a6e592844458e1fd6a9fa13.tar.gz |
python/samba/tests/blackbox: Preparatory change to support custom share
tearDown method doesn't handle local file deletion fallback if a share
other than 'tmp' is used
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/tests/blackbox/smbcacls.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/samba/tests/blackbox/smbcacls.py b/python/samba/tests/blackbox/smbcacls.py index b711530de02..3eca9602005 100644 --- a/python/samba/tests/blackbox/smbcacls.py +++ b/python/samba/tests/blackbox/smbcacls.py @@ -37,6 +37,7 @@ class SmbCaclsBlockboxTestBase(BlackboxTestCase): self.creds.set_password(self.passwd) self.testdir = os.getenv("TESTDIR", "smbcacls") self.share = os.getenv("SHARE", "tmp") + self.dirpath = os.path.join(os.environ["LOCAL_PATH"],self.testdir) def tearDown(self): try: @@ -50,11 +51,10 @@ class SmbCaclsBlockboxTestBase(BlackboxTestCase): raise Exception("deltree: failed without setting errcode") except Exception as e: print("remote remove failed: %s" % str(e)) - dirpath = os.path.join(os.environ["LOCAL_PATH"],self.testdir) - print("falling back to removing contents of local dir: %s" % dirpath) - if os.path.exists(dirpath): - for entry in os.listdir(dirpath): - fullpath = os.path.join(dirpath, entry) + print("falling back to removing contents of local dir: %s" % self.dirpath) + if os.path.exists(self.dirpath): + for entry in os.listdir(self.dirpath): + fullpath = os.path.join(self.dirpath, entry) if os.path.isdir(fullpath): import shutil shutil.rmtree(fullpath) |