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

virtio_rng: Remove redundant code for aarch64 #5190

Merged
merged 1 commit into from
Sep 28, 2023
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
36 changes: 0 additions & 36 deletions libvirt/tests/src/libvirt_rng.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging as log
import uuid
import aexpect
import socket
import time

from six.moves import xrange
Expand Down Expand Up @@ -453,36 +452,6 @@ def get_rng_device(guest_arch, rng_model):
else:
test.fail("Unknown rng model %s" % rng_model)

def add_udp_random_server():
"""
Feed the udp rng device some data.
It's prepared for aarch64 due to below issue.
https://bugzilla.redhat.com/show_bug.cgi?id=1983544
"""
backend_source_list = params.get("backend_source", "").split()
backend_type = params.get("backend_type", "tcp")
if backend_source_list:
source_list = [ast.literal_eval(source) for source in
backend_source_list]

for udp_info in source_list:
if udp_info["mode"] == "connect":
udp_ip = udp_info["host"]
udp_port = int(udp_info["service"])
logging.debug("UDP_IP is %s, UDP_PORT is %s" % (udp_ip, udp_port))

try:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((udp_ip, udp_port))
for i in range(5):
data, addr = sock.recvfrom(1024)
logging.debug("SEND DATA")
sock.sendto(b"AB" * 1024, addr)
except Exception as e:
test.fail("Guest failed to connect udp server: %s" % str(e))
finally:
sock.close()

def rotate_audit_log():
"""
Rotates the audit log so that the current log only contains
Expand Down Expand Up @@ -661,11 +630,6 @@ def rotate_audit_log():
cmd = "cat /dev/random | nc -4 localhost 1024"
bgjob = utils_misc.AsyncJob(cmd)

# Add udp random server to feed aarch64 guest to speed up boot
# https://bugzilla.redhat.com/show_bug.cgi?id=1983544
if guest_arch == 'aarch64' and params.get("backend_type") == "udp":
add_udp_random_server()

if test_qemu_cmd and not attach_rng:
if device_num > 1:
for i in xrange(device_num):
Expand Down
Loading