replace NBSP (non-blocking space) character with a regular SPACE char (#3071)

This commit is contained in:
Alexei Znamensky 2021-07-25 23:53:38 +12:00 committed by GitHub
commit 20db4fc560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 45 additions and 45 deletions

View file

@ -12,7 +12,7 @@
##############
# Test parameters:
# link parameter present / absent ('with_link' variable)
# link parameter present / absent ('with_link' variable)
# with / without alternatives defined in alternatives file ('with_alternatives' variable)
# auto / manual ('mode' variable)
@ -56,7 +56,7 @@
path: '{{ item }}'
state: absent
with_items:
- '{{ alternatives_dir }}/dummy'
- '{{ alternatives_dir }}/dummy'
- file:
path: '/usr/bin/dummy{{ item }}'

View file

@ -1,11 +1,11 @@
- template:
src: dummy_alternative
dest: '{{ alternatives_dir }}/dummy'
dest: '{{ alternatives_dir }}/dummy'
owner: root
group: root
mode: '0644'
when: with_alternatives or ansible_os_family != 'RedHat'
- file:
path: '{{ alternatives_dir }}/dummy'
path: '{{ alternatives_dir }}/dummy'
state: absent
when: not with_alternatives and ansible_os_family == 'RedHat'

View file

@ -5,7 +5,7 @@
- name: set alternative (using link parameter)
alternatives:
name: dummy
path: '/usr/bin/dummy{{ item }}'
path: '/usr/bin/dummy{{ item }}'
link: '/usr/bin/dummy'
register: alternative
@ -20,7 +20,7 @@
- name: set alternative (without link parameter)
alternatives:
name: dummy
path: '/usr/bin/dummy{{ item }}'
path: '/usr/bin/dummy{{ item }}'
register: alternative
- name: check expected command was executed
@ -40,11 +40,11 @@
- 'cmd.stdout == "dummy" ~ item'
- name: 'check mode (manual: alternatives file existed, it has been updated)'
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
when: ansible_os_family != 'RedHat' or with_alternatives or item != 1
- name: 'check mode (auto: alternatives file didn''t exist, it has been created)'
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
when: ansible_os_family == 'RedHat' and not with_alternatives and item == 1
- name: check that alternative has been updated

View file

@ -3,7 +3,7 @@
name: dummy
path: '/usr/bin/dummy{{ item }}'
link: /usr/bin/dummy
priority: '{{ 60 + item|int }}'
priority: '{{ 60 + item|int }}'
register: alternative
- name: execute dummy command
@ -11,13 +11,13 @@
register: cmd
- name: check if link group is in manual mode
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
- name: check expected command was executed
assert:
that:
- 'alternative is changed'
- 'cmd.stdout == "dummy{{ item }}"'
- 'cmd.stdout == "dummy{{ item }}"'
- name: check that alternative has been updated
command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'"