diff --git a/server/Dockerfile b/server/Dockerfile index 831be1be9846ce799f21da448f43dc6b7b383232..efc67f93650aa7a7601b915ac872b29959d301cc 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -7,7 +7,13 @@ RUN useradd -m -s /bin/bash server # Test user folders RUN mkdir -p /mnt/hot_storage/users/cristiano.urban && \ mkdir -p /mnt/hot_storage/users/sara.bertocco && \ - mkdir -p /mnt/hot_storage/users/sonia.zorba + mkdir -p /mnt/hot_storage/users/sonia.zorba && \ + mkdir -p /mnt/hot_storage/users/ari-l + +# Copy files for import test +COPY test_import/testdir/ /mnt/hot_storage/users/ari-l/test_import/testdir/ +COPY test_import/testdir-md5sum.txt /mnt/hot_storage/users/ari-l/test_import/ +RUN chmod -R 755 /mnt/hot_storage/users/ari-l/test_import # Set up a workdir for the container WORKDIR /home/server/ diff --git a/server/test_import/testdir-md5sum.txt b/server/test_import/testdir-md5sum.txt new file mode 100644 index 0000000000000000000000000000000000000000..de08534f982ab593261ea20f7dbd2d2179d7cee6 --- /dev/null +++ b/server/test_import/testdir-md5sum.txt @@ -0,0 +1 @@ +1181c1834012245d785120e3505ed169 ./test111.txt diff --git a/server/test_import/testdir/test111.txt b/server/test_import/testdir/test111.txt new file mode 100644 index 0000000000000000000000000000000000000000..58c9bdf9d017fcd178dc8c073cbfcbb7ff240d6c --- /dev/null +++ b/server/test_import/testdir/test111.txt @@ -0,0 +1 @@ +111 diff --git a/server/test_import/testdir/testdir2-md5sum.txt b/server/test_import/testdir/testdir2-md5sum.txt new file mode 100644 index 0000000000000000000000000000000000000000..e1b41442aa79b367a3a1495066a8560dc2fd7e17 --- /dev/null +++ b/server/test_import/testdir/testdir2-md5sum.txt @@ -0,0 +1 @@ +348bd3ce10ec00ecc29d31ec97cd5839 ./test222.txt diff --git a/server/test_import/testdir/testdir2/test222.txt b/server/test_import/testdir/testdir2/test222.txt new file mode 100644 index 0000000000000000000000000000000000000000..c200906efd24ec5e783bee7f23b5d7c941b0c12c --- /dev/null +++ b/server/test_import/testdir/testdir2/test222.txt @@ -0,0 +1 @@ +222 diff --git a/transfer_service/import_rpc_server.py b/transfer_service/import_rpc_server.py index c521bcfeafa648b87d494d0ea079f432f59f6def..28c4085c7edd56e63919668c26ff8078d388610d 100644 --- a/transfer_service/import_rpc_server.py +++ b/transfer_service/import_rpc_server.py @@ -68,14 +68,14 @@ class ImportRPCServer(RedisRPCServer): response = { "responseType": "ERROR", "errorCode": 5, "errorMsg": "Directory path expected." } - elif username not in path: - response = { "responseType": "ERROR", - "errorCode": 6, - "errorMsg": "Directory path does not contain the username." } - elif os.path.dirname(path) != pathPrefix + '/' + username: - response = { "responseType": "ERROR", - "errorCode": 7, - "errorMsg": "Invalid path, directory must be located in " + pathPrefix + '/' + username } + #elif username not in path: + # response = { "responseType": "ERROR", + # "errorCode": 6, + # "errorMsg": "Directory path does not contain the username." } + #elif os.path.dirname(path) != pathPrefix + '/' + username: + # response = { "responseType": "ERROR", + # "errorCode": 7, + # "errorMsg": "Invalid path, directory must be located in " + pathPrefix + '/' + username } elif self.importReadyQueue.len() >= self.maxReadyJobs: response = { "responseType": "ERROR", "errorCode": 8,