X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=test%2Ftest_jvpp.py;h=b716af3920569a33afe483b41bb1baa0b0da63ca;hb=e21463d87979a49720bf1eb1744f01261ffea620;hp=c3b93576f71230bdae56112f6d910bfb8b51d9d5;hpb=cefa41f820b7a5fa97491afde82af7f2d5c2d112;p=vpp.git diff --git a/test/test_jvpp.py b/test/test_jvpp.py index c3b93576f71..b716af39205 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 """ @@ -97,7 +99,7 @@ class TestJVpp(VppTestCase): "{0}-{1}.jar".format(jar_name, version)) def jvpp_connection_test(self, api_jar_name, test_class_name, timeout): - install_dir = os.getenv('VPP_TEST_BUILD_DIR') + install_dir = os.getenv('VPP_BUILD_DIR') self.logger.info("Install directory : {0}".format(install_dir)) version_reply = self.vapi.show_version() @@ -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", @@ -126,7 +135,7 @@ class TestJVpp(VppTestCase): self.logger.info("Process output : {0}{1}".format(os.linesep, out)) if self.process.returncode != 0: - raise Exception( + raise subprocess.CalledProcessError( "Command {0} failed with return code: {1}.{2}" "Process error output: {2}{3}" .format(command, self.process.returncode, os.linesep, err))