rebranding tests
This commit is contained in:
@@ -26,10 +26,10 @@ use GuzzleHttp\Exception\ConnectException;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\OcConfigHelper;
|
||||
|
||||
/**
|
||||
* A helper class for running oCIS CLI commands
|
||||
* A helper class for running OpenCloud CLI commands
|
||||
*/
|
||||
class CliHelper {
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ class CliHelper {
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function runCommand(array $body): ResponseInterface {
|
||||
$url = OcisConfigHelper::getWrapperUrl() . "/command";
|
||||
return OcisConfigHelper::sendRequest($url, "POST", \json_encode($body));
|
||||
$url = OcConfigHelper::getWrapperUrl() . "/command";
|
||||
return OcConfigHelper::sendRequest($url, "POST", \json_encode($body));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class HttpRequestHelper {
|
||||
* @return int
|
||||
*/
|
||||
public static function numRetriesOnHttpTooEarly(): int {
|
||||
// Currently reva and oCIS may return HTTP_TOO_EARLY
|
||||
// Currently reva and OpenCloud may return HTTP_TOO_EARLY
|
||||
// So try up to 10 times before giving up.
|
||||
return 10;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ class HttpRequestHelper {
|
||||
);
|
||||
}
|
||||
|
||||
if (WebdavHelper::isDAVRequest($url) && \str_starts_with($url, OcisHelper::getServerUrl())) {
|
||||
if (WebdavHelper::isDAVRequest($url) && \str_starts_with($url, OcHelper::getServerUrl())) {
|
||||
$urlHasRemotePhp = \str_contains($url, 'remote.php');
|
||||
if (!WebDavHelper::withRemotePhp() && $urlHasRemotePhp) {
|
||||
throw new Exception("remote.php is disabled but found in the URL: $url");
|
||||
|
||||
+8
-8
@@ -29,9 +29,9 @@ use GuzzleHttp\Psr7\Request;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* A helper class for configuring oCIS server
|
||||
* A helper class for configuring OpenCloud server
|
||||
*/
|
||||
class OcisConfigHelper {
|
||||
class OcConfigHelper {
|
||||
/**
|
||||
* @param string $url
|
||||
* @param string $method
|
||||
@@ -57,8 +57,8 @@ class OcisConfigHelper {
|
||||
$response = $client->send($request);
|
||||
} catch (ConnectException $e) {
|
||||
throw new \Error(
|
||||
"Cannot connect to the ociswrapper at the moment,"
|
||||
. "make sure that ociswrapper is running before proceeding with the test run.\n"
|
||||
"Cannot connect to the ocwrapper at the moment,"
|
||||
. "make sure that ocwrapper is running before proceeding with the test run.\n"
|
||||
. $e->getMessage()
|
||||
);
|
||||
} catch (GuzzleException $ex) {
|
||||
@@ -89,7 +89,7 @@ class OcisConfigHelper {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function reConfigureOcis(array $envs): ResponseInterface {
|
||||
public static function reConfigureOc(array $envs): ResponseInterface {
|
||||
$url = self::getWrapperUrl() . "/config";
|
||||
return self::sendRequest($url, "PUT", \json_encode($envs));
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class OcisConfigHelper {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function rollbackOcis(): ResponseInterface {
|
||||
public static function rollbackOc(): ResponseInterface {
|
||||
$url = self::getWrapperUrl() . "/rollback";
|
||||
return self::sendRequest($url, "DELETE");
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class OcisConfigHelper {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function stopOcis(): ResponseInterface {
|
||||
public static function stopOpencloud(): ResponseInterface {
|
||||
$url = self::getWrapperUrl() . "/stop";
|
||||
return self::sendRequest($url, "POST");
|
||||
}
|
||||
@@ -116,7 +116,7 @@ class OcisConfigHelper {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function startOcis(): ResponseInterface {
|
||||
public static function startOpencloud(): ResponseInterface {
|
||||
$url = self::getWrapperUrl() . "/start";
|
||||
return self::sendRequest($url, "POST");
|
||||
}
|
||||
+10
-11
@@ -39,17 +39,16 @@ abstract class StorageDriver {
|
||||
}
|
||||
|
||||
/**
|
||||
* Class OcisHelper
|
||||
* Class OcHelper
|
||||
*
|
||||
* Helper functions that are needed to run tests on OCIS
|
||||
* Helper functions that are needed to run tests on OpenCloud server
|
||||
*
|
||||
* @package TestHelpers
|
||||
*/
|
||||
class OcisHelper {
|
||||
class OcHelper {
|
||||
public const STORAGE_DRIVERS = [
|
||||
StorageDriver::OCIS,
|
||||
StorageDriver::EOS,
|
||||
StorageDriver::OWNCLOUD,
|
||||
StorageDriver::S3NG,
|
||||
StorageDriver::POSIX
|
||||
];
|
||||
@@ -109,7 +108,7 @@ class OcisHelper {
|
||||
public static function getStorageDriver(): string {
|
||||
$storageDriver = (\getenv("STORAGE_DRIVER"));
|
||||
if ($storageDriver === false) {
|
||||
return StorageDriver::OWNCLOUD;
|
||||
return StorageDriver::OCIS;
|
||||
}
|
||||
$storageDriver = \strtoupper($storageDriver);
|
||||
if (!\in_array($storageDriver, self::STORAGE_DRIVERS)) {
|
||||
@@ -140,8 +139,8 @@ class OcisHelper {
|
||||
$user = $user["actualUsername"];
|
||||
}
|
||||
if ($deleteCmd === false) {
|
||||
if (self::getStorageDriver() === StorageDriver::OWNCLOUD) {
|
||||
self::recurseRmdir(self::getOcisRevaDataRoot() . $user);
|
||||
if (self::getStorageDriver() === StorageDriver::OCIS) {
|
||||
self::recurseRmdir(self::getOcRevaDataRoot() . $user);
|
||||
}
|
||||
continue;
|
||||
} elseif (self::getStorageDriver() === StorageDriver::EOS) {
|
||||
@@ -206,7 +205,7 @@ class OcisHelper {
|
||||
*/
|
||||
public static function getBaseDN(): string {
|
||||
$dn = \getenv("REVA_LDAP_BASE_DN");
|
||||
return $dn ?: "dc=owncloud,dc=com";
|
||||
return $dn ?: "dc=opencloud,dc=com";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +244,7 @@ class OcisHelper {
|
||||
*/
|
||||
public static function getBindDN(): string {
|
||||
$dn = \getenv("REVA_LDAP_BIND_DN");
|
||||
return $dn ?: "cn=admin,dc=owncloud,dc=com";
|
||||
return $dn ?: "cn=admin,dc=opencloud,dc=com";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,10 +258,10 @@ class OcisHelper {
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private static function getOcisRevaDataRoot(): string {
|
||||
private static function getOcRevaDataRoot(): string {
|
||||
$root = \getenv("OC_REVA_DATA_ROOT");
|
||||
if ($root === false || $root === "") {
|
||||
$root = "/var/tmp/ocis/owncloud/";
|
||||
$root = "/var/tmp/opencloud/opencloud/";
|
||||
}
|
||||
if (!\file_exists($root)) {
|
||||
echo "WARNING: reva data root folder ($root) does not exist\n";
|
||||
@@ -28,7 +28,7 @@ use Psr\Http\Message\ResponseInterface;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
/**
|
||||
* A helper class for ocis settings
|
||||
* A helper class for OpenCloud settings
|
||||
*/
|
||||
class SettingsHelper {
|
||||
private static string $settingsEndpoint = '/api/v0/settings/';
|
||||
|
||||
@@ -58,7 +58,7 @@ class SharingHelper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $baseUrl baseURL of the ownCloud installation without /ocs.
|
||||
* @param string $baseUrl baseURL of the OpenCloud installation without /ocs.
|
||||
* @param string $user user that creates the share.
|
||||
* @param string $password password of the user that creates the share.
|
||||
* @param string $path The path to the file or folder which should be shared.
|
||||
|
||||
@@ -34,12 +34,7 @@ use Psr\Http\Message\ResponseInterface;
|
||||
class UploadHelper extends Assert {
|
||||
/**
|
||||
*
|
||||
* @param string|null $baseUrl URL of owncloud
|
||||
* e.g. http://localhost:8080
|
||||
* should include the subfolder
|
||||
* if owncloud runs in a subfolder
|
||||
* e.g. http://localhost:8080/owncloud-core
|
||||
* @param string|null $user
|
||||
* @param string|null $baseUrl URL of OpenCloud
|
||||
* @param string|null $password
|
||||
* @param string|null $source
|
||||
* @param string|null $destination
|
||||
|
||||
@@ -252,7 +252,7 @@ class WebDavHelper {
|
||||
if ($folderDepth !== '') {
|
||||
throw new InvalidArgumentException('Invalid depth value ' . $folderDepth);
|
||||
}
|
||||
$folderDepth = '1'; // oCIS server's default value
|
||||
$folderDepth = '1'; // OpenCloud server's default value
|
||||
}
|
||||
$headers['Depth'] = $folderDepth;
|
||||
return self::makeDavRequest(
|
||||
@@ -527,7 +527,7 @@ class WebDavHelper {
|
||||
}
|
||||
|
||||
$personalSpaceId = '';
|
||||
if (!OcisHelper::isTestingOnReva()) {
|
||||
if (!OcHelper::isTestingOnReva()) {
|
||||
$response = GraphHelper::getMySpaces($baseUrl, $user, $password, '', $xRequestId);
|
||||
Assert::assertEquals(200, $response->getStatusCode(), "Cannot list drives for user '$user'");
|
||||
|
||||
@@ -610,10 +610,7 @@ class WebDavHelper {
|
||||
/**
|
||||
* sends a DAV request
|
||||
*
|
||||
* @param string|null $baseUrl
|
||||
* URL of owncloud e.g. http://localhost:8080
|
||||
* should include the subfolder if owncloud runs in a subfolder
|
||||
* e.g. http://localhost:8080/owncloud-core
|
||||
* @param string|null $baseUrl URL of OpenCloud e.g. http://localhost:8080
|
||||
* @param string|null $user
|
||||
* @param string|null $password or token when bearer auth is used
|
||||
* @param string|null $method PUT, GET, DELETE, etc.
|
||||
|
||||
Reference in New Issue
Block a user