From 26efa7184dee924e347faf5f73be3070abb9d8aa Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Thu, 26 Aug 2021 21:53:32 +0000 Subject: [PATCH] Added minio --- docker/test/stateless/Dockerfile | 4 ++++ docker/test/stateless/setup_minio.sh | 19 ++++++++++++++++++ .../02012_settings_clause_for_s3.sql | 20 ++++++++++--------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 docker/test/stateless/setup_minio.sh diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index 39c8a2e5358..f678e366ff2 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -49,6 +49,10 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ENV NUM_TRIES=1 ENV MAX_RUN_TIME=0 +ENV MINIO_ROOT_USER=clickhouse +ENV MINIO_ROOT_PASSWORD=clickhouse + COPY run.sh / COPY process_functional_tests_result.py / +COPY setup_minio.sh / CMD ["/bin/bash", "/run.sh"] diff --git a/docker/test/stateless/setup_minio.sh b/docker/test/stateless/setup_minio.sh new file mode 100644 index 00000000000..7ecd5f45aae --- /dev/null +++ b/docker/test/stateless/setup_minio.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e -x -a + +wget 'https://dl.min.io/server/minio/release/linux-amd64/minio' +chmod +x minio + +./minio server --address ":11111" ./data > /dev/null & + +wget 'https://dl.min.io/client/mc/release/linux-amd64/mc' +chmod +x mc + +mc alias set clickminio http://localhost:11111 clickhouse clickhouse +mc admin user add clickminio test testtest +mc admin policy set clickminio readwrite user=test +mc mb clickminio/test + +echo -e "a b c\na b c\na b c\n" > a.txt +mc cp a.txt clickminio/test diff --git a/tests/queries/0_stateless/02012_settings_clause_for_s3.sql b/tests/queries/0_stateless/02012_settings_clause_for_s3.sql index 88cd3d3c48f..79ccff14166 100644 --- a/tests/queries/0_stateless/02012_settings_clause_for_s3.sql +++ b/tests/queries/0_stateless/02012_settings_clause_for_s3.sql @@ -1,11 +1,13 @@ -DROP TABLE IF EXISTS table_with_range; +-- DROP TABLE IF EXISTS table_with_range; -CREATE TABLE table_with_range -( - `name` String, - `value` UInt32 -) -ENGINE = S3('https://storage.yandexcloud.net/my-test-bucket-768/{some,another}_prefix/some_file_{1..3}', 'CSV') -SETTINGS input_format_with_names_use_header = 0; +-- CREATE TABLE table_with_range +-- ( +-- `name` String, +-- `value` UInt32 +-- ) +-- ENGINE = S3('https://storage.yandexcloud.net/my-test-bucket-768/{some,another}_prefix/some_file_{1..3}', 'CSV') +-- SETTINGS input_format_with_names_use_header = 0; -DROP TABLE IF EXISTS table_with_range; +select * from s3('http://localhost:11111/test/a.txt', 'test', 'testtest', 'LineAsString', 'line String'); + +-- DROP TABLE IF EXISTS table_with_range;