Switch from ocis/s3ng to decomposed/decomposed_s3 storage drivers

ocis/s3ng are still supported for backwards compatibility reasons, but
they need to be configured using the decomposed/decomposed_s3 options.
This commit is contained in:
André Duffeck
2025-01-24 11:04:23 +01:00
parent e428d56443
commit 57fa8eb43c
24 changed files with 331 additions and 318 deletions
+5 -5
View File
@@ -31,10 +31,10 @@ use GuzzleHttp\Exception\GuzzleException;
* @package TestHelpers
*/
abstract class StorageDriver {
public const OCIS = "OCIS";
public const DECOMPOSED = "DECOMPOSED";
public const EOS = "EOS";
public const OWNCLOUD = "OWNCLOUD";
public const S3NG = "S3NG";
public const DECOMPOSEDS3 = "DECOMPOSED_S3";
public const POSIX = "POSIX";
}
@@ -47,10 +47,10 @@ abstract class StorageDriver {
*/
class OcHelper {
public const STORAGE_DRIVERS = [
StorageDriver::OCIS,
StorageDriver::DECOMPOSED,
StorageDriver::EOS,
StorageDriver::OWNCLOUD,
StorageDriver::S3NG,
StorageDriver::DECOMPOSEDS3,
StorageDriver::POSIX
];
@@ -109,7 +109,7 @@ class OcHelper {
public static function getStorageDriver(): string {
$storageDriver = (\getenv("STORAGE_DRIVER"));
if ($storageDriver === false) {
return StorageDriver::OCIS;
return StorageDriver::DECOMPOSED;
}
$storageDriver = \strtoupper($storageDriver);
if (!\in_array($storageDriver, self::STORAGE_DRIVERS)) {
@@ -752,7 +752,7 @@ class FeatureContext extends BehatVariablesContext {
*/
public function getStorageUsersRoot(): string {
$ocDataPath = getenv("OC_BASE_DATA_PATH") ? getenv("OC_BASE_DATA_PATH") : getenv("HOME") . '/.opencloud';
return getenv("STORAGE_USERS_OCIS_ROOT") ? getenv("STORAGE_USERS_OCIS_ROOT") : $ocDataPath . "/storage/users";
return getenv("STORAGE_USERS_DECOMPOSED_ROOT") ? getenv("STORAGE_USERS_DECOMPOSED_ROOT") : $ocDataPath . "/storage/users";
}
/**
@@ -3008,9 +3008,9 @@ class FeatureContext extends BehatVariablesContext {
public static function isExpectedToFail(string $scenarioLine): bool {
$expectedFailFile = \getenv('EXPECTED_FAILURES_FILE');
if (!$expectedFailFile) {
$expectedFailFile = __DIR__ . '/../expected-failures-localAPI-on-OCIS-storage.md';
$expectedFailFile = __DIR__ . '/../expected-failures-localAPI-on-decomposed-storage.md';
if (\strpos($scenarioLine, "coreApi") === 0) {
$expectedFailFile = __DIR__ . '/../expected-failures-API-on-OCIS-storage.md';
$expectedFailFile = __DIR__ . '/../expected-failures-API-on-decomposed-storage.md';
}
}
+40 -40
View File
@@ -67,26 +67,26 @@ help:
@echo -e "where ${YELLOW}latest${RESET} is an example for any valid Docker image tag from"
@echo -e "https://hub.docker.com/r/opencloud/opencloud."
@echo
@echo -e "${GREEN}Run full OpenCloud test suites with ocis storage:${RESET}\n"
@echo -e "\tmake localApiTests-apiAccountsHashDifficulty-ocis\t\t${BLUE}run apiAccountsHashDifficulty test suite, where available test suite are apiAccountsHashDifficulty apiArchiver apiContract apiGraph apiSpaces apiSpacesShares apiAsyncUpload apiCors${RESET}"
@echo -e "${GREEN}Run full OpenCloud test suites with decomposed storage:${RESET}\n"
@echo -e "\tmake localApiTests-apiAccountsHashDifficulty-decomposed\t\t${BLUE}run apiAccountsHashDifficulty test suite, where available test suite are apiAccountsHashDifficulty apiArchiver apiContract apiGraph apiSpaces apiSpacesShares apiAsyncUpload apiCors${RESET}"
@echo
@echo -e "${GREEN}Run full OpenCloud test suites with s3ng storage:${RESET}\n"
@echo -e "\tmake localApiTests-apiAccountsHashDifficulty-s3ng\t\t${BLUE}run apiAccountsHashDifficulty test suite, where available test suite are apiAccountsHashDifficulty apiArchiver apiContract apiGraph apiSpaces apiSpacesShares apiAsyncUpload apiCors${RESET}"
@echo -e "${GREEN}Run full OpenCloud test suites with decomposed_s3 storage:${RESET}\n"
@echo -e "\tmake localApiTests-apiAccountsHashDifficulty-decomposed_s3\t\t${BLUE}run apiAccountsHashDifficulty test suite, where available test suite are apiAccountsHashDifficulty apiArchiver apiContract apiGraph apiSpaces apiSpacesShares apiAsyncUpload apiCors${RESET}"
@echo
@echo -e "${GREEN}Run full OpenCloud test suites with ocis storage:${RESET}\n"
@echo -e "\tmake Core-API-Tests-ocis-storage-${RED}X${RESET}\t\t${BLUE}run test suite number X, where ${RED}X = 1 .. 10${RESET}"
@echo -e "${GREEN}Run full OpenCloud test suites with decomposed storage:${RESET}\n"
@echo -e "\tmake Core-API-Tests-decomposed-storage-${RED}X${RESET}\t\t${BLUE}run test suite number X, where ${RED}X = 1 .. 10${RESET}"
@echo
@echo -e "${GREEN}Run full OpenCloud test suites with s3ng storage:${RESET}\n"
@echo -e "\tmake Core-API-Tests-s3ng-storage-${RED}X${RESET}\t\t${BLUE}run test suite number X, where ${RED}X = 1 .. 10${RESET}"
@echo -e "${GREEN}Run full OpenCloud test suites with decomposed_s3 storage:${RESET}\n"
@echo -e "\tmake Core-API-Tests-decomposed_s3-storage-${RED}X${RESET}\t\t${BLUE}run test suite number X, where ${RED}X = 1 .. 10${RESET}"
@echo
@echo -e "${GREEN}Run an OpenCloud feature test with ocis storage:${RESET}\n"
@echo -e "\tmake test-opencloud-feature-ocis-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo -e "${GREEN}Run an OpenCloud feature test with decomposed storage:${RESET}\n"
@echo -e "\tmake test-opencloud-feature-decomposed-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo
@echo -e "\twhere ${YELLOW}BEHAT_FEATURE='...'${RESET} contains a relative path to the feature definition."
@echo -e "\texample: ${RED}tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature${RESET}"
@echo
@echo -e "${GREEN}Run an OpenCloud feature test with s3ng storage:${RESET}\n"
@echo -e "\tmake test-opencloud-feature-s3ng-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo -e "${GREEN}Run an OpenCloud feature test with decomposed_s3 storage:${RESET}\n"
@echo -e "\tmake test-opencloud-feature-decomposed_s3-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo
@echo -e "\twhere ${YELLOW}BEHAT_FEATURE='...'${RESET} contains a relative path to the feature definition."
@echo -e "\texample: ${RED}tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature${RESET}"
@@ -94,14 +94,14 @@ help:
@echo -e "\twhere ${YELLOW}BEHAT_FEATURE='...'${RESET} contains a relative path to the feature definition."
@echo -e "\texample: ${RED}tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature${RESET}"
@echo
@echo -e "${GREEN}Run a core test against OpenCloud with ocis storage:${RESET}\n"
@echo -e "\tmake test-core-feature-ocis-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo -e "${GREEN}Run a core test against OpenCloud with decomposed storage:${RESET}\n"
@echo -e "\tmake test-core-feature-decomposed-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo
@echo -e "\twhere ${YELLOW}BEHAT_FEATURE='...'${RESET} contains a relative path to the feature definition."
@echo -e "\texample: ${RED}tests/acceptance/features/coreApiAuth/webDavAuth.feature${RESET}"
@echo
@echo -e "${GREEN}Run a core test against OpenCloud with s3ng storage:${RESET}\n"
@echo -e "\tmake test-core-feature-s3ng-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo -e "${GREEN}Run a core test against OpenCloud with decomposed_s3 storage:${RESET}\n"
@echo -e "\tmake test-core-feature-decomposed_s3-storage ${YELLOW}BEHAT_FEATURE='...'${RESET}\t${BLUE}run single feature test${RESET}"
@echo
@echo -e "\twhere ${YELLOW}BEHAT_FEATURE='...'${RESET} contains a relative path to the feature definition."
@echo -e "\texample: ${RED}tests/acceptance/features/coreApiAuth/webDavAuth.feature${RESET}"
@@ -119,69 +119,69 @@ help:
@echo -e "\tmake clean-docker-container\t\t${BLUE}stops and removes used docker containers${RESET}"
@echo -e "\tmake clean-docker-volumes\t\t${BLUE}removes used docker volumes (used for caching)${RESET}"
@echo
.PHONY: test-opencloud-feature-ocis-storage
test-opencloud-feature-ocis-storage: ## test a OpenCloud feature with ocis storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature:10'
.PHONY: test-opencloud-feature-decomposed-storage
test-opencloud-feature-decomposed-storage: ## test a OpenCloud feature with decomposed storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature:10'
@TEST_SOURCE=opencloud \
STORAGE_DRIVER=ocis \
STORAGE_DRIVER=decomposed \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
$(MAKE) --no-print-directory testSuite
.PHONY: test-opencloud-feature-s3ng-storage
test-opencloud-feature-s3ng-storage: ## test a OpenCloud feature with s3ng storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature:10'
.PHONY: test-opencloud-feature-decomposed_s3-storage
test-opencloud-feature-decomposed_s3-storage: ## test a OpenCloud feature with decomposed_s3 storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/apiAccountsHashDifficulty/addUser.feature:10'
@TEST_SOURCE=opencloud \
STORAGE_DRIVER=s3ng \
STORAGE_DRIVER=decomposed_s3 \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
START_CEPH=1 \
$(MAKE) --no-print-directory testSuite
.PHONY: test-core-feature-ocis-storage
test-core-feature-ocis-storage: ## test a core feature with ocis storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature'
.PHONY: test-core-feature-decomposed-storage
test-core-feature-decomposed-storage: ## test a core feature with decomposed storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature'
@TEST_SOURCE=core \
STORAGE_DRIVER=ocis \
STORAGE_DRIVER=decomposed \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
$(MAKE) --no-print-directory testSuite
.PHONY: test-core-feature-s3ng-storage
test-core-feature-s3ng-storage: ## test a core feature with s3ng storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature'
.PHONY: test-core-feature-decomposed_s3-storage
test-core-feature-decomposed_s3-storage: ## test a core feature with decomposed_s3 storage, usage: make ... BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature'
@TEST_SOURCE=core \
STORAGE_DRIVER=s3ng \
STORAGE_DRIVER=decomposed_s3 \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
START_CEPH=1 \
$(MAKE) --no-print-directory testSuite
localSuiteOpencloud = $(addprefix localApiTests-, $(addsuffix -ocis,${LOCAL_API_SUITES}))
localSuiteOpencloud = $(addprefix localApiTests-, $(addsuffix -decomposed,${LOCAL_API_SUITES}))
.PHONY: $(localSuiteOpencloud)
$(localSuiteOpencloud): ## run local api test suite with ocis storage
$(localSuiteOpencloud): ## run local api test suite with decomposed storage
@$(eval BEHAT_SUITE=$(shell echo "$@" | cut -d'-' -f2))
@TEST_SOURCE=opencloud \
STORAGE_DRIVER=ocis \
STORAGE_DRIVER=decomposed \
BEHAT_SUITE=$(BEHAT_SUITE) \
$(MAKE) --no-print-directory testSuite
localSuites3ng = $(addprefix localApiTests-, $(addsuffix -s3ng,${LOCAL_API_SUITES}))
.PHONY: $(localSuites3ng)
$(localSuites3ng): ## run local api test suite with s3 storage
localSuiteDecomposedS3 = $(addprefix localApiTests-, $(addsuffix -decomposed_s3,${LOCAL_API_SUITES}))
.PHONY: $(localSuiteDecomposedS3)
$(localSuiteDecomposedS3): ## run local api test suite with s3 storage
@$(eval BEHAT_SUITE=$(shell echo "$@" | cut -d'-' -f2))
@TEST_SOURCE=opencloud \
STORAGE_DRIVER=s3ng \
STORAGE_DRIVER=decomposed_s3 \
BEHAT_SUITE=$(BEHAT_SUITE) \
$(MAKE) --no-print-directory testSuite
targetsOC = $(addprefix Core-API-Tests-ocis-storage-,$(PARTS))
targetsOC = $(addprefix Core-API-Tests-decomposed-storage-,$(PARTS))
.PHONY: $(targetsOC)
$(targetsOC):
@$(eval RUN_PART=$(shell echo "$@" | tr -dc '0-9'))
@TEST_SOURCE=core \
STORAGE_DRIVER=ocis \
STORAGE_DRIVER=decomposed \
RUN_PART=$(RUN_PART) \
$(MAKE) --no-print-directory testSuite
targetsS3ng = $(addprefix Core-API-Tests-s3ng-storage-,$(PARTS))
.PHONY: $(targetsS3ng)
targetsDecomposedS3 = $(addprefix Core-API-Tests-decomposed_s3-storage-,$(PARTS))
.PHONY: $(targetsDecomposedS3)
$(targets):
@$(eval RUN_PART=$(shell echo "$@" | tr -dc '0-9'))
@TEST_SOURCE=core \
STORAGE_DRIVER=s3ng \
STORAGE_DRIVER=decomposed_s3 \
RUN_PART=$(RUN_PART) \
$(MAKE) --no-print-directory testSuite
+9 -9
View File
@@ -9,12 +9,12 @@ git config --global advice.detachedHead false
if [ "$TEST_SOURCE" = "core" ]; then
export ACCEPTANCE_TEST_TYPE='core-api'
if [ "$STORAGE_DRIVER" = "ocis" ]; then
if [ "$STORAGE_DRIVER" = "decomposed" ]; then
export OC_REVA_DATA_ROOT=''
export BEHAT_FILTER_TAGS='~@skipOnOpencloud-OCIS-Storage'
export EXPECTED_FAILURES_FILE='/drone/src/tests/acceptance/expected-failures-API-on-OCIS-storage.md'
elif [ "$STORAGE_DRIVER" = "s3ng" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-S3NG-Storage'
export BEHAT_FILTER_TAGS='~@skipOnOpencloud-decomposed-Storage'
export EXPECTED_FAILURES_FILE='/drone/src/tests/acceptance/expected-failures-API-on-decomposed-storage.md'
elif [ "$STORAGE_DRIVER" = "decomposed_s3" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-decomposed_s3-Storage'
export OC_REVA_DATA_ROOT=''
else
echo "non existing STORAGE selected"
@@ -24,11 +24,11 @@ if [ "$TEST_SOURCE" = "core" ]; then
unset BEHAT_SUITE
elif [ "$TEST_SOURCE" = "opencloud" ]; then
if [ "$STORAGE_DRIVER" = "ocis" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-OCIS-Storage'
if [ "$STORAGE_DRIVER" = "decomposed" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-decomposed-Storage'
export OC_REVA_DATA_ROOT=''
elif [ "$STORAGE_DRIVER" = "s3ng" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-S3NG-Storage'
elif [ "$STORAGE_DRIVER" = "decomposed_s3" ]; then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOpencloud-decomposed_s3-Storage'
export OC_REVA_DATA_ROOT=''
else
echo "non existing storage selected"