summaryrefslogtreecommitdiffstats
path: root/test/unit
Commit message (Collapse)AuthorAgeFilesLines
* Log only non-ENOENT errors in diskfileLuis Pabon2013-11-211-1/+26
| | | | | | | | | | | | | | | | | | DiskFile.open() gets called for every PUT. The expected sideeffect is that if the file exists, the metadata in the object will be populated. DiskFile.open() was logging any errors it detected while trying to open() the file. Issue is that when we PUT a new file, there is no entry, and open() will return an error. The was incorrectly logging each one of these errors. Change-Id: I7d721df177761066fdaa46d278fff2d779924999 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/6316 Reviewed-by: Thiago Da Silva <thiago@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Prashanth Pai <ppai@redhat.com>
* fix error with swauth-clean-tokensThiago da Silva2013-11-201-0/+34
| | | | | | | | | | | | | Error is caused by left-over code from swauth. It had hard-coded the auth account to .auth. Changed code to use volume specified in the config file Change-Id: Id00eb3964b6b26a84511e4753ab80b2dea5654da Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6280 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/6312
* fix metadata overwrite during a post requestThiago da Silva2013-11-141-1/+91
| | | | | | | | | | | | | During a post request, the object-server is ovewriting the existing object metadata. This fix prevents the overwrite of the system metadata while it allows for the user to add/remove user metadata Change-Id: Ic62cd064589b625ee425a9934be8766650622c13 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6254 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Improve logging and raising DiskFileNoSpacePrashanth Pai2013-11-142-1/+149
| | | | | | | | | | | | | | | | | | | | | | | This commit only improves logging whenever ENOSPC (No space on disk) or EDQUOT (Quota limit exceeded) is returned by glusterfs Also, added methods to: - get filename from file descriptor - log with rate limit Caveat: Although raising DiskFileNoSpace results in object-server returning HTTPInsufficientStorage[507] correctly, the swift proxy-server invokes "best_response" method that returns [503] to the user. When write-behind translator is turned on in glusterfs, it may set errno to EIO instead of ENOSPC/EDQUOT. This is documented in BZ 986812 BUG: 985862, 985253, 1020724 Change-Id: Ib0c5e41c11a8cdccc2077f71c31d8a23229452bb Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6199 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* make gluster volume name configurableThiago da Silva2013-11-131-0/+14
| | | | | | | | | | | | | changed code to look at configuration file for the metadata gluster volume name. The default is still gsmetadata Change-Id: I9bf74b9566ea1c9716c42f7ced0f999e02824868 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6225 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/6258
* first gswauth functional testsThiago da Silva2013-11-041-13/+13
| | | | | | | | | | | | | | | | | | commiting first gswauth functional tests. Currently there are two tests, to create account and to create an user. Each test is self contained in that it goes through the process of creating and deleting accounts and users as needed. More tests will be added shortly. Change-Id: I26d577790aed8c79c9de11f224516423e9769962 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6188 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6211
* Rebase to OpenStack Swift Havana (1.10.0)Peter Portante2013-10-288-623/+1160
| | | | | | | | Change-Id: I90821230a1a7100c74d97cccc9c445251d0f65e7 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/6157 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* applied changes made by Luis Pabon to support gluster-swiftThiago da Silva2013-10-241-104/+8
| | | | | | | | | | | | | The current changes support only one account per volume The next changes will be made to add support for multiple accounts Also modified unit tests that were failing after code changes. Original changes were made here: https://github.com/lpabon/swauth/tree/gluster-swift Change-Id: I5577d7dc042fc22de8625c8bdf30329cc3338cb9 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6107 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Unit test coverage for Fake_file interfacesChetan Risbud2013-10-211-7/+20
| | | | | | | | | | | | | | | | The modified test case provides the complete coverage over Fake_file class. These interfaces are to be used for directory type of the objects. BUG:987841 https://bugzilla.redhat.com/show_bug.cgi?id=987841 Change-Id: I2401423d2013ce7d90c454c72fbb60f4bc05ceb1 Signed-off-by: Chetan Risbud <crisbud@redhat.com> Reviewed-on: http://review.gluster.org/6037 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* moving existing swauth unit testsThiago da Silva2013-10-175-0/+4583
| | | | | | | | | | | moving existing swauth unit tests to gluster-swift unit tests location Change-Id: I3445b7ef1a1abe584854f2b04ffc9949b3346814 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6106 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Adding new unit tests and removed some unused functionsThiago da Silva2013-10-101-0/+108
| | | | | | | | | | | New unit tests help improve test coverage of common/Glusterfs.py code Also removed a function that was no longer being used. Change-Id: Iaa0eed3d2b9ffcc148c1e00b28322ebf93b3f13c Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6053 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Enable version manifest unit testLuis Pabon2013-09-241-19/+7
| | | | | | | | | | | | | | | The version manifest unit test needed to be adjusted for gluster-swift. Gluster-swift does not support a PUT of an object "a" then another object "a/b". The first object "a" would be interpreted as a file, while "a/b" would require "a" to now be a directory. Change-Id: I1628d5575d1b68ccce20386a4a0a0b2442d631af Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5987 Reviewed-by: Chetan Risbud <crisbud@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Wrap disk file construction in a method; pep8Peter Portante2013-09-201-103/+93
| | | | | | | | Change-Id: I5e7af267bcbb510108f62a9c66b9baa6771cc8fe Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5985 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Remove reliance on /tmp/foo ...Peter Portante2013-09-201-30/+19
| | | | | | | | Change-Id: I1add2e7e74b59bf24ef46d9053723f0243ee08c5 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5984 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Move temp dir setup/cleanup where it belongsPeter Portante2013-09-201-698/+564
| | | | | | | | Change-Id: I18cdb6c9e8aa56014f49d2fcf4458c3499710ddf Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5983 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* OpenStack Swift proxy controller unit testsLuis Pabon2013-08-305-0/+485
| | | | | | | | | | | These are a copy of the OpenStack Swift proxy controller unit tests as of version their 1.9.1. Change-Id: Ib05bc2a37dbb29d729346d78ea8f6de83b82375b Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5735 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Handle GET on zero content length failure case.Chetan Risbud2013-08-281-17/+47
| | | | | | | | | | | | | | | Added a fake_file class that implements minimal set of functions that are invoked by the code in GET. BUG: 987841 https://bugzilla.redhat.com/show_bug.cgi?id=987841 Change-Id: I5bdf5be1c0c4c8231f34c9be529e6edc83774f2e Signed-off-by: Chetan Risbud <crisbud@redhat.com> Reviewed-on: http://review.gluster.org/5511 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Fix infinite loop for temp file renames on ENOENTPeter Portante2013-08-281-4/+52
| | | | | | | | | | | | | | | | | | | | | For whatever reason, it appears that GlusterFS, or perhaps FUSE can continuously return ENOENT on a rename system call even when we have double checked that there is no reason to do so. That is a bug for that sub system. However, our response to that bug can result in an infinite loop, which is bad. This code reduces that to 10 attempts. In addition, we restructed the open retry loop to match, providing module constants for the upper bounds of both retry loops. BUG: XXXXXX (https://bugzilla.redhat.com/show_bug.cgi?id=XXXXXX) Change-Id: Ia2d6dd427daba3ea0461863c5ffe3aef27c88f9b Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5670 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Fix container details test's starting environmentPeter Portante2013-08-281-134/+98
| | | | | | | | | | | | | When the unit tests are run in an environment like the functional tests, where the accurrate size in listings switch is on, we need to sure that the tests that verify the behavior when it is off run in that state. Change-Id: I9f3ef90af7ef4edc698e2b8b7f016e6aaa7fac98 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5703 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Depend only on OpenStack Swift 1.9.1Luis Pabon2013-08-281-0/+3
| | | | | | | | | | | | | | | * The master branch is currently tracking the development version 1.9.1 of Havana OpenStack Swift. * Seems that we still have some settings which are not reset in the unit tests. This fix provides a guaranteed state for test_utils.py:TestUtils.test_get_container_details Change-Id: Ie32f49743301bfa493f70ed8a539fb6840f9f67b Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5719 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Updates to support Havana interim version 1.9.1.Peter Portante2013-08-2116-920/+1536
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code changes are basically: * Apply refactoring in the DiskFile class to use the new DiskWriter abstraction * Move and rename our diskfile module to match upstream * ThreadPools allow us to remove the tpool usage around fsync * Update the Ring subclass to support the get_part() method * Update to use the 1.9.1 proxy server unit tests * Move the DebugLogger class to test.unit * Rebuild the Rings to use the new layout * Remove backup ring builder files * Update spec files to 1.9.1, and tox to use swift 1.9.1 * Updated version to 1.9.0-0 Change-Id: Ica12cac8b351627d67500723f1dbd8a54d45f7c8 Signed-off-by: Peter Portante <peter.portante@redhat.com> Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5331
* Fix spec file to support source rpmsLuis Pabon2013-08-211-7/+8
| | | | | | | | | | | | | | | | Our initial implementation only required Jenkins to export binary RPMs, but as we move foward, we really need to also export SRPMs. To support SRPMs, the spec file in the RPM has to have the correct NAME, VERSION, and RELEASE information. Change-Id: Icd7132b4aafdbe7a1f02a35d0be7ad63b2e7c056 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5669 Reviewed-by: Peter Portante <pportant@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Peter Portante <pportant@redhat.com> Reviewed-on: http://review.gluster.org/5679
* perf: Container and account performance incLuis Pabon2013-08-062-7/+12
| | | | | | | | | | | | | | | | | | | | | * Container and accounts performance increase by removing the need to update either the object count or the container count, respectively. New hidden configuratoins added to re-enable the functionality. * object_only configuratoin removed from fs.conf and replaced with a hidden configuration. The new hidden configuration reports gratuituosly crated directories as objects, to support a compatibility behavior with previous version 1.4.8 (even though it was incorrect). BUG 988969: https://bugzilla.redhat.com/show_bug.cgi?id=988969 Change-Id: Idca20b8629ec38606ff5692fe62bc2cadabffc86 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5403 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com> Reviewed-on: http://review.gluster.org/5504
* Gluster to handle ENOSPC (Error 28) correctlyChetan Risbud2013-08-061-3/+45
| | | | | | | | | | | | | | | | | A gluster volume could yield an ENOSPC condition seeing that a volume is full. This needed to handled correctly. Added error handling. BUG: 985253 https://bugzilla.redhat.com/show_bug.cgi?id=985253 Change-Id: I85472c0a81a354a2796327fead606da3a938d4bf Signed-off-by: Chetan Risbud <crisbud@redhat.com> Reviewed-on: http://review.gluster.org/5362 Reviewed-by: Peter Portante <pportant@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Updating copyrights with current yearChetan Risbud2013-07-244-4/+19
| | | | | | | | | | | Copyrights are updated across the code to reflect 2013. Copyrights message was added to couple of scripts. Change-Id: I2cfc7bdc6adaa5c9ab0075aab49021a5f0dea7a1 Signed-off-by: Chetan Risbud <crisbud@redhat.com> Reviewed-on: http://review.gluster.org/5371 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Gracefully handle the ring file not found error.Mohammed Junaid2013-07-241-0/+13
| | | | | | | | Change-Id: I35c33f3938709d5d9a9a55640a503f186df9a965 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5368 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Final forward port of PDQ performance patchesPeter Portante2013-07-106-212/+710
| | | | | | | | Change-Id: I4ef131b3cc7648d4571a4d854029efb1aff8b901 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5305 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Remove do_mkdir and simplify mkdirsLuis Pabon2013-07-091-22/+3
| | | | | | | | Change-Id: I2e629533bceafb341ced5b1b3f2436448293e03f Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5304 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Removed unused metadata key and do_rmdir funcLuis Pabon2013-07-091-18/+0
| | | | | | | | | Change-Id: Ibcef5d817390a11d85cf125bb9addfbfded1b019 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5301 Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* OpenStack Swift Functional Tests for G4SLuis Pabon2013-06-283-18/+349
| | | | | | | | | | | | | | | | | | | | This commit has the following changes: * G4S no longer accepts URLs that end in /. A HTTP code of 400 is returned when a / at the end of the object is detected. * Directories can be created as objects setting the content-type to application/directory and content-length to 0. * Functional tests have been adjusted to work with G4S constraints Change-Id: I31038a59699a8e3eeaba902db322218c6400093e Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5246 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* object-storage: remove stat of directoriesMohammed Junaid2013-06-271-246/+5
| | | | | | | | | | | | | | | | | It was painfully slow to gather a list of all the files in a directory tree when there were as many directories as files, since we also stat'd all of the directories as well. We only did that to cache using memcache the result, to know when it changed. However, there was no way for a memcache object to be passed down to this code. So we have removed the memcache support entirely, and removed the stat of the directories as a result. See BZ 911448 (https://bugzilla.redhat.com/show_bug.cgi?id=911448). Change-Id: I2625f82eca36c31eeffa84dc76ef7f3b48aafec5 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5252 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* object-storage: Use fchown instead of chown.Mohammed Junaid2013-06-271-0/+39
| | | | | | | | | | | This is a step towards making fd based system calls where ever possible to avoid path lookups. Signed-off-by: Mohammed Junaid <junaid@redhat.com> Change-Id: I482ea29ebe0859d0a5307ff25ecb5945d54bc7ca Reviewed-on: http://review.gluster.org/5251 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Return correct status when deleting non-existing containerLuis Pabon2013-06-112-0/+69
| | | | | | | | | | | | | | | The code was raising an exception when the container (which happens to be a directory) did not exist. To be compatible with OpenStack Swift, we need to handle an object which its container/directory does not exist. BUG: 960944 (https://bugzilla.redhat.com/show_bug.cgi?id=960944) Change-Id: Ibb2db354a655e040fb70ebbe6a7d8f815d33dc0f Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5201 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Refactor DiskDir and DiskAccount to use DiskCommonPeter Portante2013-06-071-120/+36
| | | | | | | | | | | | | | | | We have refactored DiskDir and DiskAccount so that truly common, shared functions live in the base class DiskCommon, and each of these then sub-class that. This allows us to isolate unique behaviors. We have also enabled all the skipped unit tests in test_diskdir.py that we could, removing a few that we don't need right now. Change-Id: I48d9c915108df8cc92c3e9a764563e1d10c50050 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5148 Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Change filters to use a generator patternPeter Portante2013-06-061-43/+208
| | | | | | | | | | | | | | | | | By using a generator pattern, we avoid creating whole new lists each time, instead we iterate through the original list once (after it is sorted), constructing the final list only once. We also address the behavioral differences between the swift filtering results and our code so that ported unit tests work the same (non-slash objects, that is). Change-Id: If32c1987f24781ff81ab4c28c9ddfff17c2e7787 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5145 Tested-by: Luis Pabon <lpabon@redhat.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com>
* Forward port PDQ 3489: turn off cont & act updatesPeter Portante2013-06-041-1/+48
| | | | | | | | | | | This is a simple sub-classing of the proper update methods to just no-op their behavior. Change-Id: Ib1ae5234d372cbce572da34cfe702235b78f2310 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5088 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Copy proxy unit test from OpenStack SwiftLuis Pabon2013-06-033-14/+5939
| | | | | | | | | | | | This is a copy of the proxy unit test from OpenStack Swift. The file has minor changes to make it compatible with Gluster For Swift. Change-Id: I64a0f8d274461eb2a2c38524c6282e0d3d3d1457 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5113 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Remove account name from being saved in the objectLuis Pabon2013-06-031-0/+14
| | | | | | | | | | | Instead we save the account in the a list, where the index to the account is the partition number. Change-Id: Ie4abefee48a3b237306a1e301ffa798e24e3f1db Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5120 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Bring initial DiskDir module coverage to 97%.Peter Portante2013-06-032-27/+735
| | | | | | | | | | | | | | | | | | | | This is quite ugly. Sorry. We ported a set of test from OpenStack Swift's test/unit/commont/test_db.py, the testAccountBroker and testContainerBroker, but because of the divergent nature of the current attempt UFO (Unified File and Object) implementation, it was not possible to use the interface calls directly. Instead, we are using these tests to make sure most of the code paths are exercised, and to define much of the expected behavior. Further refactoring, unit tests and functional test work will help us bring the code base and these tests closer to the originals in upstream OpenStack Swift (as of Havana). Change-Id: I095bb03619de6e7e1378b5252913e39b1ea8bf27 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5135 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Moved closing of fd1 to the inner try block in the test_do_write_err function.Mohammed Junaid2013-05-301-3/+3
| | | | | | | | | | | This is a follow up change to the previous commit to fs_utils unit test case patch. Change-Id: I677683677071efc6176ad2145d1806bc7e658c9e Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5116 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Remove duplicate class names.Peter Portante2013-05-292-3/+3
| | | | | | | | Change-Id: I7ef76b66beee1392d4e11544cc74de12a81e742a Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5115 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* Unittest case for constraints.pyMohammed Junaid2013-05-291-0/+96
| | | | | | | | Change-Id: Ibb37855c675d5def2ce2e1ed387429ce87a4926b Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5103 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Added some more unittest cases for fs_utils file.Mohammed Junaid2013-05-291-20/+143
| | | | | | | | | Change-Id: I4c13fd7b3d6c21389b701437dd4a4a5cd0a31212 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5065 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com>
* Remove unused is_marker method from utils.Peter Portante2013-05-281-14/+0
| | | | | | | | | Change-Id: I67f695b57405465c7bec22c437c2169403fa59dd Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5089 Reviewed-by: Mohammed Junaid <junaid@redhat.com> Tested-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com>
* Add skeleton unit tests for app server subclassesPeter Portante2013-05-248-0/+131
| | | | | | | | Change-Id: I75373c63b0b4d80e317208446c3addca07d1f110 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5083 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Bring DiskFile module coverge to 100%Peter Portante2013-05-241-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | To bring the DiskFile module coverage to 100%, we first recognize that do_fsync() will invoke fsync() in a separate thread, which gives coverage fits (see the commit history at https://github.com/portante/coverage/commits/master). To avoid that, we mock out do_fsync to make it a no-op and avoid the problem. The second thing we recognize is that mkstemp() relies on do_unlink from the fs_utils module, which already consumes ENOENT errors, so we don't need that code path in mkstemp() itself. The unused mock routine for do_unlink was removed as well, and we renamed the other do_unlink mock routine to os_unlink since it was mocking out os.unlink directly. Lastly, we rejigger the error on close test for mkstemp() to prematurely close the fd to cause an error which should just be squelched, completing the full coverage. Change-Id: I98283c17cf139f92282f8afd7083d567d3dd9a79 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5082 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Add coverage for gluster.swift module (PkgInfo).Peter Portante2013-05-241-0/+53
| | | | | | | | Change-Id: I614efb853989ab455721bbf28309cec746343f50 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5081 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Add DiskDir unit test skeleton and pep8 filterPeter Portante2013-05-242-9/+575
| | | | | | | | | | | | | | | | | The new DiskDir unit test skeleton is quite incomplete, but gets the DiskDir module on the board for modules covered, explicitly exposing the fact that we need to get test coverage. This is a first step. At the same time, we also update all the modules we have applying the fix for pep8 errors now run under tox. We can then add a Jenkins pre-commit job to fail on pep8 errors. This brings our code to parity with what they are doing in OpenStack Swift. Change-Id: Ia0565606512efda6e73f67bd00269177b89db858 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5080 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* object-store: Added busy_wait unit test to Glusterfs.pyLuis Pabon2013-05-171-0/+22
| | | | | | | | Change-Id: Ifee5dccd47a3e301812533851c45b9fe853f9b71 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/4983 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
* object-storage: Remove lines that are not neededLuis Pabon2013-05-141-2/+0
| | | | | | | | | Change-Id: Id4dbf684b1e57ec928b30bc2d9cb2e2b7e0f2389 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/4999 Reviewed-by: Peter Portante <pportant@redhat.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Tested-by: Mohammed Junaid <junaid@redhat.com>