From: Venky Shankar Date: Fri, 9 Oct 2020 11:06:45 +0000 (-0400) Subject: tests/pybind/cephfs: cleanup xattrs before starting tests X-Git-Tag: v17.0.0~859^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aff632a67a4e96b4f9e7252a1ef2df22e297ffa3;p=ceph-ci.git tests/pybind/cephfs: cleanup xattrs before starting tests Some xattr tests do not fully cleanup set xattrs. Subsequent tests may expect xattrs to be absent during the test, such as setting an xattr and then removing followed by checking if the xattr list to be empty. This may fail if earlier tests do not cleanup xattrs, especially for root. So, cleanup xattrs on root before starting tests. Other directories are removed anyway, so we do not have to bother about those. Signed-off-by: Venky Shankar --- diff --git a/src/test/pybind/test_cephfs.py b/src/test/pybind/test_cephfs.py index dedce84674f..0b2a969b44e 100644 --- a/src/test/pybind/test_cephfs.py +++ b/src/test/pybind/test_cephfs.py @@ -34,6 +34,11 @@ def setup_test(): cephfs.closedir(d) cephfs.chdir(b"/") + _, ret_buf = cephfs.listxattr("/") + print(f'ret_buf={ret_buf}') + xattrs = ret_buf.decode('utf-8').split('\x00') + for xattr in xattrs[:-1]: + cephfs.removexattr("/", xattr) @with_setup(setup_test) def test_conf_get():