summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2018-04-04 13:05:44 +0530
committerPrashanth Pai <ppai@redhat.com>2018-04-04 13:05:44 +0530
commit7bf9472939a41ac92514d9bfec55f45a53cfba6b (patch)
tree525f951b36cd34147c3bac0068c9dc71fff68341
parent4fe135300dbb7b7c9f3f0d0676ea76149414fb6b (diff)
Allow functional tests to be run as non-root user
Normal users do not have permissions to read or write to /var/run/glusterd.socket Skip those tests if run as non-root user. Change-Id: I1c1f805c362746036f5d8fe13e73ebad188388ea Signed-off-by: Prashanth Pai <ppai@redhat.com>
-rw-r--r--test/functional/libgfapi-python-tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py
index 8f631d4..a64dbc2 100644
--- a/test/functional/libgfapi-python-tests.py
+++ b/test/functional/libgfapi-python-tests.py
@@ -16,6 +16,7 @@ import errno
import hashlib
import threading
import uuid
+from nose import SkipTest
from test import get_test_config
from ConfigParser import NoSectionError, NoOptionError
from uuid import uuid4
@@ -1155,6 +1156,8 @@ class TestVolumeInit(unittest.TestCase):
self.assertFalse(vol.mounted)
def test_unix_socket_mount(self):
+ if not os.access(GLUSTERD_SOCK_FILE, os.R_OK | os.W_OK):
+ raise SkipTest("Unix socket file %s not accessible" % GLUSTERD_SOCK_FILE)
vol = Volume(GLUSTERD_SOCK_FILE, VOLNAME, proto="unix")
vol.mount()
self.assertTrue(vol.mounted)