Skip to content

Commit 18be022

Browse files
committed
tests: Add bootc end-to-end validation test
Add a knob to tests/tasks/install_and_check.yml to skip the role run, as we don't want to do this during validation. Skip the memory tuning checks for bootc validation, as running the role during a container build disables the automatic tuning.
1 parent f53d018 commit 18be022

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/tasks/install_and_check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
include_role:
77
name: linux-system-roles.postgresql
88
public: true
9+
when: __run_role | d(true) | bool
910

1011
- name: Flush handlers
1112
meta: flush_handlers
@@ -53,6 +54,8 @@
5354
when:
5455
- __test_check_unix_socket | d(true)
5556
- __postgresql_is_booted | bool
57+
# role ran in container, disabled tuning
58+
- not (__bootc_validation | d(false))
5659

5760
- name: Check - server tuning is used - effective cache size
5861
become: true
@@ -74,6 +77,8 @@
7477
when:
7578
- __test_check_unix_socket | d(true)
7679
- __postgresql_is_booted | bool
80+
# role ran in container, disabled tuning
81+
- not (__bootc_validation | d(false))
7782

7883
- name: Check postgresql version matches postgresql_version
7984
command: postgres --version

tests/tests_bootc_e2e.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: MIT
2+
---
3+
- name: Bootc end-to-end test
4+
hosts: all
5+
tags:
6+
- tests::bootc-e2e
7+
gather_facts: false
8+
tasks:
9+
- name: Bootc image build preparation
10+
when: ansible_connection | d("") == "buildah"
11+
block:
12+
- name: Run postgresql role
13+
include_role:
14+
name: linux-system-roles.postgresql
15+
16+
- name: Create QEMU deployment
17+
delegate_to: localhost
18+
command: "{{ lsr_scriptdir }}/bootc-buildah-qcow.sh {{ ansible_host }}"
19+
changed_when: true
20+
21+
- name: Validation of deployed image
22+
when: ansible_connection | d("") != "buildah"
23+
block:
24+
- name: Test default settings
25+
include_tasks: tasks/install_and_check.yml
26+
vars:
27+
__run_role: false
28+
__test_clean_instance: false
29+
__postgresql_is_booted: true

0 commit comments

Comments
 (0)