distcloud-client/distributedcloud-client/dcmanagerclient/tests
Salman Rana db6d32fdf7 Fix deploy upload invalid arg exit
Raise a DCManagerClientException to exit from the deploy
upload command handler when an invalid
file arg is encountered. Otherwise, exiting the method
with a simple return results in:
 - an exit code of 0 (a non-zero exit code is expected)
 - Output of an empty deploy table
   (SubcloudDeployUpload is a subclass of DCManagerShowOne.
   A simple return is interpreted as success, hence a console
   output of an empty result is displayed)

Overall, this behavior is misleading as it indicates success
despite the failure. This behavior is specific to the file arg
check (client-side validation done prior to the endpoint call).
Backend errors have been verified to be handled properly,
with a non-zero exit code.

Test Plan:
Using deploy upload (dcmanager subcloud-deploy upload):
  1. PASS: Execute the command with valid
     arguments (correct file references); verify a zero exit code
     (“echo $?”) and console output displaying the
     deploy table.
  2. PASS: Execute the command with an invalid argument
     (missing reference file); verify a non-zero exit code
     (“echo $?”), no deploy table console output and an
     error message “ERROR (app) <arg> does not exist: <file>”

Closes-Bug: 2032970

Change-Id: I53da00a1ba4562aae4345ea1182ca923d227d0e8
Signed-off-by: Salman Rana <salman.rana@windriver.com>
2023-08-30 17:56:58 +00:00
..
v1 Fix deploy upload invalid arg exit 2023-08-30 17:56:58 +00:00
__init__.py Move content to subdir to support relocated packaging 2019-11-04 14:14:38 -05:00
base.py Add subcloud secondary status support and migration 2023-08-23 12:56:35 +00:00
base_shell_test.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
test_client.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
test_help_and_bash_completion.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
test_httpclient.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
test_shell.py Remove WR License notice from StarlingX distributed cloud client 2021-12-22 13:23:29 -05:00
test_utils.py Use multipart headers on subcloud-backup API calls 2022-12-14 18:13:50 -03:00