diff --git a/tests/TestHelpers/OcisHelper.php b/tests/TestHelpers/OcisHelper.php index 73a325ff9ef1..2618236605c3 100644 --- a/tests/TestHelpers/OcisHelper.php +++ b/tests/TestHelpers/OcisHelper.php @@ -62,7 +62,8 @@ public static function getDeleteUserDataCommand() { public static function deleteRevaUserData($user = "") { $deleteCmd = self::getDeleteUserDataCommand(); if ($deleteCmd !== false) { - $deleteCmd = \sprintf($deleteCmd, $user); + $deleteCmd = \sprintf($deleteCmd, $user[0] . '/' . $user); +// var_dump($deleteCmd); \exec($deleteCmd); } else { self::recurseRmdir(self::getOcisRevaDataRoot() . "/data/" . $user); diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index e58b118d7b7a..67a7276960b9 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -852,7 +852,7 @@ public function usersHaveBeenCreated( if (OcisHelper::isTestingOnOcis()) { $attributesToCreateUser['username'] = $userAttributes['userid']; if ($userAttributes['email'] === null) { - $attributesToCreateUser['email'] = $userAttributes['username'] . '@owncloud.org'; + $attributesToCreateUser['email'] = $userAttributes['username'] ?? $userAttributes['userid'] . '@owncloud.org'; } else { $attributesToCreateUser['email'] = $userAttributes['email']; } @@ -895,6 +895,10 @@ public function usersHaveBeenCreated( $users = []; $editData = []; foreach ($usersAttributes as $userAttributes) { + // On Eos storage backend when the user data is cleared after test run + // Running another test immediately fails. So Send this request to create user home directory + HttpRequestHelper::get($this->getBaseUrl() . "/ocs/v2.php/apps/notifications/api/v1/notifications?format=json", $userAttributes['userid'], $userAttributes['password']); + \array_push($users, $userAttributes['userid']); $this->addUserToCreatedUsersList($userAttributes['userid'], $userAttributes['password'], $userAttributes['displayName'], $userAttributes['email']); if (isset($userAttributes['displayName'])) { @@ -4129,7 +4133,9 @@ public function afterScenario() { $this->cleanupDatabaseGroups(); if (OcisHelper::isTestingOnOcis()) { - OcisHelper::deleteRevaUserData(""); + foreach ($this->getCreatedUsers() as $user) { + OcisHelper::deleteRevaUserData($user["actualUsername"]); + } } else { $this->resetAdminUserAttributes(); }