Added functionality for changing server configuration
This commit is contained in:
parent
aee4887224
commit
4338a741f2
|
@ -20,6 +20,25 @@ Feature: capabilities
|
||||||
| files | undelete | 1 | |
|
| files | undelete | 1 | |
|
||||||
| files | versioning | 1 | |
|
| files | versioning | 1 | |
|
||||||
|
|
||||||
|
Scenario: Changing api_enabled
|
||||||
|
Given As an "admin"
|
||||||
|
And parameter "shareapi_allow_public_upload" is set to "0"
|
||||||
|
When sending "GET" to "/cloud/capabilities"
|
||||||
|
Then the HTTP status code should be "200"
|
||||||
|
And fields of capabilities match with
|
||||||
|
| capability | feature | value_or_subfeature | value |
|
||||||
|
| core | pollinterval | 60 | |
|
||||||
|
| core | webdav-root | remote.php/webdav | |
|
||||||
|
| files_sharing | api_enabled | 1 | |
|
||||||
|
| files_sharing | public | enabled | 1 |
|
||||||
|
| files_sharing | public | upload | 0 |
|
||||||
|
| files_sharing | resharing | 1 | |
|
||||||
|
| files_sharing | federation | outgoing | 1 |
|
||||||
|
| files_sharing | federation | incoming | 1 |
|
||||||
|
| files | bigfilechunking | 1 | |
|
||||||
|
| files | undelete | 1 | |
|
||||||
|
| files | versioning | 1 | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,25 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
|
||||||
use Provisioning;
|
use Provisioning;
|
||||||
use Sharing;
|
use Sharing;
|
||||||
|
|
||||||
|
private $apacheUser = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Given /^parameter "([^"]*)" is set to "([^"]*)"$/
|
||||||
|
*/
|
||||||
|
public function modifyServerConfig($parameter, $value){
|
||||||
|
$this->apacheUser = exec('ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk \'END {if ($1) print $1}\'');
|
||||||
|
$comando = 'sudo -u ' . $this->apacheUser . ' ../../occ config:app:set ' . $parameter . ' ' . $value;
|
||||||
|
echo "COMANDO: $comando\n";
|
||||||
|
$expectedAnswer = "Config value $value for app $parameter set to";
|
||||||
|
$output = exec($comando);
|
||||||
|
PHPUnit_Framework_Assert::assertEquals(
|
||||||
|
$output,
|
||||||
|
$expectedAnswer,
|
||||||
|
"Failed setting $parameter to $value"
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then /^fields of capabilities match with$/
|
* @Then /^fields of capabilities match with$/
|
||||||
* @param \Behat\Gherkin\Node\TableNode|null $formData
|
* @param \Behat\Gherkin\Node\TableNode|null $formData
|
||||||
|
|
Loading…
Reference in New Issue