From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1587655348; cv=none; d=zohomail.com; s=zohoarc; b=EGYFiOhGCeL8qvMmFdHLdsoOyvmglpEV1x6tS/bSz63S3IGao7dlcdcJzlhSr4qX9Nm28jGA6wjslmxKb+XMNKcjwT7UPsry1ntKqV5+hX+3Nm5g35qgmXZ3yLh4s2XHEMU8FT6Vg09lyaPTy2JshPM5w+2BExBS+uHIJbZH0No= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655348; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bU7GUQXRq69s530alZBxXtd8VtPqKmPPTSwHrSxstHY=; b=C/hL24QUb0R54VD2cSeEmtbudeOVCiwaC7HJVPau5dWEAkvn19gM/pma4tXBFqn9Tj0r0ACN8NuQJ79vj/ro1XzLjHXkxWgAVJMHHSkK//2GaLAFJO+5GXPDc+Cx7xxUIbCij49cpNM/lkxmhjPEbHRL2g94qHi3qFVBdYxJY+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1587655348686111.95450679841872; Thu, 23 Apr 2020 08:22:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-_pbgbLjFO7KtnvBnbcoMBA-1; Thu, 23 Apr 2020 11:22:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C17491B2C980; Thu, 23 Apr 2020 15:22:14 +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 97A735D9CC; Thu, 23 Apr 2020 15:22:14 +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 03E771809541; Thu, 23 Apr 2020 15:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMA18010413 for ; Thu, 23 Apr 2020 11:22:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id B65FA60E1C; Thu, 23 Apr 2020 15:22:10 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C42760C81 for ; Thu, 23 Apr 2020 15:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655346; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bU7GUQXRq69s530alZBxXtd8VtPqKmPPTSwHrSxstHY=; b=LTTiuW1jnHeV5GwHnIak8eYoG/dN5mb9TIX7SZdSrnbTyhh5bGuCbadXhw9RE3mn7TpqMO OOT40nxRdRTKqq0EuhOP5KUNL4phKgW7pZWhpZJdx4C1JPUIi7QFe2LRhWm7R/BASlaOUQ qHZmtmfFKlBCxYEqN9X5GiU4X7Tt6wY= X-MC-Unique: _pbgbLjFO7KtnvBnbcoMBA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/8] tests: monitor: Rename qemuMonitorReportError to qemuMonitorTestAddErrorResponse Date: Thu, 23 Apr 2020 17:21:58 +0200 Message-Id: <829e688c9479cfa303fcae2d8367c7a997f15dc3.1587655269.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" It's a method of the test monitor and it adds a response to the monitor output. The original qemuMonitorTestAddErrorResponse method is renamed to qemuMonitorTestAddErrorResponseInternal Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuagenttest.c | 14 +++--- tests/qemumonitortestutils.c | 82 ++++++++++++++++++------------------ tests/qemumonitortestutils.h | 2 +- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 42ef81ac9a..943251df77 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -413,7 +413,7 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr = test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorReportError(test, "Missing command name in %s",= cmdstr); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing command nam= e in %s", cmdstr); goto cleanup; } @@ -424,20 +424,20 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPt= r test, } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorReportError(test, - "Missing arguments section"); + ret =3D qemuMonitorTestAddErrorResponse(test, + "Missing arguments section"); goto cleanup; } if (!(mode =3D virJSONValueObjectGetString(args, "mode"))) { - ret =3D qemuMonitorReportError(test, "Missing shutdown mode"); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing shutdown mo= de"); goto cleanup; } if (STRNEQ(mode, data->mode)) { - ret =3D qemuMonitorReportError(test, - "expected shutdown mode '%s' got '%s'= ", - data->mode, mode); + ret =3D qemuMonitorTestAddErrorResponse(test, + "expected shutdown mode '%s'= got '%s'", + data->mode, mode); goto cleanup; } diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 992d2a4e71..dc753dd417 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -122,8 +122,8 @@ qemuMonitorTestAddResponse(qemuMonitorTestPtr test, static int -qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, - const char *usermsg) +qemuMonitorTestAddErrorResponseInternal(qemuMonitorTestPtr test, + const char *usermsg) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *escapemsg =3D NULL; @@ -161,7 +161,7 @@ qemuMonitorTestAddUnexpectedErrorResponse(qemuMonitorTe= stPtr test, msg =3D g_strdup_printf("unexpected command: '%s'", command); - return qemuMonitorTestAddErrorResponse(test, msg); + return qemuMonitorTestAddErrorResponseInternal(test, msg); } @@ -175,12 +175,12 @@ qemuMonitorTestAddInvalidCommandResponse(qemuMonitorT= estPtr test, msg =3D g_strdup_printf("expected command '%s' got '%s'", expectedcomm= and, actualcommand); - return qemuMonitorTestAddErrorResponse(test, msg); + return qemuMonitorTestAddErrorResponseInternal(test, msg); } int G_GNUC_PRINTF(2, 3) -qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...) +qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *errms= g, ...) { va_list msgargs; g_autofree char *msg =3D NULL; @@ -527,9 +527,9 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonito= rTestPtr test, if (virQEMUQAPISchemaPathGet(schemapath, test->qapischema, &schemaroot= ) < 0 || !schemaroot) { - if (qemuMonitorReportError(test, - "command '%s' not found in QAPI schema", - cmdname) =3D=3D 0) + if (qemuMonitorTestAddErrorResponse(test, + "command '%s' not found in QAP= I schema", + cmdname) =3D=3D 0) return 1; return -1; } @@ -546,11 +546,11 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMoni= torTestPtr test, cmdname, NULLSTR(argstr), virBufferCurrentContent(&deb= ug)); } - if (qemuMonitorReportError(test, - "failed to validate arguments of '%s' " - "against QAPI schema " - "(to see debug output use VIR_TEST_DEBU= G=3D2)", - cmdname) =3D=3D 0) + if (qemuMonitorTestAddErrorResponse(test, + "failed to validate arguments = of '%s' " + "against QAPI schema " + "(to see debug output use VIR_= TEST_DEBUG=3D2)", + cmdname) =3D=3D 0) return 1; return -1; } @@ -574,7 +574,7 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr= test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) - return qemuMonitorReportError(test, "Missing command name in %s", = cmdstr); + return qemuMonitorTestAddErrorResponse(test, "Missing command name= in %s", cmdstr); cmdargs =3D virJSONValueObjectGet(val, "arguments"); if ((rc =3D qemuMonitorTestProcessCommandDefaultValidate(test, cmdname= , cmdargs)) < 0) @@ -648,7 +648,7 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPt= r test, if (data->cmderr) { errmsg =3D g_strdup_printf("%s: %s", data->cmderr, cmdstr); - ret =3D qemuMonitorTestAddErrorResponse(test, errmsg); + ret =3D qemuMonitorTestAddErrorResponseInternal(test, errmsg); } else { ret =3D qemuMonitorTestAddInvalidCommandResponse(test, data->command_n= ame, @@ -718,7 +718,7 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr= test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorReportError(test, "Missing guest-sync command n= ame"); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing guest-sync = command name"); goto cleanup; } @@ -728,12 +728,12 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestP= tr test, } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorReportError(test, "Missing arguments for guest-= sync"); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing arguments f= or guest-sync"); goto cleanup; } if (virJSONValueObjectGetNumberUlong(args, "id", &id)) { - ret =3D qemuMonitorReportError(test, "Missing id for guest sync"); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing id for gues= t sync"); goto cleanup; } @@ -782,7 +782,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPt= r test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorReportError(test, "Missing command name in %s",= cmdstr); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing command nam= e in %s", cmdstr); goto cleanup; } @@ -794,9 +794,9 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPt= r test, } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorReportError(test, - "Missing arguments section for comman= d '%s'", - NULLSTR(data->command_name)); + ret =3D qemuMonitorTestAddErrorResponse(test, + "Missing arguments section f= or command '%s'", + NULLSTR(data->command_name)); goto cleanup; } @@ -804,10 +804,10 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest= Ptr test, for (i =3D 0; i < data->nargs; i++) { qemuMonitorTestCommandArgsPtr arg =3D &data->args[i]; if (!(argobj =3D virJSONValueObjectGet(args, arg->argname))) { - ret =3D qemuMonitorReportError(test, - "Missing argument '%s' for comman= d '%s'", - arg->argname, - NULLSTR(data->command_name)); + ret =3D qemuMonitorTestAddErrorResponse(test, + "Missing argument '%s' f= or command '%s'", + arg->argname, + NULLSTR(data->command_na= me)); goto cleanup; } @@ -817,13 +817,13 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest= Ptr test, /* verify that the argument value is expected */ if (STRNEQ(argstr, arg->argval)) { - ret =3D qemuMonitorReportError(test, - "Invalid value of argument '%s' " - "of command '%s': " - "expected '%s' got '%s'", - arg->argname, - NULLSTR(data->command_name), - arg->argval, argstr); + ret =3D qemuMonitorTestAddErrorResponse(test, + "Invalid value of argume= nt '%s' " + "of command '%s': " + "expected '%s' got '%s'", + arg->argname, + NULLSTR(data->command_na= me), + arg->argval, argstr); goto cleanup; } @@ -908,7 +908,7 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTest= Ptr test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorReportError(test, "Missing command name in %s",= cmdstr); + ret =3D qemuMonitorTestAddErrorResponse(test, "Missing command nam= e in %s", cmdstr); goto cleanup; } @@ -919,9 +919,9 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTest= Ptr test, } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorReportError(test, - "Missing arguments section for comman= d '%s'", - data->command_name); + ret =3D qemuMonitorTestAddErrorResponse(test, + "Missing arguments section f= or command '%s'", + data->command_name); goto cleanup; } @@ -931,10 +931,10 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTe= stPtr test, /* verify that the argument value is expected */ if (STRNEQ(argstr, data->expectArgs)) { - ret =3D qemuMonitorReportError(test, - "%s: expected arguments: '%s', got: '= %s'", - data->command_name, - data->expectArgs, argstr); + ret =3D qemuMonitorTestAddErrorResponse(test, + "%s: expected arguments: '%s= ', got: '%s'", + data->command_name, + data->expectArgs, argstr); goto cleanup; } diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index 8e213ec921..c693b626fc 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -47,7 +47,7 @@ int qemuMonitorTestAddInvalidCommandResponse(qemuMonitorT= estPtr test, void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestItemPtr item); -int qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ..= .); +int qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *e= rrmsg, ...); int qemuMonitorTestAddItem(qemuMonitorTestPtr test, const char *command_name, --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1587655356; cv=none; d=zohomail.com; s=zohoarc; b=A8JdIlOUAQzWJGNhU+0XCtD74/9gqZ/ev9fqeZ4IPr0hMMISbT6/zKC2f6lgGOrQa7AtPIix2BX4CX8HB+s1HEm0A5DCYpwLQcDmDBL5RX7K6VaDR0On0wXnsqlBouE9pyjN9VbTk9tblLm6kf9KDCC4nU7A9C4Fu5ydGCGmglI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655356; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K58BXmY8VkGq0gu5gnhio/qzKqO4a/C7qNg7ItrdJhE=; b=BJLYoQ82wZ9BBtfhFI+jw0wOQcRsG31zAXHZewsgVgEbfg6dMK4w3nfvl4s6xtTaXF8NKP4+Fe01QpEsjb6WRh8n62UKmnM6U0339mRBTcOCDitvqFzEbn/RcfDoZGY1nHHwKTbdWXOZ2BM/hq0fUEtuHj0UiRMVy5xwmYZxEzg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1587655356894876.1608335509902; Thu, 23 Apr 2020 08:22:36 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-Zr1_ty8ZOF2Wb8rPDnMMcQ-1; Thu, 23 Apr 2020 11:22:33 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC90B801504; Thu, 23 Apr 2020 15:22:25 +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 9F6A81FDD2; Thu, 23 Apr 2020 15:22:25 +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 536981809563; Thu, 23 Apr 2020 15:22:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMBJr010421 for ; Thu, 23 Apr 2020 11:22:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC79F60C81; Thu, 23 Apr 2020 15:22:11 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18BD960E1C for ; Thu, 23 Apr 2020 15:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655355; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=K58BXmY8VkGq0gu5gnhio/qzKqO4a/C7qNg7ItrdJhE=; b=YMh09HAFYBepHJENP1W6j2KgFMCO4jVAkHDk9be/THriFURBsp8y/snJF+1vZKOPY7wdUU C6SvmuApywoRH8MTpxHdvrebmMJkgVeYO63+JzkYFRkTE4LTGiFO4oOACfmEKDBN+xgElG vc4D74OME37+u6AKzWk0Ey7pIVPg3mM= X-MC-Unique: Zr1_ty8ZOF2Wb8rPDnMMcQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/8] qemuhotplugtest: detach: Add expected 'object-del' to disk-scsi-multipath case Date: Thu, 23 Apr 2020 17:21:59 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The test verifies unplug of a disk with the persistent reservations helper. The 'object-del' used to remove the helper was not mentioned in the list of expected commands. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuhotplugtest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9a787f9d11..628689d27a 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -763,7 +763,8 @@ mymain(void) "human-monitor-command", HMP("")); DO_TEST_DETACH("base-live", "disk-scsi-multipath", false, false, "device_del", QMP_DEVICE_DELETED("scsi0-0-0-0") QMP_OK, - "human-monitor-command", HMP("")); + "human-monitor-command", HMP(""), + "object-del", QMP_OK); DO_TEST_ATTACH("base-live", "qemu-agent", false, true, "chardev-add", QMP_OK, --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1587655345; cv=none; d=zohomail.com; s=zohoarc; b=XHhASCgsbf8Ay08k3xaltSNONmS9NlIUIgHJAVGD3YXJD3ER3yh73qJICJXckJ2Zf8flNr1WhvzqOEZrrVxR/Ll/b0e2f8noUN/vCdBse2oXqYt7zWvw7z4FIbPC3zcb02cwJ3rn2k3JrzBmi0Cbhb1DxJ2tJfvAeJfJU1Vk2pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655345; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3Urt1XOT6WlarNUx9lMfYBBiwsX0sT9IHm7i1z7V//Q=; b=DaEuuRDZTjfp+JMQ1Y40oigJiglv7GjtoKiqnmW3QY1DiOzjr8v9Iv44ekevNAyfhjZaU10XWJSeZtgl8/b5mDoBpp+s8ZoGuIprv6E7Zx99CWAR/FQYsOLkjfclyL7cEgdepBDY7+Estc8nFjL0UZLIOY8scsr9kJlal5TwDDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1587655345479860.0255869312513; Thu, 23 Apr 2020 08:22:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-E04U5iBWOoWwx9-gyRM-sg-1; Thu, 23 Apr 2020 11:22:20 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD4891054F8F; Thu, 23 Apr 2020 15:22:14 +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 A04D95D706; Thu, 23 Apr 2020 15:22:14 +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 331DF1809543; Thu, 23 Apr 2020 15:22:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMCns010428 for ; Thu, 23 Apr 2020 11:22:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB00060E1C; Thu, 23 Apr 2020 15:22:12 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18DB760C81 for ; Thu, 23 Apr 2020 15:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655344; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3Urt1XOT6WlarNUx9lMfYBBiwsX0sT9IHm7i1z7V//Q=; b=TONdHNbWo/nABuNP5Et6Qvx2Ba4sNUWIBXKWU6/JRgBUJcLVxx+4xMOFirK/dan5agyIVt VcCfnRmnUiuHlBB+2TqQ2QbnprjjtyrQTNVaRrG+CWAMmZN8PuBuiRP47BiEMrZOFLryAs Nf+8eP14FtBR4Quw3bSFJKS3L9reFvM= X-MC-Unique: E04U5iBWOoWwx9-gyRM-sg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/8] qemuhotplugtest: cpu: x86-modern-individual: Remove invalid test case Date: Thu, 23 Apr 2020 17:22:00 +0200 Message-Id: <3856904bcfd722f7070b1b881725dce847db47db.1587655269.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" One of the test cases attempted to use test data meant for modern qemu without asserting the 'modern' flag. Since that changes the commands used to query state it won't work with data meant for the modern case. Remove the invalid test case. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuhotplugtest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 628689d27a..8afe7f7faa 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -886,7 +886,6 @@ mymain(void) DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "7", true, true, f= alse); DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "6,7", true, true,= true); DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "7", false, true, = true); - DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "7", true, false, = true); DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "16-23", true, true,= false); DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "16-22", true, true,= true); --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1587655359; cv=none; d=zohomail.com; s=zohoarc; b=JD87FlBDsUrH6SFjxdooHkfBPthwucIzmbycj1QinmzB5F3irvCRZ02ehN96IhMl75AGPqO3JOMyRB1tDIvSoRy6sLVjebwucccRd0KSDyNyoqUrfa/cl6iwmP7noOXia+WSU+60ZnW289DkhszJyEFFYvbzCC9ry+t/WfRUv18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655359; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dSfi4KdxOYkdPXR70iklXWrGWtNx/aLYlzvSVny9LcU=; b=NibkvxKWNSMcbtCc1V+2yVk7ZG3BmfP8NfZOxsjDQkvBZhtzNPkGX4GwvUFps2S8afL2cuESoroP6NtP8tDEj/R/TS7ry+Q0NN2/s0OoX6b8HiIGLznk8YNUGzwENxAzJpQ8d+B1r59WGD5bYjqu1stOCyaRLH/VHE7+W/K/QVg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587655359808303.6703331045877; Thu, 23 Apr 2020 08:22:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-112-PIKzp90BNxmqsSBMkPCdgw-1; Thu, 23 Apr 2020 11:22:32 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A33311054F94; Thu, 23 Apr 2020 15:22:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 791625D70A; Thu, 23 Apr 2020 15:22:25 +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 2921B4CAAE; Thu, 23 Apr 2020 15:22:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMDob010433 for ; Thu, 23 Apr 2020 11:22:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id ACC8560E1C; Thu, 23 Apr 2020 15:22:13 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19C9C60C81 for ; Thu, 23 Apr 2020 15:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655358; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dSfi4KdxOYkdPXR70iklXWrGWtNx/aLYlzvSVny9LcU=; b=IBiUWhtPu0+4wEcvh/DgobjRNKtswOeOAjiYizODwLdAJLEcyuoSKE0CFIJIWfrg6SGqVo FCg8EpXSmG3sQ2GnPC3mzQqGI5QOk+XrI2yNlOTYXrmS7OvX7SPnI6QMvcnASgtRi8BBem xMf2BC7hli+GrzrPfRk8ZzFY/ROKn0I= X-MC-Unique: PIKzp90BNxmqsSBMkPCdgw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/8] qemumonitortestutils: Make test monitor failures more prominent Date: Thu, 23 Apr 2020 17:22:01 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Until now we've tried to report errors from the test monitor code by passing them back as failures from the qemu we simulate. This doesn't work well in cases when the monitor logic does not detect failures or has fallback code. Additionally there isn't much use for continuing the test execution after first failure as in most cases the test data will be misaligned and all other calls will fail as well. To make the errors more obvious this patch moves away from reporting them via the simulated monitor to reporting them to stderr and exit()ing afterwards. While this might be less convenient when developing tests it actually makes failures in the test suite really obvious and doesn't require any opt-in from the tests themselves. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 1 + tests/qemumonitortestutils.c | 121 +++++++++++++++++------------------ 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index cbcdf445aa..bf8832a2a5 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -900,6 +900,7 @@ sc_flake8: sc_prohibit_exit_in_tests: @prohibit=3D'\nitems =3D=3D 0) { - return qemuMonitorTestAddUnexpectedErrorResponse(test, cmdstr); + qemuMonitorTestError("unexpected command: '%s'", cmdstr); } else { qemuMonitorTestItemPtr item =3D test->items[0]; ret =3D (item->cb)(test, item, cmdstr); @@ -527,10 +542,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonit= orTestPtr test, if (virQEMUQAPISchemaPathGet(schemapath, test->qapischema, &schemaroot= ) < 0 || !schemaroot) { - if (qemuMonitorTestAddErrorResponse(test, - "command '%s' not found in QAP= I schema", - cmdname) =3D=3D 0) - return 1; + qemuMonitorTestError("command '%s' not found in QAPI schema", cmdn= ame); return -1; } @@ -546,12 +558,10 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMoni= torTestPtr test, cmdname, NULLSTR(argstr), virBufferCurrentContent(&deb= ug)); } - if (qemuMonitorTestAddErrorResponse(test, - "failed to validate arguments = of '%s' " - "against QAPI schema " - "(to see debug output use VIR_= TEST_DEBUG=3D2)", - cmdname) =3D=3D 0) - return 1; + qemuMonitorTestError("failed to validate arguments of '%s' " + "against QAPI schema " + "(to see debug output use VIR_TEST_DEBUG=3D2)= ", + cmdname); return -1; } @@ -573,8 +583,10 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPt= r test, if (!(val =3D virJSONValueFromString(cmdstr))) return -1; - if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) - return qemuMonitorTestAddErrorResponse(test, "Missing command name= in %s", cmdstr); + if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { + qemuMonitorTestError("Missing command name in %s", cmdstr); + return -1; + } cmdargs =3D virJSONValueObjectGet(val, "arguments"); if ((rc =3D qemuMonitorTestProcessCommandDefaultValidate(test, cmdname= , cmdargs)) < 0) @@ -583,8 +595,8 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr= test, return 0; if (data->command_name && STRNEQ(data->command_name, cmdname)) { - return qemuMonitorTestAddInvalidCommandResponse(test, data->comman= d_name, - cmdname); + qemuMonitorTestErrorInvalidCommand(data->command_name, cmdname); + return -1; } else { return qemuMonitorTestAddResponse(test, data->response); } @@ -617,7 +629,6 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPt= r test, { struct qemuMonitorTestHandlerData *data =3D item->opaque; g_autofree char *reformatted =3D NULL; - g_autofree char *errmsg =3D NULL; g_autoptr(virJSONValue) json =3D NULL; virJSONValuePtr cmdargs; const char *cmdname; @@ -646,13 +657,9 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestP= tr test, ret =3D qemuMonitorTestAddResponse(test, data->response); } else { if (data->cmderr) { - errmsg =3D g_strdup_printf("%s: %s", data->cmderr, cmdstr); - - ret =3D qemuMonitorTestAddErrorResponseInternal(test, errmsg); + qemuMonitorTestError("%s: %s", data->cmderr, cmdstr); } else { - ret =3D qemuMonitorTestAddInvalidCommandResponse(test, - data->command_n= ame, - cmdstr); + qemuMonitorTestErrorInvalidCommand(data->command_name, cmdstr); } } @@ -782,21 +789,19 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest= Ptr test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorTestAddErrorResponse(test, "Missing command nam= e in %s", cmdstr); + qemuMonitorTestError("Missing command name in %s", cmdstr); goto cleanup; } if (data->command_name && STRNEQ(data->command_name, cmdname)) { - ret =3D qemuMonitorTestAddInvalidCommandResponse(test, data->comma= nd_name, - cmdname); + qemuMonitorTestErrorInvalidCommand(data->command_name, cmdname); goto cleanup; } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorTestAddErrorResponse(test, - "Missing arguments section f= or command '%s'", - NULLSTR(data->command_name)); + qemuMonitorTestError("Missing arguments section for command '%s'", + NULLSTR(data->command_name)); goto cleanup; } @@ -804,10 +809,9 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestP= tr test, for (i =3D 0; i < data->nargs; i++) { qemuMonitorTestCommandArgsPtr arg =3D &data->args[i]; if (!(argobj =3D virJSONValueObjectGet(args, arg->argname))) { - ret =3D qemuMonitorTestAddErrorResponse(test, - "Missing argument '%s' f= or command '%s'", - arg->argname, - NULLSTR(data->command_na= me)); + qemuMonitorTestError("Missing argument '%s' for command '%s'", + arg->argname, + NULLSTR(data->command_name)); goto cleanup; } @@ -817,13 +821,11 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest= Ptr test, /* verify that the argument value is expected */ if (STRNEQ(argstr, arg->argval)) { - ret =3D qemuMonitorTestAddErrorResponse(test, - "Invalid value of argume= nt '%s' " - "of command '%s': " - "expected '%s' got '%s'", - arg->argname, - NULLSTR(data->command_na= me), - arg->argval, argstr); + qemuMonitorTestError("Invalid value of argument '%s' of comman= d '%s': " + "expected '%s' got '%s'", + arg->argname, + NULLSTR(data->command_name), + arg->argval, argstr); goto cleanup; } @@ -908,20 +910,18 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTe= stPtr test, return -1; if (!(cmdname =3D virJSONValueObjectGetString(val, "execute"))) { - ret =3D qemuMonitorTestAddErrorResponse(test, "Missing command nam= e in %s", cmdstr); + qemuMonitorTestError("Missing command name in %s", cmdstr); goto cleanup; } if (STRNEQ(data->command_name, cmdname)) { - ret =3D qemuMonitorTestAddInvalidCommandResponse(test, data->comma= nd_name, - cmdname); + qemuMonitorTestErrorInvalidCommand(data->command_name, cmdname); goto cleanup; } if (!(args =3D virJSONValueObjectGet(val, "arguments"))) { - ret =3D qemuMonitorTestAddErrorResponse(test, - "Missing arguments section f= or command '%s'", - data->command_name); + qemuMonitorTestError("Missing arguments section for command '%s'", + data->command_name); goto cleanup; } @@ -931,10 +931,9 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTes= tPtr test, /* verify that the argument value is expected */ if (STRNEQ(argstr, data->expectArgs)) { - ret =3D qemuMonitorTestAddErrorResponse(test, - "%s: expected arguments: '%s= ', got: '%s'", - data->command_name, - data->expectArgs, argstr); + qemuMonitorTestError("%s: expected arguments: '%s', got: '%s'", + data->command_name, + data->expectArgs, argstr); goto cleanup; } --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1587655362; cv=none; d=zohomail.com; s=zohoarc; b=Kkp/6itlEtVCzCAPjjdSY6c0JfzSXrfij6urlnBk+Z355cBHB88G58xevbOGAZjrJ9uIm+v+Fm2lX6BW2hlUMXMlSBrsi5cGKgEEuTfaLfaP/tPyGYwC9fmERQRQ4b6Qu8DHPXX5qb3nYdEyunwWdF3BqMmT4OpAa/7P0dmkL3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655362; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lWqlUDJLSHYrPpZBRAs/HNZB1di19M9e3YDU64muA5A=; b=Sv+aexLfn43OCy5K/c6FB868KVa9l1xoOdq2HFPzu0UtMC9VSmw+Hc2GyH1RmS60Z8tSbUODI7OS7H7YmtqrTm+xsDg/nSFGQj54mnPXFawgFMjZDRClaLIHAz/dDrCOhWauxxXyunRfil/3vG5eJK+RiVmMZkziCAI+cVq8+x0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1587655362625374.1720395014371; Thu, 23 Apr 2020 08:22:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-X_VxjVg-NUS3-3heOiuysw-1; Thu, 23 Apr 2020 11:22:39 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D93231B2C988; Thu, 23 Apr 2020 15:22:29 +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 46C874038; Thu, 23 Apr 2020 15:22:29 +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 DD0521809561; Thu, 23 Apr 2020 15:22:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMExW010441 for ; Thu, 23 Apr 2020 11:22:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id A235860C81; Thu, 23 Apr 2020 15:22:14 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A1F660E1C for ; Thu, 23 Apr 2020 15:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655361; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lWqlUDJLSHYrPpZBRAs/HNZB1di19M9e3YDU64muA5A=; b=VPSaHLizFqeuXcaU03Ey49o+978jjEKGKGscBb+tGSHUoTpEtS3hpq4kidadlAJvR59+wf gpto+QyWSwfCsg0mr+073qIS+J6pMUUwc/Z4d/FAU4Gn1In5nUbdWuysi1mdYQiBPsj9Ea R8dNehXD2SkrOMfYbH82sYpZupCPWrI= X-MC-Unique: X_VxjVg-NUS3-3heOiuysw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/8] qemucapabilitiesdata: riscv: Remove call to 'query-machines' Date: Thu, 23 Apr 2020 17:22:02 +0200 Message-Id: <0ccc7c3144ad0e36e0f051490ed962005027ad8f.1587655269.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The riscv capabilities code doesn't use the data. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- .../caps_3.0.0.riscv32.replies | 42 ------------------- .../caps_3.0.0.riscv64.replies | 42 ------------------- .../caps_4.0.0.riscv32.replies | 42 ------------------- .../caps_4.0.0.riscv64.replies | 42 ------------------- 4 files changed, 168 deletions(-) diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies b/tests/= qemucapabilitiesdata/caps_3.0.0.riscv32.replies index efb18678a2..8159b26d19 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies @@ -14718,45 +14718,3 @@ ], "id": "libvirt-33" } - -{ - "execute": "query-machines", - "id": "libvirt-34" -} - -{ - "return": [ - { - "hotpluggable-cpus": false, - "name": "spike_v1.9.1", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_e", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "none", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.10", - "is-default": true, - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "virt", - "cpu-max": 8 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_u", - "cpu-max": 1 - } - ], - "id": "libvirt-34" -} diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies b/tests/= qemucapabilitiesdata/caps_3.0.0.riscv64.replies index 018e52f8da..995ca86784 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies @@ -14718,45 +14718,3 @@ ], "id": "libvirt-33" } - -{ - "execute": "query-machines", - "id": "libvirt-34" -} - -{ - "return": [ - { - "hotpluggable-cpus": false, - "name": "spike_v1.9.1", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_e", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "none", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.10", - "is-default": true, - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "virt", - "cpu-max": 8 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_u", - "cpu-max": 1 - } - ], - "id": "libvirt-34" -} diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies b/tests/= qemucapabilitiesdata/caps_4.0.0.riscv32.replies index 2d63851d3a..93fd47e8d3 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies @@ -17963,45 +17963,3 @@ ], "id": "libvirt-40" } - -{ - "execute": "query-machines", - "id": "libvirt-41" -} - -{ - "return": [ - { - "hotpluggable-cpus": false, - "name": "virt", - "cpu-max": 8 - }, - { - "hotpluggable-cpus": false, - "name": "none", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.10", - "is-default": true, - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_u", - "cpu-max": 4 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_e", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.9.1", - "cpu-max": 1 - } - ], - "id": "libvirt-41" -} diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies b/tests/= qemucapabilitiesdata/caps_4.0.0.riscv64.replies index 4df475d7c0..448c9d2402 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies @@ -17963,45 +17963,3 @@ ], "id": "libvirt-40" } - -{ - "execute": "query-machines", - "id": "libvirt-41" -} - -{ - "return": [ - { - "hotpluggable-cpus": false, - "name": "virt", - "cpu-max": 8 - }, - { - "hotpluggable-cpus": false, - "name": "none", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.10", - "is-default": true, - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_u", - "cpu-max": 4 - }, - { - "hotpluggable-cpus": false, - "name": "sifive_e", - "cpu-max": 1 - }, - { - "hotpluggable-cpus": false, - "name": "spike_v1.9.1", - "cpu-max": 1 - } - ], - "id": "libvirt-41" -} --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1587655361; cv=none; d=zohomail.com; s=zohoarc; b=LWeBi56BGE20cXNd0WXR2OTwjwfoWtR0q+Iy8vpTz1zWKc3tqyg5yrc779VqRdwkp+uUv0FKPU3Ibdk2dMqorQDoy/vD0Qv8FnT8lwLM0hH39+cGt7CFQX9n1pspGFCQCmFide/BN1M7v1y1bYD823NqTcZ22Ut8c09nrUyeNXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655361; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iO5xUXGnGbkDd6GVxc4Jgk3w4NS9sropAGM7JB4mHB4=; b=B+TMkbhGOts3ZYG07qMLTemdIuXfTSJOkQP1KC0+YFS07ThprV2CFS2vr+tGQoOGdqLKGslFAneF9u8yihOQ82f7jloTEXLv/9t6SNohQDPfUB/8I77Lt77GqzOfySBG48p2t/x1xKIlcqEPEruzuiFDLUAVd/39AB9U0XDRRX8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587655361603782.8327539236828; Thu, 23 Apr 2020 08:22:41 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-ql4-GlQEPweFwdnb1OwavQ-1; Thu, 23 Apr 2020 11:22:35 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C2DC835B44; Thu, 23 Apr 2020 15:22:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74BB45D706; Thu, 23 Apr 2020 15:22:25 +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 2B5924CAB0; Thu, 23 Apr 2020 15:22:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMFjT010454 for ; Thu, 23 Apr 2020 11:22:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9997460E1C; Thu, 23 Apr 2020 15:22:15 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 076C060C81 for ; Thu, 23 Apr 2020 15:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655360; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iO5xUXGnGbkDd6GVxc4Jgk3w4NS9sropAGM7JB4mHB4=; b=JYrceiZJQIuYmz23yvUCZcdDw+uCpIvkVfylWjhnszbAVP+LzBImBcro2VGBrnBVoOnP8i Pg48XDZVk35VG74hOG439P1VRGOIbWi1tWFbsXmzYTz1bgzEJ54Q6tk30SKwrrCEB5FfSi fCJG3uTDborYc1zFPBklQtMwz38Wm1g= X-MC-Unique: ql4-GlQEPweFwdnb1OwavQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/8] qemuhotplugtest: Remove 'drive_del' expectation from failed cases Date: Thu, 23 Apr 2020 17:22:03 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" On failure 'drive_del' is not issued. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuhotplugtest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 8afe7f7faa..65867a0122 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -748,8 +748,7 @@ mymain(void) /* Disk added */ "device_add", QMP_OK); DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", true, = true, - "device_del", QMP_OK, - "human-monitor-command", HMP("")); + "device_del", QMP_OK); DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", false,= false, "device_del", QMP_DEVICE_DELETED("scsi3-0-5-6") QMP_OK, "human-monitor-command", HMP("")); @@ -759,8 +758,7 @@ mymain(void) "human-monitor-command", HMP("OK\\r\\n"), "device_add", QMP_OK); DO_TEST_DETACH("base-live", "disk-scsi-multipath", true, true, - "device_del", QMP_OK, - "human-monitor-command", HMP("")); + "device_del", QMP_OK); DO_TEST_DETACH("base-live", "disk-scsi-multipath", false, false, "device_del", QMP_DEVICE_DELETED("scsi0-0-0-0") QMP_OK, "human-monitor-command", HMP(""), --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1587655360; cv=none; d=zohomail.com; s=zohoarc; b=bqpHNsxecoRqPbkgSEilwf2tsWNgs0fakSn74i5A07mJPanHux9T3krxkN1JYsS0gpoKI5L9SxeDSbzzRNQmjrtI4jl1TQVKFVaAuV9qHqTZkKMSpUNrSUBKYs0prHjjYkNw/PDgZvzcctIzgRjV9DlVpYi/KYRG0R6THMjcLVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655360; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Mz+h8DwNfuH24Szpn5Ptqw+MLLAo/REjRRbnAB/cQnU=; b=QPm+WE3/AQVs4tGXE+rJ/9thVWJysqse+LPnliB+6ShpRf3NKBH0Hajrq+LfZ5wLHxgdB0PTJgQACnqHwsESlkYbA72hfbeJ6QBfDWQGMIf3r05i2W26Jyk/GSgbXNPBfZyRjxXsTObzs61sUyDPPrpNqByeLWAGpWOqyJhXb48= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587655360586608.6486257486661; Thu, 23 Apr 2020 08:22:40 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-48NYFxQMMnGzcQpovWLLag-1; Thu, 23 Apr 2020 11:22:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7614F800685; Thu, 23 Apr 2020 15:22:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D0D619D9E; Thu, 23 Apr 2020 15:22:30 +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 CF82C4E560; Thu, 23 Apr 2020 15:22:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMGUS010463 for ; Thu, 23 Apr 2020 11:22:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 917BD60C81; Thu, 23 Apr 2020 15:22:16 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08B2A60E1C for ; Thu, 23 Apr 2020 15:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Mz+h8DwNfuH24Szpn5Ptqw+MLLAo/REjRRbnAB/cQnU=; b=hz0W673Pn9FITL2F/7LP8NF0g3SeUlJl+3FjkbZdTwfqnfRf55XW3PD7lC5e00F9JguAj5 xKob99QNBKimahch7QJs2qq2S8j+Gv0ULSEN2BoiiQp5ezr7EGpZGHfj891lf6pfimStcM l+B/1vecmoLNIACZc9DZqa9LlZ+ixow= X-MC-Unique: 48NYFxQMMnGzcQpovWLLag-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/8] qemumonitortestutils: Store a string identifying test monitor entry Date: Thu, 23 Apr 2020 17:22:04 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For each test monitor entry store an optional string which will allow to identify it. This will be used later when checking that all registered monitor commands were used. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuagenttest.c | 17 ++++++++++++----- tests/qemumonitortestutils.c | 10 ++++++++++ tests/qemumonitortestutils.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 943251df77..2c3a1efb09 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -471,7 +471,8 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_SHUTDOWN; priv.mode =3D "halt"; - if (qemuMonitorTestAddHandler(test, qemuAgentShutdownTestMonitorHandle= r, + if (qemuMonitorTestAddHandler(test, "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, &priv, NULL) < 0) goto cleanup; @@ -485,7 +486,8 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_SHUTDOWN; priv.mode =3D "powerdown"; - if (qemuMonitorTestAddHandler(test, qemuAgentShutdownTestMonitorHandle= r, + if (qemuMonitorTestAddHandler(test, "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, &priv, NULL) < 0) goto cleanup; @@ -499,7 +501,9 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_RESET; priv.mode =3D "reboot"; - if (qemuMonitorTestAddHandler(test, qemuAgentShutdownTestMonitorHandle= r, + if (qemuMonitorTestAddHandler(test, + "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, &priv, NULL) < 0) goto cleanup; @@ -720,7 +724,8 @@ testQemuAgentTimeout(const void *data) goto cleanup; } - if (qemuMonitorTestAddHandler(test, qemuAgentTimeoutTestMonitorHandler, + if (qemuMonitorTestAddHandler(test, NULL, + qemuAgentTimeoutTestMonitorHandler, NULL, NULL) < 0) goto cleanup; @@ -734,7 +739,9 @@ testQemuAgentTimeout(const void *data) if (qemuMonitorTestAddAgentSyncResponse(test) < 0) goto cleanup; - if (qemuMonitorTestAddHandler(test, qemuAgentTimeoutTestMonitorHandler, + if (qemuMonitorTestAddHandler(test, + NULL, + qemuAgentTimeoutTestMonitorHandler, NULL, NULL) < 0) goto cleanup; diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index bc3b2f5f92..1af56c6d87 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -43,6 +43,7 @@ VIR_LOG_INIT("tests.qemumonitortestutils"); struct _qemuMonitorTestItem { + char *identifier; qemuMonitorTestResponseCallback cb; void *opaque; virFreeCallback freecb; @@ -88,6 +89,8 @@ qemuMonitorTestItemFree(qemuMonitorTestItemPtr item) if (!item) return; + g_free(item->identifier); + if (item->freecb) (item->freecb)(item->opaque); @@ -436,6 +439,7 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) int qemuMonitorTestAddHandler(qemuMonitorTestPtr test, + const char *identifier, qemuMonitorTestResponseCallback cb, void *opaque, virFreeCallback freecb) @@ -445,6 +449,7 @@ qemuMonitorTestAddHandler(qemuMonitorTestPtr test, if (VIR_ALLOC(item) < 0) goto error; + item->identifier =3D g_strdup(identifier); item->cb =3D cb; item->freecb =3D freecb; item->opaque =3D opaque; @@ -617,6 +622,7 @@ qemuMonitorTestAddItem(qemuMonitorTestPtr test, data->response =3D g_strdup(response); return qemuMonitorTestAddHandler(test, + command_name, qemuMonitorTestProcessCommandDefault, data, qemuMonitorTestHandlerDataFree); } @@ -700,6 +706,7 @@ qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test, goto error; return qemuMonitorTestAddHandler(test, + command, qemuMonitorTestProcessCommandVerbatim, data, qemuMonitorTestHandlerDataFree); @@ -766,6 +773,7 @@ qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr = test) } return qemuMonitorTestAddHandler(test, + "agent-sync", qemuMonitorTestProcessGuestAgentSync, NULL, NULL); } @@ -884,6 +892,7 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test, va_end(args); return qemuMonitorTestAddHandler(test, + cmdname, qemuMonitorTestProcessCommandWithArgs, data, qemuMonitorTestHandlerDataFree); @@ -988,6 +997,7 @@ qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, } return qemuMonitorTestAddHandler(test, + cmdname, qemuMonitorTestProcessCommandWithArgS= tr, data, qemuMonitorTestHandlerDataFree); diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index c693b626fc..384002d086 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -34,6 +34,7 @@ typedef int (*qemuMonitorTestResponseCallback)(qemuMonito= rTestPtr test, const char *message); int qemuMonitorTestAddHandler(qemuMonitorTestPtr test, + const char *identifier, qemuMonitorTestResponseCallback cb, void *opaque, virFreeCallback freecb); --=20 2.26.0 From nobody Sun May 5 23:28:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1587655368; cv=none; d=zohomail.com; s=zohoarc; b=dJzGvgHJfdPB1cdGfXdfzo+nhHyZkhcilzcvW1fapjmc3vLJITvwY1ijPMietPmhLBNcicE67hmV/59+eeQEL7ISgqroJWzSBMdQvyx2ubY3pmiFJaLWLYOWjLqxRDuPn8ktMO9hzrv/y9BJqKBJT035nJM/tlHJXUNJjngvXok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587655368; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wKOWJpY6iJOl/+g3eCRS5pDCP7QeTdNrW55oQl5D+TA=; b=BkbChEAQn0eQL842OOSvIsQW+cK9KYCHnltjnBFGvnq2+QiydevJc0KUD+kzLABmXI/UUxjfniurB0VE4setAi/+OTjXSEtIKa/iFUF1mwq/4BOgVUV9MTeesPHJJ80QXCEaRNqAOyQNXMAkUcKbvyAICEEeC4aNd5PwyYZwqNg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587655368460238.76879111986648; Thu, 23 Apr 2020 08:22:48 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-EE8VeByIO9uIz5E-5U_bgQ-1; Thu, 23 Apr 2020 11:22:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F39C8108BD0E; Thu, 23 Apr 2020 15:22:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C88465D9D7; Thu, 23 Apr 2020 15:22:36 +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 7BCF94E585; Thu, 23 Apr 2020 15:22:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03NFMH5I010468 for ; Thu, 23 Apr 2020 11:22:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8740C60E1C; Thu, 23 Apr 2020 15:22:17 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9EC260C81 for ; Thu, 23 Apr 2020 15:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587655367; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wKOWJpY6iJOl/+g3eCRS5pDCP7QeTdNrW55oQl5D+TA=; b=DpkRfTMJYDYlxVxmuNHHViAm4uHUfuH/gwIZJ2ng84PfZ5VjLYROJlbw6iU9bsWLwMUSTJ QXkmA0asBtIQ6D5AYotuT4+2PeGf+KKLtfVyG7ZVCKtLyBJAPFNYNws6A8PdJHRoO0RFRn QmMzfhvRAQFpjL/zDb8jOHl3op9+Ot8= X-MC-Unique: EE8VeByIO9uIz5E-5U_bgQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 8/8] qemumonitortestutils: Enforce consumption of all items in test monitor Date: Thu, 23 Apr 2020 17:22:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" To prevent unexpected situations where a change in code would stop looking at some of the tested commands go unnoticed add a mechanism to force consumption of all test items. Since there are a few tests which would be hard to fix add also a mechanism to opt-out of the check. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/cputest.c | 2 ++ tests/qemuhotplugtest.c | 2 ++ tests/qemumonitorjsontest.c | 2 ++ tests/qemumonitortestutils.c | 31 ++++++++++++++++++++++++++++++- tests/qemumonitortestutils.h | 2 ++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/tests/cputest.c b/tests/cputest.c index 869d016ffc..21f47a6853 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -482,6 +482,8 @@ cpuTestMakeQEMUCaps(const struct data *data) if (!(testMon =3D qemuMonitorTestNewFromFile(json, driver.xmlopt, true= ))) goto error; + qemuMonitorTestAllowUnusedCommands(testMon); + cpu =3D virCPUDefNew(); cpu->model =3D g_strdup("host"); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 65867a0122..9a215ab303 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -453,6 +453,8 @@ testQemuHotplugCpuPrepare(const char *test, &driver, data->vm, qm= pschema))) goto error; + qemuMonitorTestAllowUnusedCommands(data->mon); + priv->mon =3D qemuMonitorTestGetMonitor(data->mon); virObjectUnlock(priv->mon); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 615bc8c102..60c816d1d1 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -796,6 +796,8 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionP= tr xmlopt, if (!(data.test =3D qemuMonitorTestNewSchema(xmlopt, schema))) goto cleanup; + qemuMonitorTestAllowUnusedCommands(data.test); + if (qemuMonitorTestAddItemExpect(data.test, "chardev-add", expectargs, true, jsonreply) < 0) goto cleanup; diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 1af56c6d87..0b6188b4ca 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -57,6 +57,8 @@ struct _qemuMonitorTest { bool running; bool started; + bool allowUnusedCommands; + char *incoming; size_t incomingLength; size_t incomingCapacity; @@ -423,8 +425,15 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) VIR_FREE(test->incoming); VIR_FREE(test->outgoing); - for (i =3D 0; i < test->nitems; i++) + for (i =3D 0; i < test->nitems; i++) { + if (!test->allowUnusedCommands) { + g_fprintf(stderr, + "\nunused test monitor item '%s'\n", + NULLSTR(test->items[i]->identifier)); + } + qemuMonitorTestItemFree(test->items[i]); + } VIR_FREE(test->items); if (test->tmpdir && rmdir(test->tmpdir) < 0) @@ -432,6 +441,11 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) VIR_FREE(test->tmpdir); + if (!test->allowUnusedCommands && + test->nitems !=3D 0) { + qemuMonitorTestError("unused test monitor items are not allowed fo= r this test\n"); + } + virMutexDestroy(&test->lock); VIR_FREE(test); } @@ -1290,6 +1304,21 @@ qemuMonitorTestNewFromFile(const char *fileName, } +/** + * qemuMonitorTestAllowUnusedCommands: + * @test: test monitor object + * + * By default all test items/commands must be used by the test. This funct= ion + * allows to override the requirement for individual tests e.g. if it's ne= cessary + * to test some negative scenarios which would not use all commands. + */ +void +qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test) +{ + test->allowUnusedCommands =3D true; +} + + static int qemuMonitorTestFullAddItem(qemuMonitorTestPtr test, const char *filename, diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index 384002d086..f45e850000 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -50,6 +50,8 @@ void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestIt= emPtr item); int qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *e= rrmsg, ...); +void qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test); + int qemuMonitorTestAddItem(qemuMonitorTestPtr test, const char *command_name, const char *response); --=20 2.26.0