summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/route_server_malformed_test.py
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-01-23 12:38:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-26 20:16:38 +0900
commit3491d5214352586708444bcf41eca16f7ff1d3e6 (patch)
tree0e2e1b1bce2638475df86a859822e365c2e7cb9d /test/scenario_test/route_server_malformed_test.py
parent1a36b97d46e3a6958c1646398c5354ef74bea24b (diff)
scenario_test: Change to be able to test the local gobgp program
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/route_server_malformed_test.py')
-rw-r--r--test/scenario_test/route_server_malformed_test.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py
index bfaf874c..e6a5975a 100644
--- a/test/scenario_test/route_server_malformed_test.py
+++ b/test/scenario_test/route_server_malformed_test.py
@@ -17,8 +17,12 @@ import os
import time
import re
import sys
+import nose
import collections
import docker_control as fab
+from noseplugin import OptionParser
+from noseplugin import parser_option
+
sleep_time = 20
@@ -42,14 +46,20 @@ def test_malformed_packet():
pwd = os.getcwd()
pattern = check_pattern()
if len(pattern) <= 0:
- print "read test patten is faild."
- print "csv element is " + str(len(pattern))
+ print "read test pattern is faild."
+ print "pattern element is " + str(len(pattern))
sys.exit(1)
+ gobgp_local = parser_option.use_local
+ if gobgp_local:
+ print "execute gobgp program in local"
+ else:
+ print "execute gobgp program in gobgp container"
+
for pkey in pattern:
conf_file = pwd + "/exabgp_test_conf/" + pkey
if os.path.isfile(conf_file) is True:
- fab.init_malformed_test_env_executor(pkey)
+ fab.init_malformed_test_env_executor(pkey, gobgp_local)
print "please wait"
time.sleep(sleep_time)
yield check_em, pkey, pattern[pkey]
@@ -69,4 +79,7 @@ def check_em(exabgp_conf, result):
print " >>> " + notification_src
notification = notification_src[1:-1]
- assert notification == result \ No newline at end of file
+ assert notification == result
+
+if __name__ == '__main__':
+ nose.main(argv=sys.argv, addplugins=[OptionParser()], defaultTest=sys.argv[0]) \ No newline at end of file