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

add case for nvdimm turned to dram #6216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nanli1
Copy link
Contributor

@nanli1 nanli1 commented Mar 2, 2025

xxxx-302271:Turned nvdimm to the regular DRAM

Signed-off-by: nanli [email protected]

avocado run --vt-type libvirt --vt-omit-data-loss --vt-machine-type q35 memory.devices.nvdimm.turn_to_dram  --vt-connect-uri qemu:///system
 (1/1) type_specific.io-github-autotest-libvirt.memory.devices.nvdimm.turn_to_dram: PASS (42.60 s)

    xxxx-302271:Turned nvdimm to the regular DRAM
Signed-off-by: nanli <[email protected]>
@nanli1 nanli1 force-pushed the add_case_for_nvdimm_tunred_to_dram branch from 206a320 to 2bc5c9c Compare March 2, 2025 03:36
@dzhengfy
Copy link
Contributor

dzhengfy commented Mar 3, 2025

@liang-cong-red-hat could you help review?
@zhenyzha Could you help review?

@zhenyzha
Copy link
Contributor

zhenyzha commented Mar 4, 2025

LGTM.Acked-by: Zhenyu Zhang [email protected]

Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

from provider.memory import memory_base


def execute_cmd_in_guest(test, session, cmd):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it simpler to reuse cmd_status_output() in avocado_vt/virttest/utils_misc.py ?

@@ -270,3 +272,52 @@ def compare_values(test, expected, actual, check_item=''):
check_item, expected, actual))
else:
test.log.debug("Check %s %s PASS", check_item, actual)


def check_boot_config(session, test):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help add a new paramater for check_list and move this function into avocado-vt/virttest/utils_libvirt/libvirt_bios.py

test.fail('/boot/config content not correct: %s not exist' % item)


def check_used_memory_info(test, session=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name is inaccurate. Is it better if using get_memory_info_by_free_cmd() ?
Please move this function into avocado-vt/virttest/utils_libvirt/libvirt_memory.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is similar func here:avocado-vt/virttest/vt_utils/memory.py, you could use them directly if possible., like, get_used_mem, get_free_mem, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is similar func here:avocado-vt/virttest/vt_utils/memory.py, you could use them directly if possible., like, get_used_mem, get_free_mem, etc.

I did not see this vt_utils before. Yes, it seems better than libvirt_memory.py

Copy link
Contributor

@liang-cong-red-hat liang-cong-red-hat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 2 comments, others LGTM

test.log.info("TEST_STEP5:Turned nvdimm to the regular DRAM, and hot-added memory matches the expectation")
if not utils_package.package_install('daxctl', session=session):
test.fail('Cannot install daxctl to vm')
if distro.detect().name == 'rhel' and int(distro.detect().version) == 9:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here better change to >=9

test.fail('/boot/config content not correct: %s not exist' % item)


def check_used_memory_info(test, session=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is similar func here:avocado-vt/virttest/vt_utils/memory.py, you could use them directly if possible., like, get_used_mem, get_free_mem, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants