Skip to content

Commit

Permalink
add integration test forcing mechanism=debian
Browse files Browse the repository at this point in the history
- test is failing
  • Loading branch information
russoz committed Dec 16, 2024
1 parent 4dce77f commit 2840fd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/locale_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init_module__(self):
apply_change=self.apply_change_debian,
),
glibc=dict(
available=ETC_LOCALE_GEN,
available=SUPPORTED_LOCALES,
apply_change=self.apply_change_glibc,
),
)
Expand Down Expand Up @@ -151,7 +151,7 @@ def assert_available(self):
checking either :
* if the locale is present in /etc/locales.gen
* or if the locale is present in /usr/share/i18n/SUPPORTED"""
regexp = r'^#?\s*(?P<locale>\S+[\._\S]+) (?P<charset>\S+)\s*$'
regexp = r'^\s*#?\s*(?P<locale>\S+[\._\S]+) (?P<charset>\S+)\s*$'
locales_available = self.MECHANISMS[self.vars.mechanism]["available"]

re_compiled = re.compile(regexp)
Expand Down
20 changes: 19 additions & 1 deletion tests/integration/targets/locale_gen/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,25 @@
ansible.builtin.meta: end_play
when: ansible_distribution not in ('Ubuntu', 'Debian')

- include_tasks: basic.yml
- name: Run tests auto-detecting mechanism
ansible.builtin.include_tasks: basic.yml
loop: "{{ locale_list_basic }}"
loop_control:
loop_var: locale_basic

- name: Remove /etc/locale.gen
ansible.builtin.file:
path: /etc/locale.gen
state: absent

- name: Ensure /var/lib/locales/supported.d exists
ansible.builtin.file:
path: /var/lib/locales/supported.d
state: directory
recurse: true

- name: Force mechanism to be debian
ansible.builtin.include_tasks: basic.yml
loop: "{{ locale_list_basic }}"
loop_control:
loop_var: locale_basic

0 comments on commit 2840fd3

Please sign in to comment.