From 0e08ecf0791610b4f5f26459ba8798b47dcbdb69 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Mon, 11 Dec 2023 23:27:17 +0800 Subject: [PATCH] test: fix ansible playbook conditional statements error --- test/data/ansible/check_ostree.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/data/ansible/check_ostree.yaml b/test/data/ansible/check_ostree.yaml index 2b7f637fe6..d11c32e767 100644 --- a/test/data/ansible/check_ostree.yaml +++ b/test/data/ansible/check_ostree.yaml @@ -356,9 +356,9 @@ 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 }}" @@ -366,6 +366,8 @@ - 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 @@ -396,9 +398,9 @@ 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 }}" @@ -406,6 +408,8 @@ - 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