-
Notifications
You must be signed in to change notification settings - Fork 224
Gargaditya/dynamic memory testsuite #4195
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
base: main
Are you sure you want to change the base?
Conversation
adityagarg0911
commented
Jan 6, 2026
- Add Testsuite for Dynamic Memory tests on a Linux VM over HyperV
- Add option to enable Dynamic Memory while provisioning VM over hyperV
- Add Hugepages memory stress in stres-ng tool
- Add TestLimit tool to put Memory pressure on windows host
|
|
||
| def _get_host_pressure_mb(self, ctx: DynamicMemoryTestContext) -> int: | ||
| host_total_memory_mb = ctx.hyperv.get_host_total_memory_mb() | ||
| return math.ceil(host_total_memory_mb / 45) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments for the value 45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
| ) | ||
|
|
||
| def _read_kernel_config(self, node: Node, kernel_version: str, config: str) -> bool: | ||
| config_path = f"/boot/config-{kernel_version}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to use tool kernelconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
| ).is_less_than_or_equal_to(ctx.host_guest_tolerance_mb) | ||
|
|
||
| def _read_meminfo_value(self, node: Node, key: str) -> int: | ||
| content = node.execute("cat /proc/meminfo", sudo=False).stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use Free tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function has been called 4 times to get value of "AnonHugePages", and 1 time get value of "MemTotal".
I think I can get total memory from Free tool but for AnonHugePages this function has to stay.
Should I use Free tool to get total memory or keep it as is?
| def _ensure_debugfs_mounted(self, node: Node) -> None: | ||
| if not self._check_debugfs_mounted(node): | ||
| node.execute( | ||
| "mount -t debugfs debugfs /sys/kernel/debug", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we leverage the mount tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we can
Will do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a comprehensive Dynamic Memory test suite for Linux VMs running on Hyper-V, along with the necessary infrastructure changes to support dynamic memory provisioning and testing. The changes add the ability to configure and validate Hyper-V's dynamic memory feature, which allows VMs to dynamically adjust their memory allocation based on demand.
Key changes:
- Adds a new test suite with 7 test cases validating dynamic memory hot add, balloon up/down, and memory limit behaviors
- Implements dynamic memory configuration support in the Hyper-V orchestrator for VM provisioning
- Adds TestLimit tool for applying memory pressure on Windows hosts
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| lisa/microsoft/testsuites/hyperv/dynamic_memory.py | New test suite with 7 test cases validating dynamic memory hot add, ballooning, and limit enforcement under various stress conditions |
| lisa/tools/hyperv.py | Adds dynamic memory configuration dataclass, VM creation parameters for dynamic memory, and helper methods to retrieve memory information from host and guest |
| lisa/tools/testlimit.py | New tool that downloads and runs Sysinternals TestLimit to apply memory pressure on Windows hosts |
| lisa/tools/stress_ng.py | Adds async hugepage memory stressor method for testing huge page allocation scenarios |
| lisa/sut_orchestrator/hyperv/schema.py | Adds schema for dynamic memory configuration parameters (min, max, startup, buffer, priority) |
| lisa/sut_orchestrator/hyperv/platform_.py | Integrates dynamic memory schema into VM provisioning flow, passing parameters to HyperV.create_vm |
| lisa/tools/unzip.py | Updates imports from relative to absolute imports for better code organization |
| lisa/tools/init.py | Exports TestLimit tool for external use |
Test Suggestions (Required per Guideline 1000000):
Key Test Cases:
verify_dynamic_memory_hot_add|verify_dynamic_memory_hot_add_hugepages|verify_dynamic_memory_upper_limit|verify_dynamic_memory_balloon_up|verify_dynamic_memory_balloon_down
Impacted LISA Features:
Resize, StartStop, SerialConsole
Tested Azure Marketplace Images:
- canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
- redhat rhel 9_5 latest
- debian debian-12 12-gen2 latest