Skip to content

Commit

Permalink
virtio_rng: Remove redundant code for aarch64
Browse files Browse the repository at this point in the history
After b03e83f, the test provides feeding data on all arches.
So remove the aarch64 specific code which is redundant now.

Signed-off-by: Hu Shuai <[email protected]>
  • Loading branch information
hs0210 committed Sep 18, 2023
1 parent 39aa600 commit 2f5cab1
Showing 1 changed file with 0 additions and 36 deletions.
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

0 comments on commit 2f5cab1

Please sign in to comment.