From nobody Mon May 6 19:42:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569259660; cv=none; d=zoho.com; s=zohoarc; b=jRhhDiRiEAuP46+xhc5mo6+GbK35Gcgy+vgSdtvN9jpY5ZONRaVGfDVZgm2TLcwvXouVnmcb9z0fnaHpZaIjlyIBzhVomEGHiBsFMo1pFOSBCwnD1QEvOiFCe3s6Sh72ESA/vKSV4xUbcO+7nkUBVdtApnbRdDvUP95T1Qor2ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569259660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=6UhwGj6a7nUKXVAzaBVjUGy1abW82DmSRnWK4LgAs50=; b=aCogZJuPP5lBJZTvxOrjuUYaFkzXiOayECkT8Ji7bAmdNupGyCZN8WEwAhLPsWfqHB5JyrL2/215aTMjnE9U5509RzasCNKqRgN7BJThstsckoh6VAulj+blIfTrK1Mpx92/LUnaAtI1uVcT9Qn7S4FVdWf+PLskLHhAyVMcBEE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569259660621217.45666474709856; Mon, 23 Sep 2019 10:27:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B95E98A1C80; Mon, 23 Sep 2019 17:27:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C5935D721; Mon, 23 Sep 2019 17:27:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E8F64180085A; Mon, 23 Sep 2019 17:27:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8NHRUCJ018338 for ; Mon, 23 Sep 2019 13:27:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 402345D772; Mon, 23 Sep 2019 17:27:30 +0000 (UTC) Received: from ridgehead.redhat.com (ovpn-200-18.brq.redhat.com [10.40.200.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 777105D71C; Mon, 23 Sep 2019 17:27:26 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 19:27:15 +0200 Message-Id: <9a377abe333000e9e5781cdffd7f6762d5d03d1f.1569259582.git.eskultet@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-tck PATCH] TCK.pm: Define libvirt VMs with an RNG device X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Mon, 23 Sep 2019 17:27:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The nwfilter 220-no-ip-spoofing.t test relies on an SSH connection to the test VM. However, because the domain definition passed to libvirt lacks an RNG device, the SSH server isn't started inside the guest (even though that is the default on virt-builder images) and therefore: "ssh: connect to host 192.168.122.227 port 22: Connection refused" is returned which in turn makes a bunch of sub tests fail because the very basic premise - a working SSH connection - is false. This patch makes sure a virtio RNG is contained in the XML definition, thus causing the SSH server to be started successfully, thus allowing all the subtests to pass. Reviewed-by: Laine Stump --- lib/Sys/Virt/TCK.pm | 4 ++++ lib/Sys/Virt/TCK/DomainBuilder.pm | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm index 389d5cc..3ea06cc 100644 --- a/lib/Sys/Virt/TCK.pm +++ b/lib/Sys/Virt/TCK.pm @@ -807,6 +807,8 @@ sub generic_machine_domain { $b->disk(src =3D> $config{root}, dst =3D> $config{dev}, type =3D> "file"); + $b->rng(backend_model =3D> "random", + backend =3D> "/dev/urandom"); =20 if ($config{firstboot}) { print "# Running the first boot\n"; @@ -865,6 +867,8 @@ sub generic_machine_domain { dst =3D> $config{dev}, type =3D> "file", shareable =3D> $shareddisk); + $b->rng(backend_model =3D> "random", + backend =3D> "/dev/urandom"); return $b; } } diff --git a/lib/Sys/Virt/TCK/DomainBuilder.pm b/lib/Sys/Virt/TCK/DomainBui= lder.pm index 45336b5..be8708f 100644 --- a/lib/Sys/Virt/TCK/DomainBuilder.pm +++ b/lib/Sys/Virt/TCK/DomainBuilder.pm @@ -49,6 +49,7 @@ sub new { graphics =3D> [], hostdevs =3D> [], seclabel =3D> {}, + rng =3D> {}, }; =20 bless $self, $class; @@ -328,6 +329,19 @@ sub seclabel { return $self; } =20 +sub rng { + my $self =3D shift; + my %params =3D @_; + + die "backend model parameter is required" unless $params{backend_model= }; + die "backend parameter is required" unless $params{backend}; + + $self->{rng} =3D \%params; + $self->{rng}->{model} =3D "virtio" unless defined $self->{rng}->{model= }; + + return $self; +} + sub as_xml { my $self =3D shift; =20 @@ -504,6 +518,13 @@ sub as_xml { $w->endTag("graphics"); } $w->emptyTag("console", type =3D> "pty"); + + $w->startTag("rng", + model =3D> $self->{rng}->{model}); + $w->dataElement("backend", $self->{rng}->{backend}, + model =3D> $self->{rng}->{backend_model}); + $w->endTag("rng"); + $w->endTag("devices"); if ($self->{seclabel}->{model}) { $w->startTag("seclabel", --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list