forked from centreon/centreon-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from centreon/master
Master
- Loading branch information
Showing
46 changed files
with
708 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
################### | ||
Centreon Web 2.8.14 | ||
################### | ||
|
||
Enhancements | ||
============ | ||
|
||
|
||
Bugfix | ||
====== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
################### | ||
Centreon Web 2.8.14 | ||
################### | ||
|
||
Enhancements | ||
============ | ||
|
||
|
||
Bugfix | ||
====== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Feature: Testing A Configuration Proxy | ||
As a Centreon user | ||
I want to test my proxy configuration | ||
So that to verify it | ||
|
||
Scenario: Proxy settings with a correct connexion | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
use Centreon\Test\Behat\CentreonContext; | ||
use Centreon\Test\Behat\Administration\ParametersCentreonUiPage; | ||
|
||
class TestProxyConfigurationContext extends CentreonContext | ||
{ | ||
private $page; | ||
private $wrongProxyAddress = 'squad'; | ||
private $wrongProxyPort = '9999'; | ||
|
||
/** | ||
* @When I test the proxy configuration in the interface | ||
*/ | ||
public function ITestTheProxyConfigurationInTheInterface() | ||
{ | ||
$this->visit('main.php?p=50110&o=general'); | ||
$this->assertFind('css', 'input[name="test_proxy"]')->click(); | ||
} | ||
|
||
/** | ||
* @Then a popin displays a successful connexion | ||
*/ | ||
public function APopinDisplaysASuccessfulConnexion() | ||
{ | ||
$this->spin( | ||
function ($context) { | ||
return $context->getSession()->getPage()->has( | ||
'css', | ||
'span[class="msg-field success2"]' | ||
); | ||
}, | ||
'The pop-in did not showed up' | ||
); | ||
$value = $this->assertFind('css', 'span[class="msg-field success2"]')->getText(); | ||
if ($value !== 'Connection Successful') { | ||
throw new \Exception('The URL to reach failed'); | ||
} | ||
} | ||
|
||
/** | ||
* @Given I am logged in a Centreon server with a wrongly configured proxy | ||
*/ | ||
public function IAmLoggedInAcentreonServerWithAwronglyConfiguredProxy() | ||
{ | ||
$this->iAmLoggedInACentreonServer(); | ||
$this->page = new ParametersCentreonUiPage($this); | ||
$this->page->setProperties(array( | ||
'proxy_url'=> $this->wrongProxyAddress, | ||
'proxy_port'=> $this->wrongProxyPort | ||
)); | ||
$this->page->save(); | ||
} | ||
|
||
/** | ||
* @Then a popin displays an error message | ||
*/ | ||
public function aPopinDisplaysAnErrorMessage() | ||
{ | ||
$this->spin( | ||
function ($context) { | ||
return $context->getSession()->getPage()->has( | ||
'css', | ||
'span[class="msg-field error"]' | ||
); | ||
}, | ||
'The pop-in did not showed up' | ||
); | ||
$value = $this->assertFind('css', 'span[class="msg-field error"]')->getText(); | ||
if ($value == 'Connection Successful') { | ||
throw new \Exception('The Proxy configuration is incorrect'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
require_once dirname(__FILE__) . "/webService.class.php"; | ||
require_once _CENTREON_PATH_ . "/www/class/centreonRestHttp.class.php"; | ||
|
||
class CentreonProxy extends CentreonWebService | ||
{ | ||
public function postCheckConfiguration() | ||
{ | ||
$proxyAddress = $this->arguments['url']; | ||
$proxyPort = $this->arguments['port']; | ||
try { | ||
$testUrl = 'http://ci.int.centreon.com:3000/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(); | ||
} | ||
|
||
return array( | ||
'outcome' => $outcome, | ||
'message' => $message | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.