diff --git a/test/integration/config-gcs-custom-endpoint.yml b/test/integration/config-gcs-custom-endpoint.yml new file mode 100644 index 00000000..7ce99e57 --- /dev/null +++ b/test/integration/config-gcs-custom-endpoint.yml @@ -0,0 +1,18 @@ +general: + disable_progress_bar: true + remote_storage: gcs + upload_concurrency: 4 + download_concurrency: 4 + restore_schema_on_cluster: "{cluster}" +clickhouse: + host: clickhouse + port: 9000 + restart_command: bash -c 'echo "FAKE RESTART"' +gcs: + bucket: altinity-qa-test + path: backup/{cluster}/{shard} + object_disk_path: object_disks/{cluster}/{shard} + credentials_file: /etc/clickhouse-backup/credentials.json + compression_format: tar + endpoint: http://gcs:8080/storage/v1/ +# endpoint: http://gcs:8080/storage/v1/ diff --git a/test/integration/docker-compose.yml b/test/integration/docker-compose.yml index 2652a0d2..ac6534d3 100644 --- a/test/integration/docker-compose.yml +++ b/test/integration/docker-compose.yml @@ -43,17 +43,16 @@ services: - clickhouse-backup # todo need to reproduce download after upload -# gcs: -# image: fsouza/fake-gcs-server:latest -# hostname: gcs -# entrypoint: -# - /bin/sh -# command: -# - -c -# - "mkdir -p /data/clickhouse-backup-test-gcs && fake-gcs-server -data /data -scheme http -port 8080 -public-host gsc:8080" -# networks: -# - clickhouse-backup - + gcs: + image: fsouza/fake-gcs-server:latest + hostname: gcs + entrypoint: + - /bin/sh + command: + - -c + - "mkdir -p /data/clickhouse-backup-test-gcs && fake-gcs-server -data /data/clickhouse-backup-test-gcs -scheme http -port 8080 -public-host gcs:8080" + networks: + - clickhouse-backup azure: image: mcr.microsoft.com/azure-storage/azurite:latest @@ -196,6 +195,7 @@ services: - ./config-ftp.yaml:/etc/clickhouse-backup/config-ftp.yaml - ./config-ftp-old.yaml:/etc/clickhouse-backup/config-ftp-old.yaml - ./config-gcs.yml:/etc/clickhouse-backup/config-gcs.yml + - ./config-gcs-custom-endpoint.yml:/etc/clickhouse-backup/config-gcs-custom-endpoint.yml - ./config-s3.yml:/etc/clickhouse-backup/config-s3.yml - ./config-s3-embedded.yml:/etc/clickhouse-backup/config-s3-embedded.yml - ./config-s3-fips.yml:/etc/clickhouse-backup/config-s3-fips.yml.template diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index 76a4b184..6a98e84d 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -1720,6 +1720,15 @@ func TestIntegrationGCS(t *testing.T) { runMainIntegrationScenario(t, "GCS", "config-gcs.yml") } +func TestIntegrationGCSCustomeEndpoint(t *testing.T) { + if isTestShouldSkip("GCS_TESTS") { + t.Skip("Skipping GCS integration tests...") + return + } + //t.Parallel() + runMainIntegrationScenario(t, "GCS", "config-gcs-custom-endpoint.yml") +} + func TestIntegrationSFTPAuthPassword(t *testing.T) { //t.Parallel() runMainIntegrationScenario(t, "SFTP", "config-sftp-auth-password.yaml") @@ -2110,7 +2119,6 @@ func checkObjectStorageIsEmpty(t *testing.T, r *require.Assertions, remoteStorag } if remoteStorageType == "SFTP" { checkRemoteDir("total 0", "sshd", "bash", "-c", "ls -lh /root/") - } if remoteStorageType == "FTP" { if strings.Contains(os.Getenv("COMPOSE_FILE"), "advanced") { @@ -2119,9 +2127,8 @@ func checkObjectStorageIsEmpty(t *testing.T, r *require.Assertions, remoteStorag checkRemoteDir("total 0", "ftp", "bash", "-c", "ls -lh /home/vsftpd/test_backup/backup/") } } - //todo check gcs backup is empty if remoteStorageType == "GCS" { - + checkRemoteDir("total 0", "gcs", "bash", "-c", "ls -lh /data/clickhouse-backup-test-gcs") } }