diff --git a/tests/TestHelpers/OcisHelper.php b/tests/TestHelpers/OcisHelper.php index 2618236605c3..405f637aac8d 100644 --- a/tests/TestHelpers/OcisHelper.php +++ b/tests/TestHelpers/OcisHelper.php @@ -33,6 +33,15 @@ */ class OcisHelper { + private static $withSkeleton = true; + + public static function setSkeleton() { + self::$withSkeleton = true; + } + + public static function unSetSkeleton() { + self::$withSkeleton = false; + } /** * @return bool */ @@ -54,6 +63,25 @@ public static function getDeleteUserDataCommand() { return (\getenv("DELETE_USER_DATA_CMD")); } + /** + * @return bool + */ + public static function getDeleteUserShareCommand() { + return (\getenv("DELETE_USER_SHARE_CMD")); + } + + /** + * @param string $user + * + * @return void + */ + public static function deleteRevaUserShares() { + $deleteCmd = self::getDeleteUserShareCommand(); + if ($deleteCmd !== false) { + \exec($deleteCmd); + } + } + /** * @param string $user * @@ -65,6 +93,7 @@ public static function deleteRevaUserData($user = "") { $deleteCmd = \sprintf($deleteCmd, $user[0] . '/' . $user); // var_dump($deleteCmd); \exec($deleteCmd); + \exec('docker exec -it ocis rm /var/tmp/ocis-accounts/' . $user); } else { self::recurseRmdir(self::getOcisRevaDataRoot() . "/data/" . $user); } @@ -108,6 +137,9 @@ public static function recurseCopy($source, $destination) { * @throws \Exception */ public static function recurseUpload($baseUrl, $source, $userId, $password, $destination = '') { + if (!self::$withSkeleton) { + return; + } if ($destination !== '') { $response = WebDavHelper::makeDavRequest( $baseUrl, diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 67a7276960b9..744083501b5c 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -455,6 +455,9 @@ public function theseUsersHaveBeenCreatedWithoutSkeletonFiles(TableNode $table) ["config:system:set skeletondirectory --value $path"], null, null, $baseUrl ); + if (OcisHelper::isTestingOnOcis()) { + OcisHelper::setSkeleton(); + } } } @@ -4136,6 +4139,7 @@ public function afterScenario() { foreach ($this->getCreatedUsers() as $user) { OcisHelper::deleteRevaUserData($user["actualUsername"]); } + OcisHelper::deleteRevaUserShares(); } else { $this->resetAdminUserAttributes(); } @@ -4311,6 +4315,9 @@ public function popSkeletonDirectoryConfig($baseUrl = null) { ["config:system:delete skeletondirectory"], null, null, $baseUrl ); + if (OcisHelper::isTestingOnOcis()) { + OcisHelper::unSetSkeleton(); + } return $path; } } diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php index 841b4c4c3f26..f82d7a28272f 100644 --- a/tests/acceptance/features/bootstrap/Sharing.php +++ b/tests/acceptance/features/bootstrap/Sharing.php @@ -913,6 +913,7 @@ public function createShare( $this->ocsApiVersion, $this->sharingApiVersion ); + var_dump($this->response->getBody()->getContents()); $this->lastShareData = $this->getResponseXml(); if ($shareType === 'public_link' && isset($this->lastShareData->data)) { $linkName = (string) $this->lastShareData->data[0]->name;