6 Commits

Author SHA1 Message Date
Thiago da Silva
27fe040c3b changes references to swiftonfile in tests scripts
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-08 11:04:31 -04:00
Prashanth Pai
cb7e968873 Modify unit tests and func tests
* Updated tox.ini
* Created .unittests and .functests
* Added tempurl to pipeline in conf files so that tempurl tests are not
  skipped
* Updated .gitignore file

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-05-08 12:11:46 +05:30
Peter Portante
6fa675ca6e object-storage: add UFO unit tests
Run the UFO unit tests following the main GlusterFS unit tests. The
UFO unit tests run under the Nose unit test running harness, requiring
the python-nose package to be installed. These unit tests run fast
enough that we could even consider running them on a commit hook run
by rfc.sh.

Note that they are not functional tests, as they don't require a real
Gluster file system to run.

Change-Id: I55972890c24be16fc588a6950cb6bfd539287bbe
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4333
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-04-29 16:35:57 -04:00
Peter Portante
b0258bcd0f object-storage: del 1.4.8 ref from dir hierarchy
Remove the "swift/1.4.8" directory from the hierarchy, replacing it with "ufo".

Change-Id: I60ba171182d7402a2193616c1c95c90cd2ead5bc
BUG: 870589
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4200
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-04-29 16:35:56 -04:00
Peter Portante
f82b16c955 Further reduce extended attribute reads/writes
More refactoring towards reducing the number of extended attribute
reads/writes to the file system. See BZ 868120:
    http://bugzilla.redhat.com/show_bug.cgi?id=868120

Basically the redundant routines restore_object, restore_account and
restore_container have been collapsed to one routine, restore_metadata, which
will only write out metadata if the new metadata is different from what was
originally read.

Along with these changes come a set of unit tests for all the functions
related to the routines that are in this module in the call tree where
restore_metadata is invoked.

Change-Id: I957ee2f8646cbe6df4d4420d3bdfb1f6ac62bdd2
BUG: 868120
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4111
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-04-29 16:35:55 -04:00
Peter Portante
c61aea1464 object-storage: reduce the number of getxattr system calls by one
Initial step towards addressing BZ 865619.

Prior to the patch, reading metadata for a given object or container involves
at minimum three getxattr system calls for objects that use only one xattr
key/value pair:

    1. (via pyxattr)  getxattr() to see if key exists and get its value
       length (so it can allocate memory for second call below)
    2. (from pyxattr) getxattr() to get actual value data
    3. (via pyxattr)  getxattr() to see if following key exists

For objects and containers that only have to use one xattr key/value pair,
this patch reduces the number system calls by one. This can be significant
given that almost every Swift API operation requires reads of the object or
containers metadata.

This patch is mostly a change to plugins.utils.read_metadata() to try to
unpickle the accumulated metadata as each key/value pair is read, rather than
trying to accumulate all the key/value pairs and unpickle at the end. Once we
get enough data to form the pickle, we no longer keep trying to get more keys,
even if those keys exist.

The extra keys can exist when the size of the stored metadata shrinks below a
key threshold. See https://bugzilla.redhat.com/show_bug.cgi?id=865619 for more
details.

See also https://bugzilla.redhat.com/show_bug.cgi?id=865858.

This patch also adds a unit test infrastructure, and uses it to test with full
coverage, the read_metadata, write_metadata and clean_metadata functions. As a
result, we found that an infinite loop would occur in clean_metadata() when an
unexpected IOError would occur trying to remove a key (this patch contains a
fix).

Change-Id: Ia1838c5e73af453b65360c1c525824231aa7c5d4
BUG: 865619
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4109
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
2013-04-29 16:35:55 -04:00