From c19c2761f644068f94f7fb1cb8945e9da4e07808 Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Fri, 29 Sep 2017 11:25:37 +0200 Subject: [PATCH 1/3] fix(proxy): check external url + improve fail message --- www/api/class/centreon_proxy.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/api/class/centreon_proxy.class.php b/www/api/class/centreon_proxy.class.php index ad88beba3f1..a9af5e33e9a 100644 --- a/www/api/class/centreon_proxy.class.php +++ b/www/api/class/centreon_proxy.class.php @@ -10,7 +10,7 @@ public function postCheckConfiguration() $proxyAddress = $this->arguments['url']; $proxyPort = $this->arguments['port']; try { - $testUrl = 'http://ci.int.centreon.com:3000/api/pluginpack/pluginpack'; + $testUrl = 'https://api.imp.centreon.com/api/pluginpack/pluginpack'; $restHttpLib = new \CentreonRestHttp(); $restHttpLib->setProxy($proxyAddress, $proxyPort); $restHttpLib->call($testUrl); @@ -18,7 +18,7 @@ public function postCheckConfiguration() $message = _('Connection Successful'); } catch (\Exception $e) { $outcome = false; - $message = $e->getMessage(); + $message = _('Connection failed to imp portal (') . $e->getMessage() . ')'; } return array( From 7a130b859b409c3978856157fb972d4491e58b4c Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Fri, 29 Sep 2017 12:57:28 +0200 Subject: [PATCH 2/3] typo(proxy): update failed message on proxy connection --- www/api/class/centreon_proxy.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/api/class/centreon_proxy.class.php b/www/api/class/centreon_proxy.class.php index a9af5e33e9a..a2a5ffef4ae 100644 --- a/www/api/class/centreon_proxy.class.php +++ b/www/api/class/centreon_proxy.class.php @@ -18,7 +18,7 @@ public function postCheckConfiguration() $message = _('Connection Successful'); } catch (\Exception $e) { $outcome = false; - $message = _('Connection failed to imp portal (') . $e->getMessage() . ')'; + $message = _('Could not establish connection to Centreon IMP servers (') . $e->getMessage() . ')'; } return array( From b48daef8694718f19b4bb9fb2c04d7077940d437 Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Fri, 29 Sep 2017 13:03:51 +0200 Subject: [PATCH 3/3] tests(acceptance): add critical flag to proxy tests --- features/TestProxyConfiguration.feature | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/TestProxyConfiguration.feature b/features/TestProxyConfiguration.feature index 58fd21383d3..6cdcd442fe4 100644 --- a/features/TestProxyConfiguration.feature +++ b/features/TestProxyConfiguration.feature @@ -3,12 +3,14 @@ Feature: Testing A Configuration Proxy I want to test my proxy configuration So that to verify it - Scenario: Proxy settings with a correct connexion + @critical + Scenario: Proxy settings with a correct connection Given I am logged in a Centreon server with a configured proxy When I test the proxy configuration in the interface Then a popin displays a successful connexion - Scenario: Proxy settings with a wrong connexion + @critical + Scenario: Proxy settings with a wrong connection Given I am logged in a Centreon server with a wrongly configured proxy When I test the proxy configuration in the interface Then a popin displays an error message