Closed jordanhendricks closed 7 years ago
After some discussion on jabber, we've decided it's best to do this feature detection in the client. See #320.
CR at https://cr.joyent.us/#/c/2417/.
Testing Notes I ran the node-manta test suite against a deployment with MPU not enabled, as well as one without MPU enabled.
Here is the output from the tests when MPU is not enabled:
$ make test
npm install
unset MANTA_DEFAULT_CONTENT_TYPE; \
if [[ -z "" ]]; then \
./node_modules/.bin/nodeunit test/*.test.js; \
else \
echo "# Running subset of tests matching TEST_FILTER="; \
./node_modules/.bin/nodeunit test/client.test.js test/completion.test.js test/mfind.test.js test/mget.test.js test/mjob-simple.test.js test/mmpu.test.js test/mput.test.js test/muntar.test.js test/trackmarker.test.js test/utils.test.js; \
fi
client.test.js
✔ mkdir
✔ mkdir (sub)
✔ put
✔ #231: put (special characters)
✔ #231: ls (special characters)
✔ #231: get (special characters)
✔ #231: rm (special characters)
✔ chattr
✔ put (zero byte streaming)
✔ put without mkdirp
✔ put with mkdirp
✔ streams
✔ put MD5 mismatch
✔ GH-72 content-length: undefined
✔ ls
✔ createListStream
✔ createListStream (dir only)
✔ createListStream (object only)
✔ ln
✔ info (link)
✔ ftw
✔ create job (simple grep)
✔ get job
✔ add input keys
✔ get job input
✔ end job
✔ wait for job
✔ get job output
✔ create and cancel job
✔ unlink object
✔ unlink link
✔ rmr
✔ mkdirp/rmr
WARNING: skipping test "create upload": multipart upload is not enabled on this Manta deployment
✔ create upload
WARNING: skipping test "upload part": multipart upload is not enabled on this Manta deployment
✔ upload part
WARNING: skipping test "get upload": multipart upload is not enabled on this Manta deployment
✔ get upload
WARNING: skipping test "commit upload": multipart upload is not enabled on this Manta deployment
✔ commit upload
WARNING: skipping test "abort upload": multipart upload is not enabled on this Manta deployment
✔ abort upload
WARNING: skipping test: "#311: create upload with special headers": multipart upload is not enabled on this Manta deployment
✔ #311: create upload with special headers
✔ GH-196 getPath ~~/
✔ #180: Invalid key results in no client error
✔ MANTA-2812 null signer
✔ MANTA-2812 undefined signer
completion.test.js
✔ mchattr --completion
✔ mchmod --completion
✔ mfind --completion
✔ mget --completion
✔ minfo --completion
✔ mjob --completion
✔ mln --completion
✔ mlogin --completion
✔ mls --completion
✔ mmd5 --completion
✔ mmkdir --completion
✔ mmpu --completion
✔ mput --completion
✔ mrm --completion
✔ mrmdir --completion
Connection to cr.joyent.us closed by remote host.
✔ msign --completion
✔ muntar --completion
mfind.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mfind-d4c22156
✔ check if operator (mfind forbidden)
✔ mfind TESTDIR
✔ mfind -j TESTDIR
✔ mfind TESTDIR/afile.txt
✔ mfind TESTDIR/notafile.txt
✔ mfind TESTDIR/notafile.txt TESTDIR/afile.txt
WARNING: skipping mfind forbidden test: user is an operator
✔ mfind /poseidon/stor TESTDIR/afile.txt
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mfind-d4c22156
mget.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mget-92260d99
✔ mget TESTDIR/02.data
✔ mget TESTDIR/01.data TESTDIR/02.data TESTDIR/03.data
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mget-92260d99
mjob-simple.test.js
✔ mjob create --close -or "echo hello"
mmpu.test.js
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu create C_OBJ_PATH -c 1 -H m-custom-header:foo -s TEXT_SIZE -m TEXT_MD5
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu get C_ID
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu create A_OBJ_PATH -c 1 -s TEXT_SIZE -m TEXT_MD5-H durability-level 3 -H content-length:10 -H content-md5:foo
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu get A_IDJ
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts C_ID: pre-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts A_ID: pre-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu upload C_ID 0 -f tmpFile
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu upload A_ID 0
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts C_ID: post-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts A_ID: post-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list -p
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list: post part upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu commit C_ID C_ETAG0
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu abort A_ID
mput.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mput-fc517da8
✔ mput with custom header value with colons
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mput-fc517da8
✔ cleanup: rm tmp directory /var/folders/c7/c5brblnd3l93659s9gkbxfbm0000gp/T/
muntar.test.js
✔ muntar case 0: corpus/tar1.tar
trackmarker.test.js
✔ pages by name
✔ pages by mtime
utils.test.js
✔ escapePath encoding
OK: 315 assertions (34832ms)
Here is the output from the tests when MPU is enabled:
$ make test
npm install
unset MANTA_DEFAULT_CONTENT_TYPE; \
if [[ -z "" ]]; then \
./node_modules/.bin/nodeunit test/*.test.js; \
else \
echo "# Running subset of tests matching TEST_FILTER="; \
./node_modules/.bin/nodeunit test/client.test.js test/completion.test.js test/mfind.test.js test/mget.test.js test/mjob-simple.test.js test/mmpu.test.js test/mput.test.js test/muntar.test.js test/trackmarker.test.js test/utils.test.js; \
fi
client.test.js
✔ mkdir
✔ mkdir (sub)
✔ put
✔ #231: put (special characters)
✔ #231: ls (special characters)
✔ #231: get (special characters)
✔ #231: rm (special characters)
✔ chattr
✔ put (zero byte streaming)
✔ put without mkdirp
✔ put with mkdirp
✔ streams
✔ put MD5 mismatch
✔ GH-72 content-length: undefined
✔ ls
✔ createListStream
✔ createListStream (dir only)
✔ createListStream (object only)
✔ ln
✔ info (link)
✔ ftw
✔ create job (simple grep)
✔ get job
✔ add input keys
✔ get job input
✔ end job
✔ wait for job
✔ get job output
✔ create and cancel job
✔ unlink object
✔ unlink link
✔ rmr
✔ mkdirp/rmr
✔ create upload
✔ upload part
✔ get upload
✔ commit upload
✔ abort upload
✔ #311: create upload with special headers
✔ GH-196 getPath ~~/
✔ #180: Invalid key results in no client error
✔ MANTA-2812 null signer
✔ MANTA-2812 undefined signer
completion.test.js
✔ mchattr --completion
✔ mchmod --completion
✔ mfind --completion
✔ mget --completion
✔ minfo --completion
✔ mjob --completion
✔ mln --completion
✔ mlogin --completion
✔ mls --completion
✔ mmd5 --completion
✔ mmkdir --completion
✔ mmpu --completion
✔ mput --completion
✔ mrm --completion
✔ mrmdir --completion
✔ msign --completion
✔ muntar --completion
mfind.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mfind-e37aa9c8
✔ check if operator (mfind forbidden)
✔ mfind TESTDIR
✔ mfind -j TESTDIR
✔ mfind TESTDIR/afile.txt
✔ mfind TESTDIR/notafile.txt
✔ mfind TESTDIR/notafile.txt TESTDIR/afile.txt
WARNING: skipping mfind forbidden test: user is an operator
✔ mfind /poseidon/stor TESTDIR/afile.txt
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mfind-e37aa9c8
mget.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mget-1859dcb3
✔ mget TESTDIR/02.data
✔ mget TESTDIR/01.data TESTDIR/02.data TESTDIR/03.data
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mget-1859dcb3
mjob-simple.test.js
✔ mjob create --close -or "echo hello"
mmpu.test.js
✔ mmpu create C_OBJ_PATH -c 1 -H m-custom-header:foo -s TEXT_SIZE -m TEXT_MD5
✔ mmpu get C_ID
✔ mmpu create A_OBJ_PATH -c 1 -s TEXT_SIZE -m TEXT_MD5-H durability-level 3 -H content-length:10 -H content-md5:foo
✔ mmpu get A_IDJ
✔ mmpu parts C_ID: pre-upload
✔ mmpu parts A_ID: pre-upload
✔ mmpu list
✔ mmpu upload C_ID 0 -f tmpFile
✔ mmpu upload A_ID 0
✔ mmpu parts C_ID: post-upload
✔ mmpu parts A_ID: post-upload
✔ mmpu list -p
✔ mmpu list: post part upload
✔ mmpu commit C_ID C_ETAG0
✔ mmpu abort A_ID
mput.test.js
✔ setup: create test tree at /jhendricks/stor/node-manta-test-mput-e7e94c81
✔ mput with custom header value with colons
✔ cleanup: rm test tree /jhendricks/stor/node-manta-test-mput-e7e94c81
✔ cleanup: rm tmp directory /var/folders/c7/c5brblnd3l93659s9gkbxfbm0000gp/T/
muntar.test.js
✔ muntar case 0: corpus/tar1.tar
trackmarker.test.js
✔ pages by name
✔ pages by mtime
utils.test.js
✔ escapePath encoding
OK: 404 assertions (44608ms)
A new MPU test was added in a commit integrated before this change. As such, I have rebased this change and updated the MPU test (reflected in patchset 9 on the Gerrit CR).
I have re-run the test suite against a Manta both with and without MPU enabled. The test run against an MPU-enabled deployment passed. The test suite against a Manta without MPU passed except for the MPU tests, which skipped successfully.
Here is the MPU-related portion of the output from the test run against a non-MPU enabled Manta (note the addition of the "errant commit upload returns undefined res" test to the client tests):
...
client.test.js
✔ mkdir
✔ mkdir (sub)
✔ put
✔ #231: put (special characters)
✔ #231: ls (special characters)
✔ #231: get (special characters)
✔ #231: rm (special characters)
✔ chattr
✔ put (zero byte streaming)
✔ put without mkdirp
✔ put with mkdirp
✔ streams
✔ put MD5 mismatch
✔ GH-72 content-length: undefined
✔ ls
✔ createListStream
✔ createListStream (dir only)
✔ createListStream (object only)
✔ ln
✔ info (link)
✔ ftw
✔ create job (simple grep)
✔ get job
✔ add input keys
✔ get job input
✔ end job
✔ wait for job
✔ get job output
✔ create and cancel job
✔ unlink object
✔ unlink link
✔ rmr
✔ mkdirp/rmr
WARNING: skipping test "create upload": multipart upload is not enabled on this Manta deployment
✔ create upload
WARNING: skipping test "upload part": multipart upload is not enabled on this Manta deployment
✔ upload part
WARNING: skipping test "get upload": multipart upload is not enabled on this Manta deployment
✔ get upload
WARNING: skipping test "commit upload": multipart upload is not enabled on this Manta deployment
✔ commit upload
WARNING: skipping test "commit upload": multipart upload is not enabled on this Manta deployment
✔ errant commit upload returns undefined res
WARNING: skipping test "abort upload": multipart upload is not enabled on this Manta deployment
✔ abort upload
WARNING: skipping test: "#311: create upload with special headers": multipart upload is not enabled on this Manta deployment
✔ #311: create upload with special headers
✔ GH-196 getPath ~~/
✔ #180: Invalid key results in no client error
✔ MANTA-2812 null signer
✔ MANTA-2812 undefined signer
...
mmpu.test.js
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu create C_OBJ_PATH -c 1 -H m-custom-header:foo -s TEXT_SIZE -m TEXT_MD5
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu get C_ID
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu create A_OBJ_PATH -c 1 -s TEXT_SIZE -m TEXT_MD5-H durability-level 3 -H content-length:10 -H content-md5:foo
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu get A_IDJ
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts C_ID: pre-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts A_ID: pre-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu upload C_ID 0 -f tmpFile
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu upload A_ID 0
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts C_ID: post-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu parts A_ID: post-upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list -p
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu list: post part upload
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu commit C_ID C_ETAG0
WARNING: skipping test: multipart upload is not enabled on this Manta deployment
✔ mmpu abort A_ID
...
If you run the MPU-related tests (
mmpu
and client method tests), you will fail a bunch of the test suite.For reference, here is what the test output looks like if run against a Manta without MPU enabled:
The test suite can detect whether MPU is supported by checking for the existence of the top-level "uploads" directory. If that directory isn't there, MPU tests should be skipped and print a warning message for the user that these tests were not run.