test: Clean up and improve ostree-simplified-installer.sh

Remove comment out code
Use three different IP address for different test scenarios
Move /boot/device-credentials file checking into playbook
Some shell script improvements
This commit is contained in:
Xiaofeng Wang 2022-03-28 13:56:19 +08:00 committed by Jakub Rusz
parent 55a3556e9f
commit 21b6e95136
2 changed files with 93 additions and 104 deletions

View file

@ -4,6 +4,7 @@
vars:
workspace: "{{ lookup('env', 'WORKSPACE') }}"
skip_rollback_test: "false"
fdo_credential: "false"
total_counter: "0"
failed_counter: "0"
@ -44,6 +45,29 @@
- set_fact:
checking_stage: "{{ result_stage.stdout }}"
# case: check /boot/device-credentials exists
# simplified installer installed Edge system ONLY
- name: check /boot/device-credentials exists
stat:
path: /boot/device-credentials
register: stat_result
- name: check commit deployed and built
block:
- assert:
that:
- stat_result.stat.exists
fail_msg: "/boot/device-credentials does not exist"
success_msg: "/boot/device-credentials exists"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when: fdo_credential == "true"
# case: check ostree commit correctly updated
- name: get deployed ostree commit
shell: rpm-ostree status --json | jq -r '.deployments[0].checksum'