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

migrate_with_virtual_devices: fix rng check method #6071

Merged
merged 1 commit into from
Dec 19, 2024
Merged
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
10 changes: 5 additions & 5 deletions libvirt/tests/src/migration/migrate_with_virtual_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,21 +552,21 @@ def check_rng_in_vm(vm, backend_type, rng_present):
"""

logging.debug("Check rng device in vm")
check_cmd = "dd if=/dev/hwrng of=/dev/null count=2 bs=2"
check_cmd = "cat /sys/devices/virtual/misc/hw_random/rng_available"
timeout = 10

try:
status, output = vm.session.cmd_status_output(check_cmd, timeout)
logging.debug("cmd exit status: %s, cmd output: %s",
logging.debug("cmd exit status: %s, current rng available: %s",
status, output)

if status == 0:
status = True if output.count("virtio_rng") else False
if status is True:
if rng_present:
return
else:
raise DeviceNotRemovedError("rng")
else:
if not rng_present and "No such device" in output:
if not rng_present:
return
elif rng_present:
raise DeviceNotFoundError("rng")
Expand Down