mirror of
https://github.com/Mailu/Mailu.git
synced 2025-03-05 14:55:20 +02:00
Use the correct hostname
This commit is contained in:
parent
18d5fb8a1b
commit
acb878a43f
@ -58,7 +58,7 @@ echo "Retrieved all domains successfully"
|
||||
|
||||
# try create dkim keys
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/domain/mailu2.io/dkim' \
|
||||
'https://localhost/api/v1/domain/mailu2.io/dkim' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-d '' \
|
||||
@ -83,7 +83,7 @@ echo "Domain mailu2.io was deleted successfully"
|
||||
|
||||
# try looking up all users of a domain. There should be 2 users.
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/domain/mailu.io/users' \
|
||||
'https://localhost/api/v1/domain/mailu.io/users' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o "email" | grep -c "email" | grep 2
|
||||
@ -98,7 +98,7 @@ echo "Retrieved all users of domain mailu.io successfully"
|
||||
|
||||
#try to create an alternative
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/alternative' \
|
||||
'https://localhost/api/v1/alternative' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -126,7 +126,7 @@ echo "Retrieved all alternatives successfully"
|
||||
|
||||
# try to check if an alternative exists
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/alternative/mailu2.io' \
|
||||
'https://localhost/api/v1/alternative/mailu2.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep '{"name": "mailu2.io", "domain": "mailu.io"}'
|
||||
@ -138,7 +138,7 @@ echo "Lookup for alternative mailu2.io was successful"
|
||||
|
||||
# try to delete an alternative
|
||||
curl --silent --insecure -X 'DELETE' \
|
||||
'https://mailutest/api/v1/alternative/mailu2.io' \
|
||||
'https://localhost/api/v1/alternative/mailu2.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest'
|
||||
|
||||
|
@ -2,7 +2,7 @@ echo "start token tests"
|
||||
|
||||
# Try creating a token /token
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/token' \
|
||||
'https://localhost/api/v1/token' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -21,7 +21,7 @@ echo "created a token for user@mailu.io successfully"
|
||||
|
||||
# Try create a token for a specific user /tokenuser/{email}
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/tokenuser/user%40mailu.io' \
|
||||
'https://localhost/api/v1/tokenuser/user%40mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -35,7 +35,7 @@ echo "created a second token for user@mailu.io successfully"
|
||||
|
||||
# Try retrieving all tokens /token. We expect to retrieve 2 in total.
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/token' \
|
||||
'https://localhost/api/v1/token' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o "id" | grep -c "id" | grep 2
|
||||
@ -46,7 +46,7 @@ echo "Retrieved all tokens (2 in total) successfully"
|
||||
|
||||
# Try finding a specific token /token/{token_id}
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/token/2' \
|
||||
'https://localhost/api/v1/token/2' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep '"id": 2'
|
||||
@ -57,7 +57,7 @@ echo "Retrieved token with id 2 successfully"
|
||||
|
||||
# Try deleting a token /token/{token_id}
|
||||
curl --silent --insecure -X 'DELETE' \
|
||||
'https://mailutest/api/v1/token/1' \
|
||||
'https://localhost/api/v1/token/1' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep 200
|
||||
@ -68,7 +68,7 @@ echo "Deleted token with id 1 successfully"
|
||||
|
||||
# Try updating a token /token/{token_id}
|
||||
curl --silent --insecure -X 'PATCH' \
|
||||
'https://mailutest/api/v1/token/2' \
|
||||
'https://localhost/api/v1/token/2' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -84,7 +84,7 @@ fi
|
||||
echo "Updated token with id 2 successfully"
|
||||
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/token/2' \
|
||||
'https://localhost/api/v1/token/2' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep 'comment": "updated_comment"'
|
||||
@ -95,7 +95,7 @@ echo "Confirmed that comment field of token with id 2 was correctly updated"
|
||||
|
||||
# Try looking up all tokens of a specific user /tokenuser/{email}
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/tokenuser/user%40mailu.io' \
|
||||
'https://localhost/api/v1/tokenuser/user%40mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o "id" | grep -c "id" | grep 1
|
||||
|
@ -2,7 +2,7 @@ echo "Start 04_test_relay_interfaces.sh"
|
||||
|
||||
# Try creating a new relay /relay
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/relay' \
|
||||
'https://localhost/api/v1/relay' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -17,7 +17,7 @@ fi
|
||||
echo "created a relay for domain relay1.mailu.io successfully"
|
||||
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/relay' \
|
||||
'https://localhost/api/v1/relay' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -32,7 +32,7 @@ echo "created a relay for domain relay2.mailu.io successfully"
|
||||
|
||||
# Try retrieving all relays /relay. We expect to retrieve 2 in total
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/relay' \
|
||||
'https://localhost/api/v1/relay' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o '"name":' | grep -c '"name":' | grep 2
|
||||
@ -43,7 +43,7 @@ echo "Retrieved all relays (2 in total) successfully"
|
||||
|
||||
# Try looking up a specific relay /relay/{name}
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/relay/relay1.mailu.io' \
|
||||
'https://localhost/api/v1/relay/relay1.mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep '"name": "relay1.mailu.io"'
|
||||
@ -54,7 +54,7 @@ echo "Retrieved the specified relay (relay1.mailu.io) successfully"
|
||||
|
||||
# Try deleting a specific relay /relay/{name}
|
||||
curl -silent --insecure -X 'DELETE' \
|
||||
'https://mailutest/api/v1/relay/relay2.mailu.io' \
|
||||
'https://localhost/api/v1/relay/relay2.mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep 200
|
||||
@ -64,7 +64,7 @@ fi
|
||||
echo "Deleted relay2.mailu.io successfully"
|
||||
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/relay' \
|
||||
'https://localhost/api/v1/relay' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o '"name":' | grep -c '"name":' | grep 1
|
||||
@ -75,7 +75,7 @@ echo "confirmed we only have 1 relay now"
|
||||
|
||||
# Try updating a specific relay /relay/{name}
|
||||
curl --silent --insecure -X 'PATCH' \
|
||||
'https://mailutest/api/v1/relay/relay1.mailu.io' \
|
||||
'https://localhost/api/v1/relay/relay1.mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -89,7 +89,7 @@ fi
|
||||
echo "update of relay was succcessful"
|
||||
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/relay/relay1.mailu.io' \
|
||||
'https://localhost/api/v1/relay/relay1.mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep anotherName | grep updated_comment
|
||||
|
@ -4,7 +4,7 @@ echo "Start 05_test_alias_interfaces.sh"
|
||||
|
||||
# Try creating a new alias /alias
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/alias' \
|
||||
'https://localhost/api/v1/alias' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -23,7 +23,7 @@ fi
|
||||
echo "Created alias test@mailu.io succcessfully for user@mailu.io and admin@mailu.io"
|
||||
|
||||
curl --silent --insecure -X 'POST' \
|
||||
'https://mailutest/api/v1/alias' \
|
||||
'https://localhost/api/v1/alias' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -42,7 +42,7 @@ echo "Created alias test2@mailu.io succcessfully for user@mailu.io "
|
||||
|
||||
# Try retrieving all aliases /alias. We expect to retrieve 2
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/alias' \
|
||||
'https://localhost/api/v1/alias' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o '"destination":' | grep -c '"destination":' | grep 2
|
||||
@ -53,7 +53,7 @@ echo "Successfully retrieved 2 aliases"
|
||||
|
||||
# Try looking up the aliases for a specific domain /alias/destination/{domain}. We expect to retrieve 2
|
||||
curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/alias/destination/mailu.io' \
|
||||
'https://localhost/api/v1/alias/destination/mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep -o '"destination":' | grep -c '"destination":' | grep 2
|
||||
@ -64,7 +64,7 @@ echo "Successfully retrieved 2 aliases"
|
||||
|
||||
# Try deleting a specific alias /alias/{alias}
|
||||
curl --silent --insecure -X 'DELETE' \
|
||||
'https://mailutest/api/v1/alias/test2%40mailu.io' \
|
||||
'https://localhost/api/v1/alias/test2%40mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
| grep 200
|
||||
@ -75,7 +75,7 @@ echo "Deleted alias test2@mailu.io succcessfully"
|
||||
|
||||
# Try updating a specific alias /alias/{alias}
|
||||
curl --silent --insecure -X 'PATCH' \
|
||||
'https://mailutest/api/v1/alias/test%40mailu.io' \
|
||||
'https://localhost/api/v1/alias/test%40mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -94,7 +94,7 @@ echo "Updated alias test2@mailu.io succcessfully"
|
||||
# Try looking up a specific alias /alias/{alias}.
|
||||
#Check if values were updated correctyly in previous step.
|
||||
response=$(curl --silent --insecure -X 'GET' \
|
||||
'https://mailutest/api/v1/alias/test%40mailu.io' \
|
||||
'https://localhost/api/v1/alias/test%40mailu.io' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: apitest')
|
||||
echo $response | grep 'admin@mailu.io'
|
||||
|
Loading…
x
Reference in New Issue
Block a user