Skip to content

Commit

Permalink
test: fix ansible playbook conditional statements error
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywang authored and achilleas-k committed Dec 12, 2023
1 parent 6145930 commit 0e08ecf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/data/ansible/check_ostree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,18 @@
block:
- assert:
that:
- result_var_mount_point.stdout == "{{ device_name }}[/ostree/deploy/{{ image_type }}/var]"
fail_msg: "/var does not mount on {{ device_name }}[/ostree/deploy/{{ image_type }}/var]"
success_msg: "/var mounts on {{ device_name }}[/ostree/deploy/{{ image_type }}/var]"
- result_var_mount_point.stdout == var_mount_path
fail_msg: "/var does not mount on {{ var_mount_path }}"
success_msg: "/var mounts on {{ var_mount_path }}"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
vars:
var_mount_path: "{{ device_name }}[/ostree/deploy/{{ image_type }}/var]"

# case: check /var mount status
- name: check /var mount status
Expand Down Expand Up @@ -396,16 +398,18 @@
block:
- assert:
that:
- result_usr_mount_point.stdout == "{{ device_name }}[/ostree/deploy/{{ image_type }}/deploy/{{ deploy_commit }}.0/usr]"
fail_msg: "/usr does not mount on {{ device_name }}[/ostree/deploy/{{ image_type }}/deploy/{{ deploy_commit }}.0/usr]"
success_msg: "/usr mounts on {{ device_name }}[/ostree/deploy/{{ image_type }}/deploy/{{ deploy_commit }}.0/usr]"
- result_usr_mount_point.stdout == usr_mount_path
fail_msg: "/usr does not mount on {{ usr_mount_path }}"
success_msg: "/usr mounts on {{ usr_mount_path }}"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
vars:
usr_mount_path: "{{ device_name }}[/ostree/deploy/{{ image_type }}/deploy/{{ deploy_commit }}.0/usr]"

# case: check /usr mount status
- name: check /usr mount status
Expand Down

0 comments on commit 0e08ecf

Please sign in to comment.