Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use smaller upload files for mint #41

Merged
merged 3 commits into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
RUN apt-get update && apt-get install -yq \
git && git clone https://github.com/minio/mint.git && \
cd /mint && /mint/buildscripts/mint-deps.sh

WORKDIR /mint

CMD /mint/run.sh
3 changes: 2 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WORKDIR /mint
COPY . /mint

RUN apt-get update && apt-get install -yq \
git && /mint/buildscripts/mint-deps.sh
git && /mint/buildscripts/mint-deps.sh && \
/mint/buildscripts/initData.sh

CMD /mint/run.sh
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Collection of tests to detect overall correctness of Minio server.

## How to Run

The project will be published in Docker hub after further more testing. Till then the docker image has to be built locally and run.
The project will be published in Docker hub after further testing. Till then the docker image has to be built locally and run.

### Build

Expand All @@ -36,14 +36,10 @@ Set environment variables to pass test target server details to the docker conta
- `ACCESS_KEY` - Access Key of the server
- `SECRET_KEY` - Secret Key of the server
- `ENABLE_HTTPS` - Optional value when set to 1 sends HTTPS requests on SSL enabled deployment
- `DATA_DIR` - Optional value when set uses data from this directory for SDK tests

Note: With no env variables provided the tests are run on play.minio.io by default

#### Config file

- `apps` - Directories specified in this section are executed in sequential order. You can comment out specific directories to remove them from execution or rearrange them to change execution order.
- `mode` - Only `quick` mode supported right now. Only basic tests are run in quick mode.

### Run

To run Mint image, use the `docker run` command. For example, to run Mint with Minio Play server as test target use the below command
Expand Down Expand Up @@ -76,9 +72,26 @@ To add tests to an existing SDK folder:

- Navigate to specific SDK test file in the path `apps/<sdk_name>/`.
- Add test cases and update `main` method if applicable.
- Refer test data section for using existing test data.

To add new SDK/CLI to Mint:

- Create new directory in `apps/` directory with corresponding tool name
- Add a `run.sh` script. This script should set up the SDK/CLI tool and then execute the tests
- Add an entry in `config.yaml` with name of folder, e.g test_folder

### Test data

All test data used by SDK tests will reside in `/mint/data/` directory on the container.To add additional test files, edit `initData.sh` script
| File name | Size
|:--- |:--- |
| FileOfSize1B | 1B |
| SmallFile |10KB
| FileOfSizeGt32KB |33KB
| FileOfSize100KB |100KB
| FileOfSize1MB |1MB
| FileOfSize5MB |5MB
| FileOfSize6MB |6MB
| FileOfSize11MB |11MB
| FileOfSize65MB |65MB
| FileOfSizeGt1MB |1.03MB
6 changes: 4 additions & 2 deletions buildscripts/go-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ buildInitTests() {

# Build Minio Go tests
buildMinioGoTests() {
go test -o ${minio_go_sdk_path}/minio.test -c ${minio_go_sdk_path}/api_functional_v4_test.go
go get -u github.com/sirupsen/logrus && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabbing issue. please use a better editor.

go get -u github.com/minio/minio-go && \
go build -o ${minio_go_sdk_path}/minio-go ${minio_go_sdk_path}/api_functional_v4_tests.go
}

# Remove Go dependencies
Expand All @@ -54,4 +56,4 @@ goMain() {
cleanMinioGoDeps
}

_init "$@" && goMain
_init "$@" && goMain
31 changes: 31 additions & 0 deletions buildscripts/initData.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Minio Cloud Storage, (C) 2017 Minio, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license header should say Mint instead of Minio Cloud Storage. You could fix this in a separate PR for all files.

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
data_dir="/mint/data"
if [ ! -d $data_dir ]; then
mkdir $data_dir
fi
cd $data_dir
for COUNT in 1 5 6 11 65
do
dd if=/dev/zero of=FileOfSize"$COUNT"MB bs=1M count=$COUNT
done
dd if=/dev/zero of=SmallFile bs=1024 count=10
dd if=/dev/zero of=FileOfSize1B bs=1 count=1
dd if=/dev/zero of=FileOfSizeGt1MB bs=1024 count=1056
dd if=/dev/zero of=FileOfSizeGt32KB bs=1024 count=33
dd if=/dev/zero of=FileOfSize100KB bs=1024 count=100
cd ../
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ _init() {
if [ ! -d $log_dir ]; then
mkdir $log_dir
fi

if [ -z "$DATA_DIR" ]; then
export DATA_DIR="/mint/data"
fi
}

printMsg() {
Expand Down
Loading