summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHumble Devassy Chirammal <hchiramm@redhat.com>2015-04-15 21:42:33 +0530
committerhchiramm <hchiramm@redhat.com>2015-05-29 16:31:33 +0530
commit385dd1635dc243feafb6b234a4feb80417ee9f4f (patch)
tree7ee81d2f5110950017e701c500a937d407bc9cf4 /test
parent29795c7ec3186e525e90198ec0bd7989ff627afc (diff)
Package libgfapi-python project for its consumers
This project has to be shipped as rpm for various distributions like Fedora,Centos,RHEL.etc, so that the clients like vdsm, openstack..etc can make use of python bindings of libgfapi library of GlusterFS. This patch introduce first version of the spec file for this project. Change-Id: Icb5d83fc8b278a3cd7b89d55b5fda15a84c2fa82 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/functional/libgfapi-python-tests.py22
-rw-r--r--test/unit/gluster/test_gfapi.py42
2 files changed, 28 insertions, 36 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index a49e626..1519426 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -1,17 +1,13 @@
-# Copyright (c) 2012-2014 Red Hat, Inc.
+# Copyright (c) 2012-2015 Red Hat, Inc.
+# This file is part of libgfapi-python project
+# (http://review.gluster.org/#/q/project:libgfapi-python)
+# which is a subproject of GlusterFS ( www.gluster.org)
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# This file is licensed to you under your choice of the GNU Lesser
+# General Public License, version 3 or any later version (LGPLv3 or
+# later), or the GNU General Public License, version 2 (GPLv2), in all
+# cases as published by the Free Software Foundation.
+
import unittest
import os
diff --git a/test/unit/gluster/test_gfapi.py b/test/unit/gluster/test_gfapi.py
index f03f61a..dc470a1 100644
--- a/test/unit/gluster/test_gfapi.py
+++ b/test/unit/gluster/test_gfapi.py
@@ -1,17 +1,13 @@
-# Copyright (c) 2012-2014 Red Hat, Inc.
+# Copyright (c) 2012-2015 Red Hat, Inc.
+# This file is part of libgfapi-python project
+# (http://review.gluster.org/#/q/project:libgfapi-python)
+# which is a subproject of GlusterFS ( www.gluster.org)
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# This file is licensed to you under your choice of the GNU Lesser
+# General Public License, version 3 or any later version (LGPLv3 or
+# later), or the GNU General Public License, version 2 (GPLv2), in all
+# cases as published by the Free Software Foundation.
+
import unittest
import gluster
@@ -67,7 +63,7 @@ class TestFile(unittest.TestCase):
mock_glfs_fchmod = Mock()
mock_glfs_fchmod.return_value = 0
- with patch("glusterfs.gfapi.api.glfs_fchmod", mock_glfs_fchmod):
+ with patch("gluster.gfapi.api.glfs_fchmod", mock_glfs_fchmod):
ret = self.fd.fchmod(0600)
self.assertEquals(ret, 0)
@@ -75,7 +71,7 @@ class TestFile(unittest.TestCase):
mock_glfs_fchmod = Mock()
mock_glfs_fchmod.return_value = -1
- with patch("glusterfs.gfapi.api.glfs_fchmod", mock_glfs_fchmod):
+ with patch("gluster.gfapi.api.glfs_fchmod", mock_glfs_fchmod):
self.assertRaises(OSError, self.fd.fchmod, 0600)
def test_fchown_success(self):
@@ -188,8 +184,8 @@ class TestFile(unittest.TestCase):
return buflen
for buflen in (-1,-2,-999):
- with patch("glusterfs.gfapi.api.glfs_read", _mock_glfs_read):
- with patch("glusterfs.gfapi.File.fgetsize", _mock_fgetsize):
+ with patch("gluster.gfapi.api.glfs_read", _mock_glfs_read):
+ with patch("gluster.gfapi.File.fgetsize", _mock_fgetsize):
b = self.fd.read(buflen)
def test_write_success(self):
@@ -309,7 +305,7 @@ class TestVolume(unittest.TestCase):
mock_glfs_chmod = Mock()
mock_glfs_chmod.return_value = 0
- with patch("glusterfs.gfapi.api.glfs_chmod", mock_glfs_chmod):
+ with patch("gluster.gfapi.api.glfs_chmod", mock_glfs_chmod):
ret = self.vol.chmod("file.txt", 0600)
self.assertEquals(ret, 0)
@@ -317,7 +313,7 @@ class TestVolume(unittest.TestCase):
mock_glfs_chmod = Mock()
mock_glfs_chmod.return_value = -1
- with patch("glusterfs.gfapi.api.glfs_chmod", mock_glfs_chmod):
+ with patch("gluster.gfapi.api.glfs_chmod", mock_glfs_chmod):
self.assertRaises(OSError, self.vol.chmod, "file.txt", 0600)
def test_chown_success(self):
@@ -807,7 +803,7 @@ class TestVolume(unittest.TestCase):
mock_glfs_setfsuid = Mock()
mock_glfs_setfsuid.return_value = 0
- with patch("glusterfs.gfapi.api.glfs_setfsuid", mock_glfs_setfsuid):
+ with patch("gluster.gfapi.api.glfs_setfsuid", mock_glfs_setfsuid):
ret = self.vol.setfsuid(1000)
self.assertEquals(ret, 0)
@@ -815,14 +811,14 @@ class TestVolume(unittest.TestCase):
mock_glfs_setfsuid = Mock()
mock_glfs_setfsuid.return_value = -1
- with patch("glusterfs.gfapi.api.glfs_setfsuid", mock_glfs_setfsuid):
+ with patch("gluster.gfapi.api.glfs_setfsuid", mock_glfs_setfsuid):
self.assertRaises(OSError, self.vol.setfsuid, 1001)
def test_setfsgid_success(self):
mock_glfs_setfsgid = Mock()
mock_glfs_setfsgid.return_value = 0
- with patch("glusterfs.gfapi.api.glfs_setfsgid", mock_glfs_setfsgid):
+ with patch("gluster.gfapi.api.glfs_setfsgid", mock_glfs_setfsgid):
ret = self.vol.setfsgid(1000)
self.assertEquals(ret, 0)
@@ -830,7 +826,7 @@ class TestVolume(unittest.TestCase):
mock_glfs_setfsgid = Mock()
mock_glfs_setfsgid.return_value = -1
- with patch("glusterfs.gfapi.api.glfs_setfsgid", mock_glfs_setfsgid):
+ with patch("gluster.gfapi.api.glfs_setfsgid", mock_glfs_setfsgid):
self.assertRaises(OSError, self.vol.setfsgid, 1001)
def test_setxattr_success(self):