Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase default memory for openshift.yaml to avoid kdump service fail. #443

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion os_tests/cfg/openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ VM:
Flavor:
name: small
cpu: 1
memory: 1
memory: 1.5
size: 10G
virt: kvm
40 changes: 39 additions & 1 deletion os_tests/libs/resources_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ def floating_ip(self):
if v["addrs"]:
for ipaddr in v["addrs"]:
f_ip = ipaddr["addr"]

if not f_ip:
LOG.warning(f"No floating IP found for VM {self.vm_name}. Checking VM status.")
state, reason = self.get_state()
state_str = self._get_state_string(state)
reason_str = self._get_reason_string(state, reason)
LOG.info(f"VM {self.vm_name} - State: {state_str}, Reason: {reason_str}")

LOG.info("ip is %s" % f_ip)
return f_ip

@property
Expand Down Expand Up @@ -224,7 +233,36 @@ def _get_status(self):
self.data = self.vm_name
dom = self.conn.lookupByUUIDString(self.data.get("uuid"))
state, reason = dom.state()
return state
state_str = self._get_state_string(state)
reason_str = self._get_reason_string(state, reason)
LOG.info(f"VM {self.vm_name} - State: {state_str}, Reason: {reason_str}")
return state, reason

def _get_state_string(self, state):
state_dict = {
libvirt.VIR_DOMAIN_RUNNING: "Running",
libvirt.VIR_DOMAIN_SHUTDOWN: "Shutdown",
libvirt.VIR_DOMAIN_SHUTOFF: "Shutoff",
libvirt.VIR_DOMAIN_PAUSED: "Paused",
libvirt.VIR_DOMAIN_CRASHED: "Crashed",
libvirt.VIR_DOMAIN_PMSUSPENDED: "Suspended",
}
return state_dict.get(state, f"Unknown ({state})")

def _get_reason_string(self, state, reason):
reason_dict = {
libvirt.VIR_DOMAIN_RUNNING: {
libvirt.VIR_DOMAIN_RUNNING_BOOTED: "Booted",
libvirt.VIR_DOMAIN_RUNNING_MIGRATED: "Migrated",
libvirt.VIR_DOMAIN_RUNNING_RESTORED: "Restored",
},
libvirt.VIR_DOMAIN_SHUTOFF: {
libvirt.VIR_DOMAIN_SHUTOFF_DESTROYED: "Destroyed",
libvirt.VIR_DOMAIN_SHUTOFF_CRASHED: "Crashed",
libvirt.VIR_DOMAIN_SHUTOFF_SHUTDOWN: "Shutdown",
},
}
return reason_dict.get(state, {}).get(reason, f"Unknown ({reason})")

def get_state(self):
return self._get_status()
Expand Down
2 changes: 2 additions & 0 deletions os_tests/tests/test_rhel_guest_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def test_check_partitions(self):
product_id = utils_lib.get_product_id(self)
if float(product_id) >= 10.0:
expected_partitions = 4
if utils_lib.is_arch(self, arch='aarch64') or utils_lib.is_arch(self, arch='ppc64le'):
expected_partitions = 3
elif float(product_id) >= 9.0:
expected_partitions = 5
if utils_lib.is_arch(self, arch='s390x'):
Expand Down
Loading