added host and port in tests
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 18s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 18s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 13s
This commit is contained in:
1 parent
f168360cee
commit
c1839acbd2
1 file changed
+41
-39
@@ -7,6 +7,8 @@ GREEN="\033[0;32m"
|
|||||||
RED="\033[0;31m"
|
RED="\033[0;31m"
|
||||||
YELLOW="\033[1;33m"
|
YELLOW="\033[1;33m"
|
||||||
CYAN="\033[0;36m"
|
CYAN="\033[0;36m"
|
||||||
|
HOST="localhost"
|
||||||
|
PORT="8222"
|
||||||
|
|
||||||
./auth_service &> auth_service.log &
|
./auth_service &> auth_service.log &
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
@@ -19,7 +21,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"username":"tola","password":"e0c7bfa5b8e4ae0cecfc1f14093a71e05c27abd93a3850fc35f008c3baf866b4"}' \
|
-d '{"username":"tola","password":"e0c7bfa5b8e4ae0cecfc1f14093a71e05c27abd93a3850fc35f008c3baf866b4"}' \
|
||||||
localhost:8222/api/token &> api_token_test.log
|
$HOST:$PORT/api/token &> api_token_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_test.log)
|
res=$(cat api_token_test.log)
|
||||||
if [[ "$res" == *"token"* ]]; then
|
if [[ "$res" == *"token"* ]]; then
|
||||||
@@ -36,7 +38,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"username":"tola","password":"288"}' \
|
-d '{"username":"tola","password":"288"}' \
|
||||||
localhost:8222/api/token &> api_token_wrong_password_test.log
|
$HOST:$PORT/api/token &> api_token_wrong_password_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_wrong_password_test.log)
|
res=$(cat api_token_wrong_password_test.log)
|
||||||
if [[ "$res" == *"{\"error\":\"wrong password\"}"* ]]; then
|
if [[ "$res" == *"{\"error\":\"wrong password\"}"* ]]; then
|
||||||
@@ -53,7 +55,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"username":"toa","password":"2808"}' \
|
-d '{"username":"toa","password":"2808"}' \
|
||||||
localhost:8222/api/token &> api_token_wrong_username_test.log
|
$HOST:$PORT/api/token &> api_token_wrong_username_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_wrong_username_test.log)
|
res=$(cat api_token_wrong_username_test.log)
|
||||||
if [[ "$res" == *"{\"error\":\"couldn't find user\"}"* ]]; then
|
if [[ "$res" == *"{\"error\":\"couldn't find user\"}"* ]]; then
|
||||||
@@ -70,7 +72,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/token &> api_token_no_data_test.log
|
$HOST:$PORT/api/token &> api_token_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_no_data_test.log)
|
res=$(cat api_token_no_data_test.log)
|
||||||
if [[ "$res" == *"{\"error\":\"must have username and password\"}"* ]]; then
|
if [[ "$res" == *"{\"error\":\"must have username and password\"}"* ]]; then
|
||||||
@@ -87,7 +89,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{{asdf}}}asdfasdfasdf""asdf' \
|
-d '{{asdf}}}asdfasdfasdf""asdf' \
|
||||||
localhost:8222/api/token &> api_token_not_valid_json_test.log
|
$HOST:$PORT/api/token &> api_token_not_valid_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_not_valid_json_test.log)
|
res=$(cat api_token_not_valid_json_test.log)
|
||||||
if [[ "$res" == *"error"* ]]; then
|
if [[ "$res" == *"error"* ]]; then
|
||||||
@@ -104,7 +106,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d $(cat api_token_test.log) \
|
-d $(cat api_token_test.log) \
|
||||||
localhost:8222/api/token/verify &> api_token_verify_test.log
|
$HOST:$PORT/api/token/verify &> api_token_verify_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_verify_test.log)
|
res=$(cat api_token_verify_test.log)
|
||||||
if [[ "$res" == *'{"valid":true}'* ]]; then
|
if [[ "$res" == *'{"valid":true}'* ]]; then
|
||||||
@@ -121,7 +123,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/token/verify &> api_token_verify_no_data_test.log
|
$HOST:$PORT/api/token/verify &> api_token_verify_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_verify_no_data_test.log)
|
res=$(cat api_token_verify_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
||||||
@@ -138,7 +140,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"token":"asdf"}' \
|
-d '{"token":"asdf"}' \
|
||||||
localhost:8222/api/token/verify &> api_token_verify_wrong_token_test.log
|
$HOST:$PORT/api/token/verify &> api_token_verify_wrong_token_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_verify_wrong_token_test.log)
|
res=$(cat api_token_verify_wrong_token_test.log)
|
||||||
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
||||||
@@ -155,7 +157,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d 'asdf[apsdfqopwjf[9qfm93qq89n]]' \
|
-d 'asdf[apsdfqopwjf[9qfm93qq89n]]' \
|
||||||
localhost:8222/api/token/verify &> api_token_verify_wrong_json_test.log
|
$HOST:$PORT/api/token/verify &> api_token_verify_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_token_verify_wrong_json_test.log)
|
res=$(cat api_token_verify_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -172,7 +174,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d $(cat api_token_test.log) \
|
-d $(cat api_token_test.log) \
|
||||||
localhost:8222/api/users &> api_users_test.log
|
$HOST:$PORT/api/users &> api_users_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_test.log)
|
res=$(cat api_users_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -189,7 +191,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"token":"asdf"}' \
|
-d '{"token":"asdf"}' \
|
||||||
localhost:8222/api/users &> api_users_wrong_token_test.log
|
$HOST:$PORT/api/users &> api_users_wrong_token_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_wrong_token_test.log)
|
res=$(cat api_users_wrong_token_test.log)
|
||||||
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
||||||
@@ -206,7 +208,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/users &> api_users_no_data_test.log
|
$HOST:$PORT/api/users &> api_users_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_no_data_test.log)
|
res=$(cat api_users_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
||||||
@@ -223,7 +225,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d 'ahsdlfhjalighafina[a[][apofj OFFW[Efflja]]]' \
|
-d 'ahsdlfhjalighafina[a[][apofj OFFW[Efflja]]]' \
|
||||||
localhost:8222/api/users &> api_users_wrong_json_test.log
|
$HOST:$PORT/api/users &> api_users_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_wrong_json_test.log)
|
res=$(cat api_users_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -240,7 +242,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d $(cat api_token_test.log) \
|
-d $(cat api_token_test.log) \
|
||||||
localhost:8222/api/users/user &> api_users_user_test.log
|
$HOST:$PORT/api/users/user &> api_users_user_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_user_test.log)
|
res=$(cat api_users_user_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -257,7 +259,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"token":"asdf"}' \
|
-d '{"token":"asdf"}' \
|
||||||
localhost:8222/api/users/user &> api_users_user_wrong_token_test.log
|
$HOST:$PORT/api/users/user &> api_users_user_wrong_token_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_user_wrong_token_test.log)
|
res=$(cat api_users_user_wrong_token_test.log)
|
||||||
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
||||||
@@ -274,7 +276,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/users/user &> api_users_user_no_data_test.log
|
$HOST:$PORT/api/users/user &> api_users_user_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_user_no_data_test.log)
|
res=$(cat api_users_user_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
||||||
@@ -291,7 +293,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d 'alskodjfqjvoq3vn[q90\audv0q j89fvn 2vp]' \
|
-d 'alskodjfqjvoq3vn[q90\audv0q j89fvn 2vp]' \
|
||||||
localhost:8222/api/users/user &> api_users_user_wrong_json_test.log
|
$HOST:$PORT/api/users/user &> api_users_user_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_user_wrong_json_test.log)
|
res=$(cat api_users_user_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -315,7 +317,7 @@ curl \
|
|||||||
"is_superuser":false,
|
"is_superuser":false,
|
||||||
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IDEsInVzZXJuYW1lIjogInRvbGEiLCJlbWFpbCI6ICJtYWlsQGV4YW1wbGUuY29tIiwiZ3JvdXAiOiAicm9vdCIsImlzX3N1cGVydXNlciI6IHRydWV9.QGUnCWPmp5hWAtGFTGDMw2SugZqLsYfMboeFU4UQLXQ"
|
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IDEsInVzZXJuYW1lIjogInRvbGEiLCJlbWFpbCI6ICJtYWlsQGV4YW1wbGUuY29tIiwiZ3JvdXAiOiAicm9vdCIsImlzX3N1cGVydXNlciI6IHRydWV9.QGUnCWPmp5hWAtGFTGDMw2SugZqLsYfMboeFU4UQLXQ"
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/users/add &> api_users_add_test.log
|
$HOST:$PORT/api/users/add &> api_users_add_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_add_test.log)
|
res=$(cat api_users_add_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -332,13 +334,13 @@ reqdata=$(curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '{"username":"asdff","password":"asdf"}' \
|
-d '{"username":"asdff","password":"asdf"}' \
|
||||||
localhost:8222/api/token)
|
$HOST:$PORT/api/token)
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
curl \
|
curl \
|
||||||
--silent \
|
--silent \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
-d $reqdata \
|
-d $reqdata \
|
||||||
localhost:8222/api/users &> delete_api_users_test.log
|
$HOST:$PORT/api/users &> delete_api_users_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat delete_api_users_test.log)
|
res=$(cat delete_api_users_test.log)
|
||||||
if [[ "$res" == *'{"success": true}'* ]]; then
|
if [[ "$res" == *'{"success": true}'* ]]; then
|
||||||
@@ -356,7 +358,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
-d $reqdata \
|
-d $reqdata \
|
||||||
localhost:8222/api/users &> delete_api_users_second_delete_test.log
|
$HOST:$PORT/api/users &> delete_api_users_second_delete_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat delete_api_users_second_delete_test.log)
|
res=$(cat delete_api_users_second_delete_test.log)
|
||||||
if [[ "$res" == *'{"success": false}'* ]]; then
|
if [[ "$res" == *'{"success": false}'* ]]; then
|
||||||
@@ -373,7 +375,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
-d '$reqdata' \
|
-d '$reqdata' \
|
||||||
localhost:8222/api/users &> delete_api_users_wrong_json_test.log
|
$HOST:$PORT/api/users &> delete_api_users_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat delete_api_users_wrong_json_test.log)
|
res=$(cat delete_api_users_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -390,7 +392,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
-d '{"token":"asdf"}' \
|
-d '{"token":"asdf"}' \
|
||||||
localhost:8222/api/users &> delete_api_users_wrong_token_test.log
|
$HOST:$PORT/api/users &> delete_api_users_wrong_token_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat delete_api_users_wrong_token_test.log)
|
res=$(cat delete_api_users_wrong_token_test.log)
|
||||||
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
if [[ "$res" == *'{"error":"invalid token"}'* ]]; then
|
||||||
@@ -407,7 +409,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/users &> delete_api_users_no_data_test.log
|
$HOST:$PORT/api/users &> delete_api_users_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat delete_api_users_no_data_test.log)
|
res=$(cat delete_api_users_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token"}'* ]]; then
|
||||||
@@ -425,7 +427,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d "{\"old_password\":\"e0c7bfa5b8e4ae0cecfc1f14093a71e05c27abd93a3850fc35f008c3baf866b4\",\"new_password\":\"1234\",$reqtoken}" \
|
-d "{\"old_password\":\"e0c7bfa5b8e4ae0cecfc1f14093a71e05c27abd93a3850fc35f008c3baf866b4\",\"new_password\":\"1234\",$reqtoken}" \
|
||||||
localhost:8222/api/users/password &> api_users_password_test.log
|
$HOST:$PORT/api/users/password &> api_users_password_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_password_test.log)
|
res=$(cat api_users_password_test.log)
|
||||||
if [[ "$res" == *'{"success": true}'* ]]; then
|
if [[ "$res" == *'{"success": true}'* ]]; then
|
||||||
@@ -442,7 +444,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d "" \
|
-d "" \
|
||||||
localhost:8222/api/users/password &> api_users_password_no_data_test.log
|
$HOST:$PORT/api/users/password &> api_users_password_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_password_no_data_test.log)
|
res=$(cat api_users_password_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token, old_password, new_password"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token, old_password, new_password"}'* ]]; then
|
||||||
@@ -459,7 +461,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d "ijansd fu9q303ghq9" \
|
-d "ijansd fu9q303ghq9" \
|
||||||
localhost:8222/api/users/password &> api_users_password_wrong_json_test.log
|
$HOST:$PORT/api/users/password &> api_users_password_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_users_password_wrong_json_test.log)
|
res=$(cat api_users_password_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -482,7 +484,7 @@ curl \
|
|||||||
\"group\":\"admin\",
|
\"group\":\"admin\",
|
||||||
\"is_superuser\":true,
|
\"is_superuser\":true,
|
||||||
$reqtoken}" \
|
$reqtoken}" \
|
||||||
localhost:8222/api/users &> put_api_users_test.log
|
$HOST:$PORT/api/users &> put_api_users_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat put_api_users_test.log)
|
res=$(cat put_api_users_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -499,7 +501,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X PUT \
|
-X PUT \
|
||||||
-d "" \
|
-d "" \
|
||||||
localhost:8222/api/users &> put_api_users_no_data_test.log
|
$HOST:$PORT/api/users &> put_api_users_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat put_api_users_no_data_test.log)
|
res=$(cat put_api_users_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have token, new_user_data"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have token, new_user_data"}'* ]]; then
|
||||||
@@ -516,7 +518,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X PUT \
|
-X PUT \
|
||||||
-d "hiusdf 7qyt0 y qy40" \
|
-d "hiusdf 7qyt0 y qy40" \
|
||||||
localhost:8222/api/users &> put_api_users_wrong_json_test.log
|
$HOST:$PORT/api/users &> put_api_users_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat put_api_users_wrong_json_test.log)
|
res=$(cat put_api_users_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -539,7 +541,7 @@ curl \
|
|||||||
"group":"users",
|
"group":"users",
|
||||||
"is_superuser":false
|
"is_superuser":false
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_test.log
|
$HOST:$PORT/api/register &> api_register_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_test.log)
|
res=$(cat api_register_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -561,7 +563,7 @@ curl \
|
|||||||
"group":"users",
|
"group":"users",
|
||||||
"is_superuser":false
|
"is_superuser":false
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_without_username_test.log
|
$HOST:$PORT/api/register &> api_register_without_username_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_without_username_test.log)
|
res=$(cat api_register_without_username_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
||||||
@@ -583,7 +585,7 @@ curl \
|
|||||||
"group":"users",
|
"group":"users",
|
||||||
"is_superuser":false
|
"is_superuser":false
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_without_email_test.log
|
$HOST:$PORT/api/register &> api_register_without_email_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_without_email_test.log)
|
res=$(cat api_register_without_email_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
||||||
@@ -605,7 +607,7 @@ curl \
|
|||||||
"group":"users",
|
"group":"users",
|
||||||
"is_superuser":false
|
"is_superuser":false
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_without_password_test.log
|
$HOST:$PORT/api/register &> api_register_without_password_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_without_password_test.log)
|
res=$(cat api_register_without_password_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
||||||
@@ -627,7 +629,7 @@ curl \
|
|||||||
"password":"qwer",
|
"password":"qwer",
|
||||||
"is_superuser":false
|
"is_superuser":false
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_without_group_test.log
|
$HOST:$PORT/api/register &> api_register_without_group_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_without_group_test.log)
|
res=$(cat api_register_without_group_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -649,7 +651,7 @@ curl \
|
|||||||
"password":"zxcv",
|
"password":"zxcv",
|
||||||
"group":"users"
|
"group":"users"
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_without_is_superuser_test.log
|
$HOST:$PORT/api/register &> api_register_without_is_superuser_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_without_is_superuser_test.log)
|
res=$(cat api_register_without_is_superuser_test.log)
|
||||||
if [[ "$res" == *'username'* ]]; then
|
if [[ "$res" == *'username'* ]]; then
|
||||||
@@ -671,7 +673,7 @@ curl \
|
|||||||
"password":"zxcv",
|
"password":"zxcv",
|
||||||
"group":"users"
|
"group":"users"
|
||||||
}' \
|
}' \
|
||||||
localhost:8222/api/register &> api_register_second_register_test.log
|
$HOST:$PORT/api/register &> api_register_second_register_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_second_register_test.log)
|
res=$(cat api_register_second_register_test.log)
|
||||||
if [[ "$res" == *'{"error":"failed to create user"}'* ]]; then
|
if [[ "$res" == *'{"error":"failed to create user"}'* ]]; then
|
||||||
@@ -688,7 +690,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d 'najsnvpnvq234890vn9qq234vqui3v' \
|
-d 'najsnvpnvq234890vn9qq234vqui3v' \
|
||||||
localhost:8222/api/register &> api_register_wrong_json_test.log
|
$HOST:$PORT/api/register &> api_register_wrong_json_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_wrong_json_test.log)
|
res=$(cat api_register_wrong_json_test.log)
|
||||||
if [[ "$res" == *'error'* ]]; then
|
if [[ "$res" == *'error'* ]]; then
|
||||||
@@ -705,7 +707,7 @@ curl \
|
|||||||
--silent \
|
--silent \
|
||||||
-X POST \
|
-X POST \
|
||||||
-d '' \
|
-d '' \
|
||||||
localhost:8222/api/register &> api_register_no_data_test.log
|
$HOST:$PORT/api/register &> api_register_no_data_test.log
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
res=$(cat api_register_no_data_test.log)
|
res=$(cat api_register_no_data_test.log)
|
||||||
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
if [[ "$res" == *'{"error":"must have <username>, <password>, <email>, <group, optional>, <is_superuser, optional>"}'* ]]; then
|
||||||
|
|||||||
Reference in new issue
Block a user