Skip to content

Conversation

@Khushi-Kalantri-Comprinno

Context

Adding unit test coverage for the ssm_patch_manager_enabled check to validate that AWS Systems Manager Patch Manager is enabled on SSM-managed EC2 instances.

Description

  • Created test_ssm_patch_manager_enabled.py with multiple test cases:
    • No running EC2 instances
    • Instance not managed by SSM
    • Instance managed by SSM but Patch Manager not enabled
    • Instance managed by SSM and Patch Manager enabled
    • Error handling for describe_instance_information failure
  • Ensured test discovery by adding a dummy test.
  • Mocked EC2 and SSM clients to isolate unit tests.

Checklist

  • Added new checks? If yes, reviewed necessary permissions
  • Code covered by tests (if not, explain why)
  • Documentation follows Google Python Style Guide
  • Considered if backporting is needed

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant