Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2015-12-09 13:27:30 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-11 18:20:04 +0300
commit0449dc387b7ca8de56ccf76084b542ca8455c885 (patch)
treee1ab9db54f8a7aa845e0c1c1225c1c1458ed5982 /build
parent4338a741f256a96c53aae30e495e6c5587587865 (diff)
Added functionality to change server configuration
Diffstat (limited to 'build')
-rw-r--r--build/integration/capabilities_features/capabilities.feature4
-rw-r--r--build/integration/features/bootstrap/CapabilitiesContext.php55
2 files changed, 42 insertions, 17 deletions
diff --git a/build/integration/capabilities_features/capabilities.feature b/build/integration/capabilities_features/capabilities.feature
index 59fb5302ac4..e473d5d7bdb 100644
--- a/build/integration/capabilities_features/capabilities.feature
+++ b/build/integration/capabilities_features/capabilities.feature
@@ -22,7 +22,7 @@ Feature: capabilities
Scenario: Changing api_enabled
Given As an "admin"
- And parameter "shareapi_allow_public_upload" is set to "0"
+ And parameter "shareapi_allow_public_upload" of app "core" is set to "no"
When sending "GET" to "/cloud/capabilities"
Then the HTTP status code should be "200"
And fields of capabilities match with
@@ -31,7 +31,7 @@ Feature: capabilities
| core | webdav-root | remote.php/webdav | |
| files_sharing | api_enabled | 1 | |
| files_sharing | public | enabled | 1 |
- | files_sharing | public | upload | 0 |
+ | files_sharing | public | upload | EMPTY |
| files_sharing | resharing | 1 | |
| files_sharing | federation | outgoing | 1 |
| files_sharing | federation | incoming | 1 |
diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php
index 0e5d990f9a6..9cdd98cc059 100644
--- a/build/integration/features/bootstrap/CapabilitiesContext.php
+++ b/build/integration/features/bootstrap/CapabilitiesContext.php
@@ -14,23 +14,16 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
use Provisioning;
use Sharing;
- private $apacheUser = '';
+ private $apacheUser = NULL;
/**
- * @Given /^parameter "([^"]*)" is set to "([^"]*)"$/
+ * @Given /^parameter "([^"]*)" of app "([^"]*)" 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"
- );
-
+ public function serverParameterIsSetTo($parameter, $app, $value){
+ if (!isset($this->apacheUser)){
+ $this->apacheUser = $this->getOSApacheUser();
+ }
+ $this->modifyServerConfig($this->apacheUser, $parameter, $app, $value);
}
/**
@@ -56,11 +49,43 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
$answeredValue = (string)$capabilitiesXML->$row['capability']->$row['feature']->$row['value_or_subfeature'];
PHPUnit_Framework_Assert::assertEquals(
$answeredValue,
- $row['value'],
+ $row['value']==="EMPTY" ? '' : $row['value'],
"Failed field: " . $row['capability'] . " " . $row['feature'] . " " . $row['value_or_subfeature']
);
}
}
}
+ public static function modifyServerConfig($apacheUser, $parameter, $app, $value){
+ $comando = 'sudo -u ' . $apacheUser . ' ../../occ config:app:set ' . $app . " " . $parameter . ' --value=' . $value;
+ $expectedAnswer = "Config value $parameter for app $app set to $value";
+ $output = exec($comando);
+ PHPUnit_Framework_Assert::assertEquals(
+ $output,
+ $expectedAnswer,
+ "Failed setting $parameter to $value"
+ );
+
+ }
+
+ public static function getOSApacheUser(){
+ return exec('ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk \'END {if ($1) print $1}\'');
+ }
+
+ /**
+ * @BeforeSuite
+ */
+ public static function prepareParameters(){
+ $apacheUser = self::getOSApacheUser();
+ self::modifyServerConfig($apacheUser, "shareapi_allow_public_upload", "core", "yes");
+ }
+
+ /**
+ * @AfterSuite
+ */
+ public static function undoChangingParameters(){
+ $apacheUser = self::getOSApacheUser();
+ self::modifyServerConfig($apacheUser, "shareapi_allow_public_upload", "core", "yes");
+ }
+
}