summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/rtc_test.py
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-16 13:44:02 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-16 16:14:20 +0900
commit0f102be98671abc253e2e73aba15073458c1e444 (patch)
tree606b1cd73a6b242b0a1f92f7f02d36694e11a1b0 /test/scenario_test/rtc_test.py
parent03ba90ac0dd6ecea6c1e2b24956bcc73962d1ef7 (diff)
scenario_test: pep8 and pylint improvements
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/scenario_test/rtc_test.py')
-rw-r--r--test/scenario_test/rtc_test.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/test/scenario_test/rtc_test.py b/test/scenario_test/rtc_test.py
index 3e1a2520..84b8b333 100644
--- a/test/scenario_test/rtc_test.py
+++ b/test/scenario_test/rtc_test.py
@@ -13,17 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest
-from fabric.api import local
-from lib import base
-from lib.gobgp import *
-from lib.quagga import *
+from __future__ import absolute_import
+
+from itertools import combinations
import sys
-import os
import time
+import unittest
+
+from fabric.api import local
import nose
+
from noseplugin import OptionParser, parser_option
-from itertools import combinations
+
+from lib import base
+from lib.base import BGP_FSM_ESTABLISHED
+from lib.gobgp import GoBGPContainer
class GoBGPTestBase(unittest.TestCase):
@@ -124,7 +128,8 @@ class GoBGPTestBase(unittest.TestCase):
g5.local("gobgp vrf add vrf1 rd 100:100 rt both 100:100")
time.sleep(1)
- def check(client):
+
+ def check_rtc(client):
rib = g3.get_adj_rib_out(client, rf='rtc')
self.assertTrue(len(rib) == 1)
path = rib[0]
@@ -132,13 +137,15 @@ class GoBGPTestBase(unittest.TestCase):
ids = [attr['value'] for attr in path['attrs'] if attr['type'] == base.BGP_ATTR_TYPE_ORIGINATOR_ID]
self.assertTrue(len(ids) == 1)
self.assertTrue(ids[0] == g3.router_id)
- check(g4)
- check(g5)
+
+ check_rtc(g4)
+ check_rtc(g5)
g4.local("gobgp vrf vrf1 rib add 40.0.0.0/24")
g5.local("gobgp vrf vrf1 rib add 50.0.0.0/24")
time.sleep(1)
- def check(client):
+
+ def check_ipv4_l3vpn(client):
rib = g3.get_adj_rib_out(client, rf='ipv4-l3vpn')
self.assertTrue(len(rib) == 1)
path = rib[0]
@@ -146,8 +153,9 @@ class GoBGPTestBase(unittest.TestCase):
ids = [attr['value'] for attr in path['attrs'] if attr['type'] == base.BGP_ATTR_TYPE_ORIGINATOR_ID]
self.assertTrue(len(ids) == 1)
self.assertTrue(ids[0] != client.router_id)
- check(g4)
- check(g5)
+
+ check_ipv4_l3vpn(g4)
+ check_ipv4_l3vpn(g5)
def test_08_rr_setup2(self):
g1 = self.ctns['g1']