Conversation
| @@ -0,0 +1,135 @@ | |||
| # Copyright (c) Microsoft Corporation. | |||
There was a problem hiding this comment.
Please put them under the vm_extensions folder, so we can manage vm extension cases easier. You can have a subfolder there.
| class MDETest(TestSuite): | ||
| def before_case(self, log: Logger, **kwargs: Any) -> None: | ||
| variables = kwargs["variables"] | ||
| self.onboarding_script_sas_uri = variables.get("onboarding_script_sas_uri", "") |
There was a problem hiding this comment.
Can it support non-sas uri? The extra requirement makes the test case skipped in most pipelines.
| return True | ||
|
|
||
| def _install(self) -> bool: | ||
| if not self.get_mde_installer(): |
There was a problem hiding this comment.
It looks the get_mde_installer return true always. The code logic won't be hit.
| def verify_mde(self, node: Node, log: Logger, result: TestResult) -> None: | ||
| # Invoking tools first time, intalls the tool. | ||
| try: | ||
| output = node.tools[Mdatp]._check_exists() |
There was a problem hiding this comment.
- Don't call the private method like
_check_exists, callexists. - But when you refer a tool like this, the check/install happens automatically. So, the code can be like
_ = node.tools[Mdatp], and capture the exception if there is.
| return self._check_exists() | ||
|
|
||
| def onboard(self, onboarding_script_sas_uri: str) -> bool: | ||
| if not self._check_exists(): |
There was a problem hiding this comment.
It doesn't need to check, when you have an instance of the tool, it means the check exists already passed.
| force_run=True, | ||
| ) | ||
|
|
||
| result.assert_exit_code(include_output=True) |
There was a problem hiding this comment.
Add error message for assertion, so the test case can bring more information, when it's failed.
|
@atbagga feel free to open one when it is ready, thanks. |
This change is based of the original PR - #3113