dcmanager: Missing release version validation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
Fix Released
|
Low
|
srana |
Bug Description
Brief Description
-----------------
dcmanager commands accept invalid release parameters
Severity
--------
<Minor: System/Feature is usable with minor issue>
Steps to Reproduce
------------------
create prestage orchestration strategy for subclouds
use a non valid release version
dcmanager prestage-strategy create --release xx --sysadmin-password ...
+------
| Field | Value |
+------
| strategy type | prestage |
| subcloud apply type | None |
| max parallel subclouds | None |
| stop on failure | False |
| prestage software version | xx |
| state | initial |
| created_at | 2023-08-
| updated_at | None |
+------
[sysadmin@
[sysadmin@
[sysadmin@
+------
| Field | Value |
+------
| strategy type | prestage |
| subcloud apply type | None |
| max parallel subclouds | None |
| stop on failure | False |
| prestage software version | xx |
| state | initial |
| created_at | 2023-08-29 15:53:20.000091 |
| updated_at | None |
+------
Expected Behavior
------------------
The prestage strategy should be rejected
Actual Behavior
----------------
the prestaged stragegy is created
Reproducibility
---------------
100% reproducible
System Configuration
-------
DC
Branch/Pull Time/Commit
-------
Master (18/09/2023)
Last Pass
---------
new test scenario.
Timestamp/Logs
--------------
N/A
Test Activity
-------------
Feature Testing
Workaround
----------
No workarounds
Changed in starlingx: | |
status: | New → In Progress |
Changed in starlingx: | |
importance: | Undecided → Low |
tags: | added: stx.9.0 stx.distcloud |
Changed in starlingx: | |
assignee: | nobody → srana (salmanr) |
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/895810 /opendev. org/starlingx/ distcloud/ commit/ 628d3f276d88af8 f682d3207ad763d 335741305f
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 628d3f276d88af8 f682d3207ad763d 335741305f
Author: Salman Rana <email address hidden>
Date: Tue Sep 19 08:07:18 2023 -0400
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: opt/upgrades/ metadata. xml are accepted
"<release> is not a supported release version". The only
exception to this is the current active version, it must upgrades" elements in
metadata. xml and verify the error
regardless of metadata.xml file and its contents.
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/
as a valid release parameter.
3. PASS: Verify that any upgrade version that's not included
in metadata.xml is rejected with an error
always be valid.
4. PASS: Delete all the "supported_
"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
7. PASS: Exclude the release parameter and verify that the
command is successful (completed
with the current active version).
Closes-Bug: 2036479
Change-Id: I1608a68ce6863f 51dc0b90e0a6f6b 9b588e85689
Signed-off-by: Salman Rana <email address hidden>