From 9acf225f6bcec1b9744d02181b34dd45aa92d904 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Thu, 20 Jul 2017 11:35:59 +0900 Subject: addpath_test: Enable to run without root privilege see the comment of 4d7e3bd16fa51f4469a0a3f5f807c20b237ee21d Signed-off-by: IWASE Yusuke --- test/scenario_test/addpath_test.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/scenario_test/addpath_test.py b/test/scenario_test/addpath_test.py index 82b848a6..c2d2c5bf 100644 --- a/test/scenario_test/addpath_test.py +++ b/test/scenario_test/addpath_test.py @@ -13,18 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys +import time import unittest + +import nose from fabric.api import local + from lib import base from lib.base import BGP_FSM_ESTABLISHED -from lib.gobgp import * -from lib.exabgp import * -import sys -import os -import time -import nose +from lib.gobgp import GoBGPContainer +from lib.exabgp import ExaBGPContainer from lib.noseplugin import OptionParser, parser_option -from itertools import combinations class GoBGPTestBase(unittest.TestCase): @@ -64,10 +64,8 @@ class GoBGPTestBase(unittest.TestCase): self.assertTrue(len(rib) == 1) self.assertTrue(len(rib[0]['paths']) == 3) + if __name__ == '__main__': - if os.geteuid() is not 0: - print "you are not root." - sys.exit(1) output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True) if int(output) is not 0: print "docker not found" -- cgit v1.2.3