test_parser: Make this independent from test environment path

To make this able to run via testr.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2014-10-14 10:34:56 +09:00 committed by FUJITA Tomonori
parent aae00a8ba5
commit 2d52d1922b

View File

@ -194,12 +194,14 @@ class Test_Parser(unittest.TestCase):
def _add_tests():
import os
import os.path
import fnmatch
import new
import functools
packet_data_dir = '../packet_data'
json_dir = './ofproto/json'
this_dir = os.path.dirname(sys.modules[__name__].__file__)
packet_data_dir = os.path.join(this_dir, '../../packet_data')
json_dir = os.path.join(this_dir, 'json')
ofvers = [
'of10',
'of12',