New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.3] Restore activation key and content hosts subscriptions (BZ:1296978) #5374
[6.3] Restore activation key and content hosts subscriptions (BZ:1296978) #5374
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5374 +/- ##
=======================================
Coverage 61.32% 61.32%
=======================================
Files 33 33
Lines 3669 3669
=======================================
Hits 2250 2250
Misses 1419 1419 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
:id: a44fdeda-9c8c-4316-85b4-a9b6b9f1ffdb | ||
|
||
:steps: | ||
1. Setup activation key , lifecycle environment and content view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you get these steps? I read BZ information and it has some deviations from your steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially that csv was edited to another host/capsules before applying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oshtaier to make the exact BZ steps we have to be able to get an other manifest with the same subscriptions but with different agreement number, that is not realizable with the current infra implementation (we need muti-manifests s to be supported), the current coverage implement that by deleting completely the manifest and re-import all data, if you insist on the exact implementation we have to make this PR in do not merge state (marked as blocked ) and wait that PR implementation (multi-manifest) to be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Coverage that you provided in that PR is also needed, but still I am not sure that it is actually cover mentioned BZ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @oshtaier . The steps are looking different to me especially without changing subscription id in csv.
We need @JacobCallahan approval whether these steps fully cover the BZ, and if not - corresponding framework expansion is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abalakh @ldjebran There is one primary case that should be covered in the BZ, which the current test does not cover. The ideal steps for the bug would be:
- Import a manifest, with a couple of subscriptions.
- Register at least one host (preferably more).
- Attach the same subscription to all registered hosts.
- Export the content hosts to a csv file.
- Modify the csv file to change the hosts from their current subscription to a different one.
- Import the csv file
Result: The hosts should no longer have the old subscription, and now have the new one.
There is also an additional test case that could be written for what I did in comment 36. This is pretty similar to the steps above, but does not require hosts to be registered.
- Upload a manifest with a couple of subscriptions.
- Create an activation key, aligning one of the subscriptions to it.
- Export the activation key to a csv file.
- Modify the csv file to change the activation key's subscriptions from the previous sub to a different one.
- Import the csv file.
Result: The activation key should not have the old subscription, and should have the new one.
With that said, this is still a very valid test that we should have in the code, just not aligned to this bug.
:id: a44fdeda-9c8c-4316-85b4-a9b6b9f1ffdb | ||
|
||
:steps: | ||
1. Setup activation key , lifecycle environment and content view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abalakh @ldjebran There is one primary case that should be covered in the BZ, which the current test does not cover. The ideal steps for the bug would be:
- Import a manifest, with a couple of subscriptions.
- Register at least one host (preferably more).
- Attach the same subscription to all registered hosts.
- Export the content hosts to a csv file.
- Modify the csv file to change the hosts from their current subscription to a different one.
- Import the csv file
Result: The hosts should no longer have the old subscription, and now have the new one.
There is also an additional test case that could be written for what I did in comment 36. This is pretty similar to the steps above, but does not require hosts to be registered.
- Upload a manifest with a couple of subscriptions.
- Create an activation key, aligning one of the subscriptions to it.
- Export the activation key to a csv file.
- Modify the csv file to change the activation key's subscriptions from the previous sub to a different one.
- Import the csv file.
Result: The activation key should not have the old subscription, and should have the new one.
With that said, this is still a very valid test that we should have in the code, just not aligned to this bug.
PUT dot merge to make the changes |
3bb54e7
to
41b1d9a
Compare
@abalakh @JacobCallahan @oshtaier comments addressed
|
41b1d9a
to
568786e
Compare
@renzon have added two more tests to this PR please revisit |
ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. These changes will be a fantastic addition to our automation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
self.assertEqual(len(csv_data), 2) | ||
for row_data in csv_data: | ||
# The subscription is saved in the following format: | ||
# """<quantity>|<sku>|<name>|<contract>|<account>""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonus karma for such comments, they're very helpful for understanding the code 👍
cover: https://bugzilla.redhat.com/show_bug.cgi?id=1296978