3 # Copyright 2017 Okinawa Open Laboratory
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 import functest.core.feature as base
13 RESULT_DETAILS_FILE = "test_result.json"
16 class VrouterVnf(base.Feature):
17 def __init__(self, **kwargs):
18 kwargs["repo"] = 'dir_repo_vrouter'
19 if "case_name" not in kwargs:
20 kwargs["case_name"] = "vyos_vrouter"
21 super(VrouterVnf, self).__init__(**kwargs)
22 self.cmd = 'cd %s && ./run.sh' % self.repo
24 def set_result_details(self):
25 filepath = os.path.join(self.repo, RESULT_DETAILS_FILE)
26 if os.path.exists(filepath):
27 f = open(filepath, 'r')
28 self.details = json.load(f)
31 def log_results(self):
32 if self.result == 'PASS':
33 self.set_result_details()
34 super(VrouterVnf, self).log_results()