From 6053769f24a694fc27f2bb4b060e3287a47e3091 Mon Sep 17 00:00:00 2001
From: Benjamin Bertrand <benjamin.bertrand@esss.se>
Date: Mon, 28 Oct 2019 12:13:11 +0100
Subject: [PATCH] Improve startup script

Allow to pass extra arguments
---
 molecule/default/tests/test_default.py | 7 +------
 templates/phoebus.j2                   | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py
index e548b7c..09e1f08 100644
--- a/molecule/default/tests/test_default.py
+++ b/molecule/default/tests/test_default.py
@@ -9,7 +9,7 @@ PHOEBUS_VERSION = '4.6.0-SNAPSHOT'
 
 
 def test_default(host):
-    cmd = host.run("/opt/ess-phoebus-{}/phoebus.sh -help".format(PHOEBUS_VERSION))
+    cmd = host.run("/usr/local/bin/phoebus -help".format(PHOEBUS_VERSION))
     assert cmd.rc == 0
     assert " _______           _______  _______  ______            _______ \n" + \
            "(  ____ )|\\     /|(  ___  )(  ____ \\(  ___ \\ |\\     /|(  ____ \\\n" + \
@@ -26,8 +26,3 @@ def test_settings(host):
     assert settings.exists
     assert settings.is_file
     assert settings.contains("org.phoebus.pv.ca/addr_list=127.0.0.1")
-
-
-def test_java_path(host):
-    start_script = host.file("/opt/ess-phoebus-{}/phoebus.sh".format(PHOEBUS_VERSION))
-    assert start_script.contains("/opt/java/jdk")
diff --git a/templates/phoebus.j2 b/templates/phoebus.j2
index a3554ed..84fb494 100644
--- a/templates/phoebus.j2
+++ b/templates/phoebus.j2
@@ -9,4 +9,4 @@ then
   conda activate csstudio
 fi
 
-{{ java_openjdk_bin }} $JAVA_ARGS $JAVA_OPTS -jar $PHOEBUS_JAR $PHOEBUS_OPTS -resource %f -settings "{{ phoebus_settings_path }}"
+{{ java_openjdk_bin }} $JAVA_ARGS $JAVA_OPTS -jar $PHOEBUS_JAR $PHOEBUS_OPTS -resource %f -settings "{{ phoebus_settings_path }}" $@
-- 
GitLab