summaryrefslogtreecommitdiffstats
path: root/test/functional/libgfapi-python-tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/libgfapi-python-tests.py')
-rw-r--r--test/functional/libgfapi-python-tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index 13ae54d..87dbfe0 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -13,6 +13,7 @@ import unittest
import os
import types
import errno
+import threading
from gluster.gfapi import File, Volume
from gluster.exceptions import LibgfapiException
@@ -197,6 +198,17 @@ class FileOpsTest(unittest.TestCase):
f.lseek(0, os.SEEK_SET)
self.assertEqual(f.read(), data + "hello world")
+ def test_fopen_in_thread(self):
+ def gluster_fopen():
+ name = uuid4().hex
+ with self.vol.fopen(name, 'w') as f:
+ f.write('hello world')
+
+ # the following caused segfault before the fix
+ thread = threading.Thread(target=gluster_fopen)
+ thread.start()
+ thread.join()
+
def test_create_file_already_exists(self):
try:
f = File(self.vol.open("newfile", os.O_CREAT))