diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-01-27 20:24:32 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-28 15:40:28 +0900 |
commit | a3e802b314d2f928456d59ad748897a74c269ee2 (patch) | |
tree | 43e53fba24d73acaf2f426bdd3914b011c6ee569 /test/scenario_test/route_server_malformed_test.py | |
parent | 959994eb57ae2e9a2d852bc4b71ba35fda911680 (diff) |
scenario_test: support to sudo
Diffstat (limited to 'test/scenario_test/route_server_malformed_test.py')
-rw-r--r-- | test/scenario_test/route_server_malformed_test.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py index e6a5975a..8ba90c74 100644 --- a/test/scenario_test/route_server_malformed_test.py +++ b/test/scenario_test/route_server_malformed_test.py @@ -45,21 +45,26 @@ def check_pattern(): def test_malformed_packet(): pwd = os.getcwd() pattern = check_pattern() + if fab.test_user_check() is False: + print "you are not root" + sys.exit(1) + + if fab.docker_pkg_check() is False: + print "not install docker package." + sys.exit(1) + if len(pattern) <= 0: 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" + use_local = parser_option.use_local + go_path = parser_option.go_path 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, gobgp_local) + fab.init_malformed_test_env_executor(pkey, use_local, go_path) print "please wait" time.sleep(sleep_time) yield check_em, pkey, pattern[pkey] @@ -82,4 +87,10 @@ def check_em(exabgp_conf, result): assert notification == result if __name__ == '__main__': + if fab.test_user_check() is False: + print "you are not root." + sys.exit(1) + if fab.docker_pkg_check() is False: + print "not install docker package." + sys.exit(1) nose.main(argv=sys.argv, addplugins=[OptionParser()], defaultTest=sys.argv[0])
\ No newline at end of file |