test_jvpp: improve error message when JVpp JARS are missing 29/13529/6
authorMarek Gradzki <mgradzki@cisco.com>
Wed, 18 Jul 2018 08:32:23 +0000 (10:32 +0200)
committerDamjan Marion <dmarion@me.com>
Thu, 19 Jul 2018 22:31:45 +0000 (22:31 +0000)
The java command fails with missing class error,
when some of the JARs given by -cp are missing,
which may be missleading.

This patch fixes that by adding os.path.isfile check to test_jvpp.py.

Change-Id: I3a0b6ef338c7f70cfd0ba78ee0888efe0b0957b3
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
test/test_jvpp.py

index c3b9357..9cb787f 100644 (file)
@@ -106,9 +106,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",