Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

check external url + improve fail message #5722

Merged
merged 3 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions features/TestProxyConfiguration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions www/api/class/centreon_proxy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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);
$outcome = true;
$message = _('Connection Successful');
} catch (\Exception $e) {
$outcome = false;
$message = $e->getMessage();
$message = _('Could not establish connection to Centreon IMP servers (') . $e->getMessage() . ')';
}

return array(
Expand Down