aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/router/vyos_vrouter.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-02-27 10:34:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-27 10:34:32 +0000
commit939bb873620bfaab4465674d241dfd48513584cf (patch)
treef6d068f77ffaaa0a2c5fe46ab7274fa9c2a9009c /functest/opnfv_tests/vnf/router/vyos_vrouter.py
parent8625d61b7ef8059ecaf3fb0613888de490d31715 (diff)
parent7bd62366a97d4ec8b6f18c13057cb2904431df93 (diff)
Merge "Adding vRouter test codes using TestCasesBase"
Diffstat (limited to 'functest/opnfv_tests/vnf/router/vyos_vrouter.py')
-rwxr-xr-xfunctest/opnfv_tests/vnf/router/vyos_vrouter.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/functest/opnfv_tests/vnf/router/vyos_vrouter.py b/functest/opnfv_tests/vnf/router/vyos_vrouter.py
new file mode 100755
index 00000000..94a3ecfd
--- /dev/null
+++ b/functest/opnfv_tests/vnf/router/vyos_vrouter.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+#
+# Copyright 2017 Okinawa Open Laboratory
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+import functest.core.feature_base as base
+import json
+import os
+
+RESULT_DETAILS_FILE = "test_result.json"
+
+
+class VrouterVnf(base.FeatureBase):
+ def __init__(self):
+ super(VrouterVnf, self).__init__(project='vRouter',
+ case='vyos_vrouter',
+ repo='dir_repo_vrouter')
+ self.cmd = 'cd %s && ./run.sh' % self.repo
+
+ def set_result_details(self):
+ filepath = os.path.join(self.repo, RESULT_DETAILS_FILE)
+ if os.path.exists(filepath):
+ f = open(filepath, 'r')
+ self.details = json.load(f)
+ f.close()
+
+ def log_results(self):
+ if self.criteria == 'PASS':
+ self.set_result_details()
+ super(VrouterVnf, self).log_results()