diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-29 01:16:46 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-01-26 14:54:23 +0100 |
commit | 8e02014b559dd310dd42cc3f5cf1e4097342d459 (patch) | |
tree | b7aa2320136a43e914e541032f5cd32eeb90a805 /tests/preseed-config.php | |
parent | fceb781058516e7bd534719957a3d8354517b333 (diff) | |
download | nextcloud-server-8e02014b559dd310dd42cc3f5cf1e4097342d459.tar.gz nextcloud-server-8e02014b559dd310dd42cc3f5cf1e4097342d459.zip |
chore(tests): Migrate object storage unit tests from drone to GitHub Actions
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests/preseed-config.php')
-rw-r--r-- | tests/preseed-config.php | 89 |
1 files changed, 35 insertions, 54 deletions
diff --git a/tests/preseed-config.php b/tests/preseed-config.php index 16aea87c8a7..c62b4471280 100644 --- a/tests/preseed-config.php +++ b/tests/preseed-config.php @@ -25,71 +25,52 @@ if (getenv('OBJECT_STORE') === 's3') { 'arguments' => [ 'bucket' => 'nextcloud', 'autocreate' => true, - 'key' => 'nextcloud', - 'secret' => 'nextcloud', - 'hostname' => getenv('DRONE') === 'true' ? 'minio' : 'localhost', + 'key' => getenv('OBJECT_STORE_KEY') ?: 'nextcloud', + 'secret' => getenv('OBJECT_STORE_SECRET') ?: 'nextcloud', + 'hostname' => getenv('OBJECT_STORE_HOST') ?: 'localhost', 'port' => 9000, 'use_ssl' => false, // required for some non amazon s3 implementations 'use_path_style' => true ] ]; -} -if (getenv('OBJECT_STORE') === 'swift') { - $swiftHost = getenv('DRONE') === 'true' ? 'dockswift' : 'localhost'; - - if (getenv('SWIFT-AUTH') === 'v2.0') { - $CONFIG['objectstore'] = [ - 'class' => 'OC\\Files\\ObjectStore\\Swift', - 'arguments' => [ - 'autocreate' => true, - 'username' => 'swift', - 'tenantName' => 'service', - 'password' => 'swift', - 'serviceName' => 'swift', - 'region' => 'regionOne', - 'url' => "http://$swiftHost:5000/v2.0", - 'bucket' => 'nextcloud' - ] - ]; - } else { - $CONFIG['objectstore'] = [ - 'class' => 'OC\\Files\\ObjectStore\\Swift', - 'arguments' => [ - 'autocreate' => true, - 'user' => [ - 'name' => 'swift', - 'password' => 'swift', - 'domain' => [ - 'name' => 'default', - ] - ], - 'scope' => [ - 'project' => [ - 'name' => 'service', - 'domain' => [ - 'name' => 'default', - ], - ], - ], - 'tenantName' => 'service', - 'serviceName' => 'swift', - 'region' => 'regionOne', - 'url' => "http://$swiftHost:5000/v3", - 'bucket' => 'nextcloud' - ] - ]; - } -} -if (getenv('OBJECT_STORE') === 'azure') { +} elseif (getenv('OBJECT_STORE') === 'azure') { $CONFIG['objectstore'] = [ 'class' => 'OC\\Files\\ObjectStore\\Azure', 'arguments' => [ 'container' => 'test', - 'account_name' => 'devstoreaccount1', - 'account_key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', - 'endpoint' => 'http://' . (getenv('DRONE') === 'true' ? 'azurite' : 'localhost') . ':10000/devstoreaccount1', + 'account_name' => getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1', + 'account_key' => getenv('OBJECT_STORE_SECRET') ?: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', + 'endpoint' => 'http://' . (getenv('OBJECT_STORE_HOST') ?: 'localhost') . ':10000/' . (getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1'), 'autocreate' => true ] ]; +} elseif (getenv('OBJECT_STORE') === 'swift') { + $swiftHost = getenv('OBJECT_STORE_HOST') ?: 'localhost:5000'; + + $CONFIG['objectstore'] = [ + 'class' => 'OC\\Files\\ObjectStore\\Swift', + 'arguments' => [ + 'autocreate' => true, + 'user' => [ + 'name' => getenv('OBJECT_STORE_KEY') ?: 'swift', + 'password' => getenv('OBJECT_STORE_SECRET') ?: 'swift', + 'domain' => [ + 'name' => 'Default', + ], + ], + 'scope' => [ + 'project' => [ + 'name' => 'service', + 'domain' => [ + 'name' => 'Default', + ], + ], + ], + 'serviceName' => 'service', + 'region' => 'RegionOne', + 'url' => "http://$swiftHost/v3", + 'bucket' => 'nextcloud', + ] + ]; } |