distcloud/distributedcloud/dcmanager/tests/unit/common
Salman Rana 628d3f276d Add sw version validation to all release param endpoints
Incorporate the existing release version validation with
all the dcmanager operations/commands endpoints that allow
the user to specify a release version:
 - subcloud add
 - subcloud prestage
 - subcloud redeploy
 - subcloud deploy show
 - subcloud deploy resume
 - subcloud deploy create
 - subcloud deploy install
 - prestage-strategy create
 - subcloud-backup restore

Please note that the "subcloud deploy upload" release
validation was addressed in a previous change [1].

These changes add the validate_release_version_supported check
(previously introduced [1]) to all the endpoints that
consume a release parameter. This is done to check
whether a specified release version is supported by the
current active version.

[1] https://review.opendev.org/c/starlingx/distcloud/+/891911

Test Plan:
For each command listed above, test the
release parameter (--release):
    1. PASS: Verify that the current active version is
       accepted as a valid parameter.
    2. PASS: Verify that all the supported upgrade versions
       in /usr/rootdirs/opt/upgrades/metadata.xml are accepted
       as a valid release parameter.
    3. PASS: Verify that any upgrade version that's not included
       in metadata.xml is rejected with an error
       "<release> is not a supported release version". The only
       exception to this is the current active version, it must
       always be valid.
    4. PASS: Delete all the "supported_upgrades" elements in
       metadata.xml and verify the error
       "Unable to validate the release version" is printed.
    5. PASS: Delete metadata.xml and verify that
       "Unable to validate the release version" error is printed.
    6. PASS: Verify that the current active version is valid
       regardless of metadata.xml file and its contents.
    7. PASS: Exclude the release parameter and verify that the
       command is successful (completed
       with the current active version).

Closes-Bug: 2036479

Change-Id: I1608a68ce6863f51dc0b90e0a6f6b9b588e85689
Signed-off-by: Salman Rana <salman.rana@windriver.com>
2023-09-26 10:18:48 -04:00
..
__init__.py Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
fake_strategy.py Add features to kube-root-ca update orchestration 2021-10-06 08:01:33 -05:00
fake_subcloud.py Add sw version validation to all release param endpoints 2023-09-26 10:18:48 -04:00
test_phased_subcloud_deploy.py Add check for deploy files alternate location 2023-08-02 06:45:29 -04:00