Skip to content
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

Download certificates when goal state source is Fast Track #2761

Merged
merged 22 commits into from
Mar 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
da72c37
Update version to dummy 1.0.0.0'
maddieford Nov 8, 2022
59dbd22
Revert version change
maddieford Nov 8, 2022
633a826
Merge remote-tracking branch 'upstream/develop' into develop
maddieford Nov 21, 2022
14a743f
Merge remote-tracking branch 'upstream/develop' into develop
maddieford Dec 8, 2022
54ea0f3
Merge remote-tracking branch 'upstream/develop' into develop
maddieford Jan 10, 2023
e79c4c5
Merge remote-tracking branch 'upstream/develop' into develop
maddieford Feb 8, 2023
498b612
Merge remote-tracking branch 'upstream/develop' into develop
maddieford Feb 14, 2023
4365b87
Download certificate in case of ft gs source
maddieford Feb 14, 2023
4783956
Update unit test after separating extensionsconfig and certificates
maddieford Feb 14, 2023
7ddfa95
Update unit tests so that certificates are downloaded in all cases
maddieford Feb 14, 2023
a8534b9
Update unit test message
maddieford Feb 14, 2023
f5c20e6
Add unit tests for downloading certs
maddieford Feb 27, 2023
81683eb
Update goal state before checking for cert
maddieford Feb 27, 2023
f8b6af0
Update unit test names
maddieford Feb 28, 2023
cefc941
Update mock to check for etag before updating
maddieford Feb 28, 2023
0252c3f
Update protected settings test
maddieford Mar 1, 2023
a93d09b
Update failing unit tests after mock updatE
maddieford Mar 1, 2023
f74b629
Update failing unit test
maddieford Mar 1, 2023
be36724
Make cert re-download more readable
maddieford Mar 7, 2023
7c13ded
Make certs_uri a data member
maddieford Mar 7, 2023
93ab957
Update bitwise check for consistency
maddieford Mar 7, 2023
3f39db4
Merge branch 'develop' into download_cert
maddieford Mar 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update unit tests so that certificates are downloaded in all cases
  • Loading branch information
maddieford committed Feb 14, 2023
commit 7ddfa9532ba18d3f8c9aab66391e490e60bd04e1
4 changes: 2 additions & 2 deletions tests/protocol/test_goal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def http_get_handler(url, *_, **__):
protocol.set_http_handlers(http_get_handler=None)
goal_state.update()
self._assert_directory_contents(
self._find_history_subdirectory("234-987"), ["VmSettings.json"])
self._find_history_subdirectory("234-987"), ["VmSettings.json", "Certificates.json"])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test shows that we create history subdirectory with Certificates.json when we have a fast track goal state. Should I add an additional test to verify the certificates are downloaded?


def test_it_should_redact_the_protected_settings_when_saving_to_the_history_directory(self):
with mock_wire_protocol(mockwiredata.DATA_FILE_VM_SETTINGS) as protocol:
Expand Down Expand Up @@ -412,7 +412,7 @@ def http_get_handler(url, *_, **__):
goal_state = GoalState(protocol.client)

self.assertEqual(2, protocol.mock_wire_data.call_counts['goalstate'], "There should have been exactly 2 requests for the goal state (original + refresh)")
self.assertEqual(2, http_get_handler.certificate_requests, "There should have been exactly 2 requests for the goal state certificates (original + refresh)")
self.assertEqual(4, http_get_handler.certificate_requests, "There should have been exactly 2 requests for the goal state certificates (original + refresh)")

thumbprints = [c.thumbprint for c in goal_state.certs.cert_list.certificates]

Expand Down