mirror of
https://github.com/versity/versitygw.git
synced 2026-01-05 11:24:52 +00:00
This builds on the previous work that sets up the body streaming for the put object and put part requests. This adds the auth and checksum readers to postpone the v4auth checks and the content checksum until the end of the body stream. This means that the backend with start reading the data from the body stream before the request is fully validated and signatures checked. So the backend must check the error returned from the body reader for the final auth and content checks. The backend is expected to discard the data upon error. This should increase performance and reduce memory utilization to no longer require caching the entire request body in memory for put object and put part.
39 lines
817 B
Bash
Executable File
39 lines
817 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# make temp dirs
|
|
rm -rf /tmp/gw
|
|
mkdir /tmp/gw
|
|
rm -rf /tmp/covdata
|
|
mkdir /tmp/covdata
|
|
|
|
# run server in background
|
|
GOCOVERDIR=/tmp/covdata ./versitygw -a user -s pass --iam-dir /tmp/gw posix /tmp/gw &
|
|
GW_PID=$!
|
|
|
|
# wait a second for server to start up
|
|
sleep 1
|
|
|
|
# check if server is still running
|
|
if ! kill -0 $GW_PID; then
|
|
echo "server no longer running"
|
|
exit 1
|
|
fi
|
|
|
|
# run tests
|
|
if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow; then
|
|
echo "tests failed"
|
|
kill $GW_PID
|
|
exit 1
|
|
fi
|
|
|
|
# kill off server
|
|
kill $GW_PID
|
|
exit 0
|
|
|
|
# if the above binary was built with -cover enabled (make testbin),
|
|
# then the following can be used for code coverage reports:
|
|
# go tool covdata percent -i=/tmp/covdata
|
|
# go tool covdata textfmt -i=/tmp/covdata -o profile.txt
|
|
# go tool cover -html=profile.txt
|
|
|