Beispiel #1
0
 def test_write_builtin_server_startup_with_jem(self):
     # The builtin server Upstart file is properly generated with JEM.
     write_builtin_server_startup(
         self.ssl_cert_path, jem_url='https://1.2.3.4/jem',
         interactive_login=True)
     guiserver_conf = self.files['runserver.sh']
     self.assertIn('--jemurl="https://1.2.3.4/jem"', guiserver_conf)
     self.assertIn('--interactivelogin="******"', guiserver_conf)
Beispiel #2
0
 def test_write_builtin_server_startup_with_bundleservice(self):
     # The builtin server Upstart file is properly generated with
     # bundleservice.
     write_builtin_server_startup(
         self.ssl_cert_path, bundleservice_url="https://1.2.3.4/bundleservice", interactive_login=True
     )
     guiserver_conf = self.files["runserver.sh"]
     self.assertIn('--bundleservice_url="https://1.2.3.4/bundleservice"', guiserver_conf)
     self.assertIn('--interactivelogin="******"', guiserver_conf)
Beispiel #3
0
 def test_write_builtin_server_startup_sandbox_and_logging(self):
     # The upstart configuration file for the GUI server is correctly
     # generated when the GUI is in sandbox mode and when a customized log
     # level is specified.
     write_builtin_server_startup(self.ssl_cert_path, serve_tests=True, sandbox=True, builtin_server_logging="debug")
     guiserver_conf = self.files["runserver.sh"]
     self.assertIn('description "GUIServer"', guiserver_conf)
     self.assertIn('--logging="debug"', guiserver_conf)
     self.assertIn("--sandbox", guiserver_conf)
     self.assertNotIn("--apiurl", guiserver_conf)
     self.assertNotIn("--apiversion", guiserver_conf)
Beispiel #4
0
 def test_write_builtin_server_startup_with_bundleservice(self):
     # The builtin server Upstart file is properly generated with
     # bundleservice.
     write_builtin_server_startup(
         self.ssl_cert_path,
         bundleservice_url='https://1.2.3.4/bundleservice',
         interactive_login=True)
     guiserver_conf = self.files['runserver.sh']
     self.assertIn('--bundleservice_url="https://1.2.3.4/bundleservice"',
                   guiserver_conf)
     self.assertIn('--interactivelogin="******"', guiserver_conf)
Beispiel #5
0
 def test_write_builtin_server_startup_sandbox_and_logging(self):
     # The upstart configuration file for the GUI server is correctly
     # generated when the GUI is in sandbox mode and when a customized log
     # level is specified.
     write_builtin_server_startup(
         self.ssl_cert_path, serve_tests=True, sandbox=True,
         builtin_server_logging='debug')
     guiserver_conf = self.files['runserver.sh']
     self.assertIn('description "GUIServer"', guiserver_conf)
     self.assertIn('--logging="debug"', guiserver_conf)
     self.assertIn('--sandbox', guiserver_conf)
     self.assertNotIn('--apiurl', guiserver_conf)
     self.assertNotIn('--apiversion', guiserver_conf)
 def test_write_builtin_server_startup(self):
     write_builtin_server_startup(
         JUJU_GUI_DIR, self.ssl_cert_path, serve_tests=True, insecure=True,
         charmworld_url=self.charmworld_url)
     guiserver_conf = self.files['guiserver.conf']
     self.assertIn('description "GUIServer"', guiserver_conf)
     self.assertIn('--logging="info"', guiserver_conf)
     self.assertIn('--apiurl="wss://127.0.0.1:8080/ws"', guiserver_conf)
     self.assertIn('--apiversion="python"', guiserver_conf)
     self.assertIn(
         '--testsroot="{}/test/"'.format(JUJU_GUI_DIR), guiserver_conf)
     self.assertIn('--insecure', guiserver_conf)
     self.assertNotIn('--sandbox', guiserver_conf)
     self.assertIn('--charmworldurl="http://charmworld.example.com/"',
                   guiserver_conf)
Beispiel #7
0
 def test_write_builtin_server_startup(self):
     write_builtin_server_startup(
         self.ssl_cert_path, serve_tests=True, insecure=True, charmworld_url=self.charmworld_url
     )
     guiserver_conf = self.files["runserver.sh"]
     self.assertIn('description "GUIServer"', guiserver_conf)
     self.assertIn('--logging="info"', guiserver_conf)
     # The get_api_address is noop'd in these tests so the addr is None.
     self.assertIn('--apiurl="wss://None"', guiserver_conf)
     self.assertIn('--apiversion="go"', guiserver_conf)
     self.assertIn('--testsroot="{}/test/"'.format(JUJU_GUI_DIR), guiserver_conf)
     self.assertIn("--insecure", guiserver_conf)
     self.assertNotIn("--sandbox", guiserver_conf)
     self.assertIn('--charmworldurl="http://charmworld.example.com/"', guiserver_conf)
     # By default the port is not provided to the GUI server.
     self.assertNotIn("--port", guiserver_conf)
Beispiel #8
0
 def test_write_builtin_server_startup(self):
     write_builtin_server_startup(
         self.ssl_cert_path, serve_tests=True, insecure=True,
         charmworld_url=self.charmworld_url)
     guiserver_conf = self.files['runserver.sh']
     self.assertIn('description "GUIServer"', guiserver_conf)
     self.assertIn('--logging="info"', guiserver_conf)
     # The get_api_address is noop'd in these tests so the addr is None.
     self.assertIn('--apiurl="wss://None"', guiserver_conf)
     self.assertIn('--apiversion="go"', guiserver_conf)
     self.assertIn(
         '--testsroot="{}/test/"'.format(JUJU_GUI_DIR), guiserver_conf)
     self.assertIn('--insecure', guiserver_conf)
     self.assertNotIn('--sandbox', guiserver_conf)
     self.assertIn('--charmworldurl="http://charmworld.example.com/"',
                   guiserver_conf)
     # By default the port is not provided to the GUI server.
     self.assertNotIn('--port', guiserver_conf)
Beispiel #9
0
 def test_write_builtin_server_startup_with_port(self):
     # The builtin server Upstart file is properly generated when a
     # customized port is provided.
     write_builtin_server_startup(self.ssl_cert_path, port=8000)
     guiserver_conf = self.files["runserver.sh"]
     self.assertIn("--port=8000", guiserver_conf)
Beispiel #10
0
 def test_write_builtin_server_startup_with_port(self):
     # The builtin server Upstart file is properly generated when a
     # customized port is provided.
     write_builtin_server_startup(self.ssl_cert_path, port=8000)
     guiserver_conf = self.files['runserver.sh']
     self.assertIn('--port=8000', guiserver_conf)