summaryrefslogtreecommitdiffstats
path: root/test/functest/run_tests.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-07-04 18:06:59 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-07-08 15:02:55 +0200
commitdb65ad73091345231022bbde247c4ef4fb75219c (patch)
tree61a6e9cfd7ff342be9e07a75367f8f91022759eb /test/functest/run_tests.py
parent79dc8c7fe14ebce964a9aee6779026dac17c4319 (diff)
Add testcase1 implementation
JIRA: SDNVPN-30 Change-Id: I4d31e9c4dc683c031d6a3d44e0d2bf4d80332281 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'test/functest/run_tests.py')
-rw-r--r--test/functest/run_tests.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functest/run_tests.py b/test/functest/run_tests.py
new file mode 100644
index 0000000..dbe6261
--- /dev/null
+++ b/test/functest/run_tests.py
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# Copyright (c) 2015 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.utils.functest_logger as ft_logger
+import functest.utils.functest_utils as ft_utils
+import yaml
+
+logger = ft_logger.Logger("sdnvpn").getLogger()
+
+with open('config.yaml') as f:
+ config_yaml = yaml.safe_load(f)
+
+testcases = config_yaml.get("testcases")
+for testcase in testcases:
+ title = ("Running '%s - %s'" %
+ (testcase, testcases[testcase]['description']))
+ print(title)
+ print("%s\n" % ("=" * len(title)))
+ if testcases[testcase]['type'] == 'python':
+ filename = testcase + ".py"
+ filename.main()
+ else:
+ cmd = "bash " + testcase + ".sh"
+ result = ft_utils.execute_command(cmd, logger, exit_on_error=False)