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

Add class for keystone audit middleware testing #1212

Merged
merged 5 commits into from
Jun 6, 2024
Merged

Add class for keystone audit middleware testing #1212

merged 5 commits into from
Jun 6, 2024

Conversation

MylesJP
Copy link
Contributor

@MylesJP MylesJP commented May 24, 2024

Added general class for testing keystone audit middleware functionality in charms. Tests correct rendering of api-paste.ini file.

Example usage with charm Heat:

tests/tests.yaml

tests:
  - zaza.openstack.charm_tests.audit.tests.KeystoneAuditMiddlewareTest

tests_options:
  audit-middleware:
    service: heat

Added general class for testing keystone audit middleware
functionality in charms. Tests correct rendering of
api-paste.ini file.

Example usage with charm Heat:

tests/tests.yaml

tests:
  - zaza.openstack.charm_tests.audit.tests.KeystoneAuditMiddlewareTest

tests_options:
  audit-middleware:
    service: heat
@freyes freyes self-requested a review May 27, 2024 14:18
@MylesJP
Copy link
Contributor Author

MylesJP commented May 27, 2024

Added a fix for the case where the service name and the application name differ. In most cases they are the same but in nova-cloud-controller, service name is 'nova' in file path while application_name is 'nova-cloud-controller'.

Copy link
Member

@freyes freyes left a comment

Choose a reason for hiding this comment

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

Hi Myles, thanks for proposing this change, I left some inline comments that need to be addressed.

zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
zaza/openstack/charm_tests/audit/tests.py Outdated Show resolved Hide resolved
@freyes
Copy link
Member

freyes commented May 28, 2024

ℹ️ This PR is being exercised by this gerrit change - https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/918017

@MylesJP MylesJP marked this pull request as draft May 28, 2024 22:55
@MylesJP MylesJP marked this pull request as ready for review May 29, 2024 15:43
on the state of the audit-middleware configuration option.
"""

import textwrap
Copy link
Member

Choose a reason for hiding this comment

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

fancy, I like it :-)

@freyes freyes merged commit 1a06e12 into openstack-charmers:master Jun 6, 2024
3 checks passed
openstack-mirroring pushed a commit to openstack/charm-cinder that referenced this pull request Jun 6, 2024
Updated Cinder to use the new Keystone Audit Middleware testing class
in zaza-openstack-tests rather than the previous hardcoded functional
tests. This provides more flexibility and resiliency in the functional
testing of charms using the audit middleware feature.

func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Change-Id: I63192c7db128e3d640e33911d8507cafddc3d5a0
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jun 6, 2024
* Update charm-cinder from branch 'master'
  to d6b92955c31d51db9e7e9f23d70005a6d3a0821e
  - Configure Cinder to use new audit middleware testing class
    
    Updated Cinder to use the new Keystone Audit Middleware testing class
    in zaza-openstack-tests rather than the previous hardcoded functional
    tests. This provides more flexibility and resiliency in the functional
    testing of charms using the audit middleware feature.
    
    func-test-pr: openstack-charmers/zaza-openstack-tests#1212
    Change-Id: I63192c7db128e3d640e33911d8507cafddc3d5a0
openstack-mirroring pushed a commit to openstack/charm-glance that referenced this pull request Jun 13, 2024
This commit adds Keystone audit middleware API logging to
the Glance charm in versions Yoga and newer to allow users to
configure their environment for CADF compliance. This feature can
be enabled/disabled and is set to 'disabled' by default to avoid
bloat in log files. The logging output writes to
/var/log/glance/glance-api.log.
This commit builds on previous discussions:
juju/charm-helpers#808.

Related-Pr: juju/charm-helpers#893
func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Closes-Bug: 1856555
Change-Id: Ied08b56cf3c4fa30827d43a50ca7b552db0fa82b
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jun 13, 2024
* Update charm-glance from branch 'master'
  to 66a167eb42d53f8e12a856c9f0b2d888e57b1742
  - Add keystone audit middleware API logging
    
    This commit adds Keystone audit middleware API logging to
    the Glance charm in versions Yoga and newer to allow users to
    configure their environment for CADF compliance. This feature can
    be enabled/disabled and is set to 'disabled' by default to avoid
    bloat in log files. The logging output writes to
    /var/log/glance/glance-api.log.
    This commit builds on previous discussions:
    juju/charm-helpers#808.
    
    Related-Pr: juju/charm-helpers#893
    func-test-pr: openstack-charmers/zaza-openstack-tests#1212
    Closes-Bug: 1856555
    Change-Id: Ied08b56cf3c4fa30827d43a50ca7b552db0fa82b
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jun 13, 2024
* Update charm-nova-cloud-controller from branch 'master'
  to 6b03c1a46f3b59b2e972cd348a1895086138e817
  - Merge "Add keystone audit middleware API logging"
  - Add keystone audit middleware API logging
    
    This commit adds Keystone audit middleware API logging to the Nova-
    Cloud-Contoller charm in versions Yoga and newer to allow users to
    configure their environment for CADF compliance. This feature can
    be enabled/disabled and is set to 'disabled' by default to avoid
    bloat in log files. The logging output writes to
    /var/log/nova/nova-api-wsgi.log.
    This commit builds on previous discussions:
    juju/charm-helpers#808.
    
    Related-Pr: juju/charm-helpers#893
    func-test-pr: openstack-charmers/zaza-openstack-tests#1212
    Closes-Bug: 1856555
    Change-Id: Ie09cc6775c13a2dba6a0f3d69a4a080f9fc484c8
openstack-mirroring pushed a commit to openstack/charm-nova-cloud-controller that referenced this pull request Jun 13, 2024
This commit adds Keystone audit middleware API logging to the Nova-
Cloud-Contoller charm in versions Yoga and newer to allow users to
configure their environment for CADF compliance. This feature can
be enabled/disabled and is set to 'disabled' by default to avoid
bloat in log files. The logging output writes to
/var/log/nova/nova-api-wsgi.log.
This commit builds on previous discussions:
juju/charm-helpers#808.

Related-Pr: juju/charm-helpers#893
func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Closes-Bug: 1856555
Change-Id: Ie09cc6775c13a2dba6a0f3d69a4a080f9fc484c8
openstack-mirroring pushed a commit to openstack/charm-heat that referenced this pull request Jun 13, 2024
This commit adds Keystone audit middleware API logging to the Heat
charm in versions Yoga and newer to allow users to configure their
environment for CADF compliance. This feature can be enabled/disabled
and is set to 'disabled' by default to avoid bloat in log files.
The logging output is configured to /var/log/heat/heat-api.log.
This commit builds on previous discussions:
juju/charm-helpers#808.

func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Closes-Bug: 1856555
Change-Id: Ic611b68f35a36489673e3430dd1abbd5aa752fa7
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jun 13, 2024
* Update charm-heat from branch 'master'
  to 69886c1bcd7a5a8e5c92478c9ea1d45801fc8d38
  - Add keystone audit middleware API logging
    
    This commit adds Keystone audit middleware API logging to the Heat
    charm in versions Yoga and newer to allow users to configure their
    environment for CADF compliance. This feature can be enabled/disabled
    and is set to 'disabled' by default to avoid bloat in log files.
    The logging output is configured to /var/log/heat/heat-api.log.
    This commit builds on previous discussions:
    juju/charm-helpers#808.
    
    func-test-pr: openstack-charmers/zaza-openstack-tests#1212
    Closes-Bug: 1856555
    Change-Id: Ic611b68f35a36489673e3430dd1abbd5aa752fa7
openstack-mirroring pushed a commit to openstack/charm-heat that referenced this pull request Jul 2, 2024
This commit adds Keystone audit middleware API logging to the Heat
charm in versions Yoga and newer to allow users to configure their
environment for CADF compliance. This feature can be enabled/disabled
and is set to 'disabled' by default to avoid bloat in log files.
The logging output is configured to /var/log/heat/heat-api.log.
This commit builds on previous discussions:
juju/charm-helpers#808.

func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Closes-Bug: 1856555
Change-Id: Ic611b68f35a36489673e3430dd1abbd5aa752fa7
(cherry picked from commit 69886c1)
openstack-mirroring pushed a commit to openstack/charm-heat that referenced this pull request Jul 3, 2024
This commit adds Keystone audit middleware API logging to the Heat
charm in versions Yoga and newer to allow users to configure their
environment for CADF compliance. This feature can be enabled/disabled
and is set to 'disabled' by default to avoid bloat in log files.
The logging output is configured to /var/log/heat/heat-api.log.
This commit builds on previous discussions:
juju/charm-helpers#808.

func-test-pr: openstack-charmers/zaza-openstack-tests#1212
Closes-Bug: 1856555
Change-Id: Ic611b68f35a36489673e3430dd1abbd5aa752fa7
(cherry picked from commit 69886c1)
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.

3 participants