summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/scenario_test/ci-scripts/travis-build-script.sh2
-rw-r--r--test/scenario_test/route_server_softreset_test.py (renamed from test/scenario_test/route_server_test3.py)27
2 files changed, 25 insertions, 4 deletions
diff --git a/test/scenario_test/ci-scripts/travis-build-script.sh b/test/scenario_test/ci-scripts/travis-build-script.sh
index 9a7a416d..87fa9a7b 100644
--- a/test/scenario_test/ci-scripts/travis-build-script.sh
+++ b/test/scenario_test/ci-scripts/travis-build-script.sh
@@ -42,7 +42,7 @@ PIDS=("${PIDS[@]}" $!)
sudo PYTHONPATH=$GOBGP/test python route_server_test2.py --gobgp-image $GOBGP_IMAGE --test-prefix rs2 -x &
PIDS=("${PIDS[@]}" $!)
-sudo PYTHONPATH=$GOBGP/test python route_server_test3.py --gobgp-image $GOBGP_IMAGE --test-prefix rs3 -x &
+sudo PYTHONPATH=$GOBGP/test python route_server_softreset_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rs3 -x &
PIDS=("${PIDS[@]}" $!)
sudo PYTHONPATH=$GOBGP/test python route_server_ipv4_v6_test.py --gobgp-image $GOBGP_IMAGE --test-prefix v6 -x &
diff --git a/test/scenario_test/route_server_test3.py b/test/scenario_test/route_server_softreset_test.py
index 2bdd8ece..6bd91c03 100644
--- a/test/scenario_test/route_server_test3.py
+++ b/test/scenario_test/route_server_softreset_test.py
@@ -44,11 +44,14 @@ class GoBGPTestBase(unittest.TestCase):
g3 = GoBGPContainer(name='g3', asn=65002, router_id='192.168.0.3',
ctn_image_name=gobgp_ctn_image_name,
log_level=parser_option.gobgp_log_level)
- ctns = [g1, g2, g3]
+ g4 = GoBGPContainer(name='g4', asn=65003, router_id='192.168.0.4',
+ ctn_image_name=gobgp_ctn_image_name,
+ log_level=parser_option.gobgp_log_level)
+ ctns = [g1, g2, g3, g4]
# advertise a route from route-server-clients
cls.clients = {}
- for cli in [g2, g3]:
+ for cli in [g2, g3, g4]:
cls.clients[cli.name] = cli
initial_wait_time = max(ctn.run() for ctn in ctns)
@@ -65,7 +68,7 @@ class GoBGPTestBase(unittest.TestCase):
for cli in self.clients.itervalues():
self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=cli)
- def test_02_test(self):
+ def test_02_softresetin_test1(self):
g1 = self.gobgp
g2 = self.clients['g2']
g3 = self.clients['g3']
@@ -93,6 +96,7 @@ class GoBGPTestBase(unittest.TestCase):
ps0 = {'prefix-set-name': 'ps0', 'prefix-list': [p1]}
g1.set_prefix_set(ps0)
g1.create_config()
+ # this will cause g1 to do softresetin for all neighbors (policy is changed)
g1.reload_config()
time.sleep(1)
@@ -107,6 +111,23 @@ class GoBGPTestBase(unittest.TestCase):
num3 = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE']
self.assertTrue(num2 == num3)
+ def test_03_softresetin_test2(self):
+ g1 = self.gobgp
+ g2 = self.clients['g2']
+
+ g2.add_route('10.0.10.0/24')
+ time.sleep(1)
+
+ num = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE']
+ time.sleep(3)
+
+ g1.local('gobgp n all softresetin')
+ time.sleep(3)
+
+ num1 = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE']
+
+ self.assertTrue(num == num1)
+
if __name__ == '__main__':
if os.geteuid() is not 0: