Skip to content

Commit 6325c32

Browse files
committed
[pre-adoption-validation]Check hugepage args changes
The edpm_kernel_hugepages ansible var can be used independently from the edpm_kernel_args var to pass huge page kernel config. So the kernel args pre-adoption check is extended to consider this variable as well. Implements: OSPRH-5714
1 parent ea525b2 commit 6325c32

File tree

4 files changed

+96
-0
lines changed

4 files changed

+96
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: Converge
6+
block:
7+
- name: "Include role"
8+
ansible.builtin.include_role:
9+
name: osp.edpm.edpm_pre_adoption_validation
10+
11+
- name: "Check execution halted"
12+
ansible.builtin.fail:
13+
msg: "Execution should stop before this task"
14+
register: should_not_run
15+
rescue:
16+
- name: Asset that role failed
17+
ansible.builtin.assert:
18+
that:
19+
- should_not_run is not defined
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: podman
6+
platforms:
7+
- name: edpm-0
8+
command: /sbin/init
9+
dockerfile: ../../../../molecule/common/Containerfile.j2
10+
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"}
11+
registry:
12+
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"}
13+
ulimits:
14+
- host
15+
provisioner:
16+
name: ansible
17+
inventory:
18+
hosts:
19+
all:
20+
vars:
21+
edpm_pre_adoption_validation_hostname_enabled: false
22+
# This is already configured in the test env so this alone would be
23+
# OK
24+
edpm_kernel_args: "console=ttyS0"
25+
# but this means new kernel args will be generated that are not
26+
# present in the env resulting in check failure
27+
edpm_kernel_hugepages:
28+
"2048":
29+
count: "10"
30+
default: true
31+
"4096":
32+
count: "10"
33+
hosts:
34+
edpm-0:
35+
canonical_hostname: edpm-0.localdomain
36+
37+
verifier:
38+
name: ansible
39+
scenario:
40+
test_sequence:
41+
- destroy
42+
- create
43+
- prepare
44+
- converge
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# Copyright 2023 Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
18+
- name: Prepare
19+
hosts: all
20+
roles:
21+
- role: ../../../../molecule/common/test_deps # noqa: role-name[path]
22+
- role: osp.edpm.env_data
23+
- name: Setup DUT
24+
hosts: all
25+
pre_tasks: []
26+
tasks: []

roles/edpm_pre_adoption_validation/tasks/kernel_args.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
ansible.builtin.set_fact:
2424
cmdline: "{{ cmdline_encoded['content'] | b64decode }}"
2525

26+
- name: Calculate hugepages into edpm_kernel_args
27+
# these tasks modify the edpm_kernel_args value based on the
28+
# edpm_kernel_hugepages value so we can cleanly reuse them
29+
ansible.builtin.include_role:
30+
name: edpm_kernel
31+
tasks_from: hugepages
32+
2633
- name: Validate that kernel args do not change
2734
ansible.builtin.debug:
2835
msg: "Validating that '{{ edpm_kernel_args | default('') }}' in '{{ cmdline }}'"

0 commit comments

Comments
 (0)