Added functionality for changing server configuration

This commit is contained in:
Sergio Bertolin 2015-12-04 14:08:16 +00:00 committed by Thomas Müller
parent aee4887224
commit 4338a741f2
2 changed files with 38 additions and 0 deletions

View File

@ -20,6 +20,25 @@ Feature: capabilities
| files | undelete | 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 | |

View File

@ -14,6 +14,25 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
use Provisioning;
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$/
* @param \Behat\Gherkin\Node\TableNode|null $formData