From edabfbfd1827b365348c1ef1f4b57e58048d41aa Mon Sep 17 00:00:00 2001 From: Toni Kangas Date: Wed, 21 May 2025 13:47:55 +0300 Subject: [PATCH] test: validate authentication failed exit code --- examples/possible_exit_codes.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/possible_exit_codes.md b/examples/possible_exit_codes.md index 24c37404e..132d9b61c 100644 --- a/examples/possible_exit_codes.md +++ b/examples/possible_exit_codes.md @@ -39,8 +39,21 @@ If we now try to run above command again, exit code will be two as both of the s upctl server stop --type hard ${prefix}vm-1 ${prefix}vm-2 --wait ``` -Finally, we can cleanup the created resources. +Let's cleanup the created resources while we have working credentials. ```sh upctl server delete ${prefix}vm-1 ${prefix}vm-2 --delete-storages ``` + +To test validation of credentials, we configure `UPCLOUD_TOKEN` environment variable with invalid value. + +```env +UPCLOUD_TOKEN=invalid +``` + +When authentication fails, upctl sets exit code to 103. + +```sh exit_code=103 +upctl server list +# Error: invalid user credentials, authentication failed using the given username and password +```