mirror of
https://github.com/versity/versitygw.git
synced 2026-01-05 03:24:04 +00:00
This moves the internal iam service from the posix backend so that we can start implementing new iam services right in the auth module. The internal iam service has same behavior as before, but now must be enabled with the --iam-dir cli option. New single user service is the default when no other iam service is selected. This just runs the gateway in single user mode with just the root account.
38 lines
802 B
Bash
Executable File
38 lines
802 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# make temp dirs
|
|
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
|
|
|