diff options
author | Loic Dachary <loic@dachary.org> | 2013-02-08 00:59:43 +0100 |
---|---|---|
committer | Loic Dachary <loic@dachary.org> | 2013-02-11 23:14:30 +0100 |
commit | a62d5198356662d5cb08f9f74582c5a97578bf74 (patch) | |
tree | 3e84d097d5a7c840d97fd044bf8fd33d24a41ee9 /COPYING | |
parent | 70532d198539f94067e53ef48dd7d1f5114fa27d (diff) | |
download | ceph-a62d5198356662d5cb08f9f74582c5a97578bf74.tar.gz |
Unit tests for chain_xattr.cc
Create a new test file covering most (> 97%) of src/os/chain_xattr.{cc,h}
lines of code. The following functions are tested:
int chain_getxattr(const char *fn, const char *name, void *val, size_t size);
int chain_fgetxattr(int fd, const char *name, void *val, size_t size);
int chain_setxattr(const char *fn, const char *name, const void *val, size_t size);
int chain_fsetxattr(int fd, const char *name, const void *val, size_t size);
int chain_listxattr(const char *fn, char *names, size_t len);
int chain_flistxattr(int fd, char *names, size_t len);
int chain_removexattr(const char *fn, const char *name);
int chain_fremovexattr(int fd, const char *name);
The function translate_raw_name substitutes @@ into @. When the trailing
character is a @, it breaks. However, such an occurence cannot be created by
chain_setxattr because it always create pairs of @. Instead of silently
breaking the loop, the function should probably return on error so that the
caller can ignore it.
The function chain_fgetxattr_len may return on error if fgetxattr
returns on error. However, it is only called after another attr function
returned success and the tests cannot create the conditions under which
it would fail.
The function chain_fsetxattr may leak attributes when used to override
an existing attribute. This leak is not tested or fixed, it is just
discussed in http://marc.info/?l=ceph-devel&m=136027076615853&w=4
If the file system in which the tests are run does not support extended
attributes, the tests are not run. The detection uses the same logic as
the one implemented in FileStore::_detect_fs
The output of the tests are silenced to reduce the output when testing
assertions ( except for the dout_emergency function which cannot be
controlled).
Diffstat (limited to 'COPYING')
-rw-r--r-- | COPYING | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -98,6 +98,6 @@ License: -Files: test/common/Throttle.cc +Files: src/test/common/Throttle.cc src/test/filestore/chain_xattr.cc Copyright: Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com> License: LGPL2 or later |