From 7bf9472939a41ac92514d9bfec55f45a53cfba6b Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Wed, 4 Apr 2018 13:05:44 +0530 Subject: 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 --- test/functional/libgfapi-python-tests.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit