X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_jvpp.py;h=36dbdb2b39195fd07e060965c22cee889b810f2c;hb=13a08cc;hp=2497ff680a4cb4c7d1e11c679bc205c5bbf3ab1e;hpb=6912a051c4a6d65ebdc827339b9d59173a2ee539;p=vpp.git diff --git a/test/test_jvpp.py b/test/test_jvpp.py index 2497ff680a4..36dbdb2b391 100644 --- a/test/test_jvpp.py +++ b/test/test_jvpp.py @@ -2,16 +2,18 @@ import os import subprocess +import unittest -from framework import VppTestCase +from framework import VppTestCase, running_extended_tests # Api files path -API_FILES_PATH = "vpp/vpp-api/java" +API_FILES_PATH = "japi/java" # Registry jar file name prefix REGISTRY_JAR_PREFIX = "jvpp-registry" +@unittest.skipUnless(running_extended_tests(), "part of extended tests") class TestJVpp(VppTestCase): """ JVPP Core Test Case """ @@ -106,9 +108,16 @@ class TestJVpp(VppTestCase): REGISTRY_JAR_PREFIX, version) self.logger.info("JVpp Registry jar path : {0}" .format(registry_jar_path)) + if (not os.path.isfile(registry_jar_path)): + raise Exception( + "JVpp Registry jar has not been found: {0}" + .format(registry_jar_path)) api_jar_path = self.full_jar_name(install_dir, api_jar_name, version) self.logger.info("Api jar path : {0}".format(api_jar_path)) + if (not os.path.isfile(api_jar_path)): + raise Exception( + "Api jar has not been found: {0}".format(api_jar_path)) # passes shm prefix as parameter to create connection with same value command = ["java", "-cp", @@ -124,9 +133,12 @@ class TestJVpp(VppTestCase): out, err = self.process.communicate() self.logger.info("Process output : {0}{1}".format(os.linesep, out)) - self.logger.info("Process error output : {0}{1}" - .format(os.linesep, err)) - self.assert_equal(self.process.returncode, 0, "process return code") + + if self.process.returncode != 0: + raise Exception( + "Command {0} failed with return code: {1}.{2}" + "Process error output: {2}{3}" + .format(command, self.process.returncode, os.linesep, err)) def tearDown(self): self.logger.info("Tearing down jvpp test")