Skip to content

Commit 584bc6d

Browse files
committed
Remove MC dependency.
1 parent 77fefd4 commit 584bc6d

File tree

5 files changed

+3
-60
lines changed

5 files changed

+3
-60
lines changed

LNX-docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ services:
7777
- -c
7878
- |
7979
set -e
80-
wget -P /home/dja/.local/bin/ https://dl.min.io/client/mc/release/linux-amd64/mc
81-
chmod +x /home/dja/.local/bin/mc
8280
pip install --user -r test_requirements.txt
8381
pip install -e .
8482
pip freeze | grep datajoint

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ GID=1000
134134
* Launch local terminal
135135
* `export` environment variables in shell
136136
* Add entry in `/etc/hosts` for `127.0.0.1 fakeservices.datajoint.io`
137-
* Install [minio client(mc)](https://min.io/download#/linux) so that you can use it in terminal
137+
138138

139139

140140

local-docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ services:
8282
- -c
8383
- |
8484
set -e
85-
wget -P /home/dja/.local/bin/ https://dl.min.io/client/mc/release/linux-amd64/mc
86-
chmod +x /home/dja/.local/bin/mc
8785
pip install --user nose nose-cov coveralls flake8 ptvsd
8886
pip install -e .
8987
pip freeze | grep datajoint

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
__author__ = 'Edgar Walker, Fabian Sinz, Dimitri Yatsenko, Raphael Guzman'
2121

2222
# turn on verbose logging
23-
logging.basicConfig(level=logging.DEBUG)
23+
# logging.basicConfig(level=logging.DEBUG)
2424

2525
__all__ = ['__author__', 'PREFIX', 'CONN_INFO']
2626

tests/test_s3.py

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
from . import S3_CONN_INFO
22
from minio import Minio
3-
import json
43
import urllib3
54
import certifi
65
from nose.tools import assert_true, raises
76
from .schema_external import schema, SimpleRemote
87
from datajoint.errors import DataJointError
9-
import os
108
from datajoint.hash import uuid_from_buffer
119
from datajoint.blob import pack
1210

@@ -69,53 +67,6 @@ def test_remove_object_exception():
6967
secret_key='jeffjeff',
7068
secure=False)
7169

72-
# Create new user
73-
os.system('mc admin user add myminio jeffjeff jeffjeff')
74-
# json for test policy for permissionless user
75-
testpolicy = {
76-
"Version": "2012-10-17",
77-
"Statement": [
78-
{
79-
"Action": [
80-
"s3:GetBucketLocation",
81-
"s3:ListBucket",
82-
"s3:ListBucketMultipartUploads",
83-
"s3:ListAllMyBuckets"
84-
],
85-
"Effect": "Allow",
86-
"Resource": [
87-
"arn:aws:s3:::datajoint.test",
88-
"arn:aws:s3:::datajoint.migrate"
89-
],
90-
"Sid": ""
91-
},
92-
{
93-
"Action": [
94-
"s3:GetObject",
95-
"s3:ListMultipartUploadParts"
96-
],
97-
"Effect": "Allow",
98-
"Resource": [
99-
"arn:aws:s3:::datajoint.test/*",
100-
"arn:aws:s3:::datajoint.migrate/*"
101-
],
102-
"Sid": ""
103-
}
104-
]
105-
}
106-
107-
# Write test json to tmp directory so we can use it to create a new user policy
108-
with open('/tmp/policy.json', 'w') as f:
109-
f.write(json.dumps(testpolicy))
110-
111-
# Add alias myminio
112-
os.system(
113-
'mc alias set myminio/ http://fakeservices.datajoint.io datajoint datajoint')
114-
115-
# Add the policy and apply it to the user
116-
os.system('mc admin policy add myminio test /tmp/policy.json')
117-
os.system('mc admin policy set myminio test user=jeffjeff')
118-
11970
# Insert some test data and remove it so that the external table is populated
12071
test = [1, [1, 2, 3]]
12172
SimpleRemote.insert1(test)
@@ -124,20 +75,16 @@ def test_remove_object_exception():
12475
# Save the old external table minio client
12576
old_client = schema.external['share'].s3.client
12677

127-
# Apply our new minio client to the external table that has permissions restrictions
78+
# Apply our new minio client which has a user that does not exist
12879
schema.external['share'].s3.client = minio_client
12980

13081
# This method returns a list of errors
13182
error_list = schema.external['share'].delete(delete_external_files=True,
13283
errors_as_string=False)
13384

13485
# Teardown
135-
os.system('mc admin policy remove myminio test')
136-
os.system('mc admin user remove myminio jeffjeff')
13786
schema.external['share'].s3.client = old_client
13887
schema.external['share'].delete(delete_external_files=True)
139-
os.remove("/tmp/policy.json")
140-
os.system('mc alias remove myminio/')
14188

14289
# Raise the error we want if the error matches the expected uuid
14390
if str(error_list[0][0]) == str(uuid_from_buffer(pack(test[1]))):

0 commit comments

Comments
 (0)