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

Fix acl update on single element list #132

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
add test for single element acls list deletion logic
  • Loading branch information
Paul Steppacher committed May 27, 2022
commit a29967cb0cecbb0e99eb81950a005926cc0dbcd9
50 changes: 50 additions & 0 deletions molecule/default/tests/test_acl_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,53 @@ def get_acl_config():
# host_vars['ansible_eth0']['ipv4']['address']['__ansible_unsafe']
# for acl in others_acls_configuration['acls']:
# check_configured_acl(host, acl, kfk_addr)


# Disable to not delete other tests acls
# def test_single_element_acls_with_mark_others_as_absent_works(host):
# """
# Check if can delete others acls
# """
# # Given
# def get_acl_config(name=get_acl_name(), state='present'):
# acl_configuration = acl_defaut_configuration.copy()
# acl_configuration.update({
# 'name': name,
# 'state': state
# })
# return acl_configuration
# others_acls_configuration = {
# 'acls': [
# get_acl_config(),
# get_acl_config()
# ]
# }
# others_acls_configuration.update(sasl_default_configuration)
# ensure_kafka_acls(
# host,
# others_acls_configuration
# )
# time.sleep(0.3)
# # When
# test_acl_configuration = {
# 'mark_others_as_absent': True,
# 'acls': [
# get_acl_config()
# ]
# }
# test_acl_configuration.update(sasl_default_configuration)
# ensure_idempotency(
# ensure_kafka_acls,
# host,
# test_acl_configuration
# )
# time.sleep(0.3)
# # Then
# for acl in others_acls_configuration['acls']:
# acl['state'] = 'absent'
#
# for host, host_vars in kafka_hosts.items():
# kfk_addr = "%s:9094" % \
# host_vars['ansible_eth0']['ipv4']['address']['__ansible_unsafe']
# for acl in others_acls_configuration['acls']:
# check_configured_acl(host, acl, kfk_addr)