summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Adding function prototypes with this patch.Humble Chirammal2014-07-021-18/+19
| | | | | | | | | This helps ctypes know the calling conventions it should use to communicate with the binary interface of libgfapi and which types it should allocate and cast. Without it, ctypes fails/crashes when not running on the main thread. Change-Id: I73480229f451167377ed4d1534b08b66c689cc4f Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
* Fix functional testsPrashanth Pai2014-05-193-7/+81
| | | | | | | | | | | | | | * The order of elements in list returned by listdir() can vary and may not be sorted. This caused assertEqual in "test_listdir" to fail. * Also, some systems may have xattrs belonging to selinux. So, a listxattr can list them too. * Allow hostname/ip and volume name to be configured easily by setting it in test.conf. This enables functional tests to use a non-local volume. * Cleanup volume before and after running functional tests. * Added MANIFEST.in and LICENSE file Change-Id: Icfa6eb60e8d8e7ed4d6ab8190a2a2c80688999a3 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* Add statvfs supporthchiramm2014-05-022-0/+25
| | | | | | | | This support will help other consumers to get the statvfs details. Change-Id: Iee4e84a515ff80f24add812ad6fcf84c992bf356 Signed-off-by: hchiramm <hchiramm@redhat.com>
* adding new apis requested from gluster-swift projThiago da Silva2014-03-272-1/+43
| | | | | | | | This patch adds new functions that are used in gluster-swift. These functions are: dup, lseek, getatime, getctime, getmtime Change-Id: I09036f7e393a89e09913f7f6de173e1eca8dca95 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* merging creat and open function to be more pythonicThiago da Silva2014-03-212-19/+50
| | | | | | | | | | the os python module does not offer a creat function, new files are created using the open function and by passing O_CREAT flag. We are changing gfapi.py to function the same way. Change-Id: I5e084b200bb657e3124d3e620a47160e790cd1fe Signed-off-by: Thiago da Silva <thiago@redhat.com>
* changing gluster dir to glusterfsThiago da Silva2014-03-182-109/+109
| | | | | | | | | | making this change to avoid package conflicts with gluster-swift and glusterfs-api rpm. Eventually we will remove the python code from glusterfs-api rpm and create a new rpm package from libgfapi-python. Change-Id: I1b20cd747e500aed17fba89f96e62423325b5230 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* adding functions needed by gluster-swiftThiago da Silva2014-03-132-149/+354
| | | | | | | These new functions are required to be used by gluster-swift Change-Id: Ifb68f2b4494bf375feabb130831f9e076dc5b94a Signed-off-by: Thiago da Silva <thiago@redhat.com>
* added Apache license comment to source codeThiago da Silva2014-03-062-0/+30
| | | | | | | Added same license as gluster-swift Change-Id: Ib190b4e6def5d2ab87b71a04142f6344060d8a6d Signed-off-by: Thiago da Silva <thiago@redhat.com>
* adding new methods to Volume classThiago da Silva2014-03-062-10/+225
| | | | | | | | | | These are mostly helper methods similar to functions provided by the python os module helpfer functions added: exists, getsize, isdir, isfile, islink glfs functions added: removexattr, stat Change-Id: I3581a96224151481292a4e506d8c52b8acf79e49 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* changed write and read functions to support binary dataThiago da Silva2014-02-242-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | both functions were only supporting text data and needed to be changed to support binary data. The issue was found while testing libgfapi-python with smallfile (https://github.com/bengland2/smallfile). When calling gflfs_write, ctypes has no problem converting strings to the correct C data type, but is unable to handle bytearray: b = bytearray(1024) with vol.create(path, os.O_WRONLY | os.O_EXCL, 0644) as fd: fd.write(b) It would throw this error: exception: argument 2: <type 'exceptions.TypeError'>: Don't know how to convert parameter 2 reference: http://docs.python.org/2/library/ctypes.html#calling-functions-continued Change-Id: Ia2bb47343880cbf7121fed9510e4cfa085fe23bd Signed-off-by: Thiago da Silva <thiago@redhat.com>
* add mode parameter to mkdir methodThiago da Silva2014-01-292-3/+3
| | | | | | | | add mode parameter to mkdir to allow setting the dir access mode when the directory is being created Change-Id: I6f1ed0c8800fb65a30448e6082cf55b8220a06d4 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* first libgfapi-python functional testsThiago da Silva2014-01-222-0/+127
| | | | | | | | adding a few functional tests and removing old tests from source code Change-Id: Iefcb091d614f2825592943cfb42847b5865322c6 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* added support for with statements in open and creatThiago da Silva2014-01-161-15/+27
| | | | | | | | | when creating or opening a File, caller should now use python's with statement as specified on PEP 343: http://www.python.org/dev/peps/pep-0343/ Change-Id: Id98613e310bea01a427769d3ad7b0dea97245b04 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* unit testsThiago da Silva2014-01-143-0/+375
| | | | | | | added unit tests for existing methods Change-Id: Iecd31bc1dea44ea38168120bd05ca505c4ff5c59 Signed-off-by: Thiago da Silva <thiago@redhat.com>
* initial repo tree with gfapi.pyThiago da Silva2013-10-301-0/+0
This initial commit is a copy from gluster/api/examples/gfapi.py from the glusterfs repo Signed-off-by: Thiago da Silva <thiago@redhat.com> Change-Id: I4442528d5bc2ec52ed2970b818d8cb9327e36168