From nobody Sun Feb 8 19:59:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1623423038; cv=none; d=zohomail.com; s=zohoarc; b=Tat1Rg2F9b0FIhhuVy9PVEzNEiOMVmKlKvZZsAmCP3Pdo+u2XrTo/IpaH+HkXIk+9pDNAAds65k26AMP5r0hHXhNLzoxzxjd8grL7+VUw87yhrcnJab1atEKWMa57qeqz959dgrBr7DN+Sic0Ay7F0wyRRzNfQeGEb8C4aaThak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623423038; 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=C3kxDVhjmpC0qIynl7GtWy/nh32scoN/dSRLQ7o5Gcg=; b=ShDPwEok9i0jTBB+hi+VN1hOW/fGIedWNTyr4BrChTrSNniNdsqZtPa2KFbPveSs041iiCpf4MejH8LA5u+TGwkE5VXx1pbLuMtPYexDfSOQ9qI2HK54IihWjzpRPLMqLQyC7uMOx/e4+FACH/NKVU0GA5PlSl1pNJUG1aLUD+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623423037987705.7947701168312; Fri, 11 Jun 2021 07:50:37 -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-208-E20eduEUPTKRnOpq0wQWlw-1; Fri, 11 Jun 2021 10:50:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4D398042A6; Fri, 11 Jun 2021 14:50: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 A54EE60FC2; Fri, 11 Jun 2021 14:50: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 70FE946F5C; Fri, 11 Jun 2021 14:50:30 +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 15BEnHBS007605 for ; Fri, 11 Jun 2021 10:49:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B1FF60FC2; Fri, 11 Jun 2021 14:49:17 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFCCC60C05 for ; Fri, 11 Jun 2021 14:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623423037; 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=C3kxDVhjmpC0qIynl7GtWy/nh32scoN/dSRLQ7o5Gcg=; b=GceVJODS1N6Hv4TelSEcYVL1EQyBwLtxBWLCqD8jXSTRVZg9Yx74omGb0pIRv6rrH+BgMZ tOcAsZ/aiGTDEvFrNir4IYvWKm15ruSsZLeOqT6Lu2QesMrr+ihkEdc4LMRuNBPJTFKzUI c+fY6zq8trJnwxBFy4M46xOYs8dEJ2U= X-MC-Unique: E20eduEUPTKRnOpq0wQWlw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/22] qemuxml2arvtest: Ensure newline at the end of generated .args files Date: Fri, 11 Jun 2021 16:48:53 +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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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 switch to internal linebreaking of arguments caused a problem when generating .args files with VIR_TEST_REGENERATE_OUTPUT as the last argument isn't terminated with a newline. Switch to using virCommandToStringBuf and append a newline. Fixes: 0046e0b1c26c8e0167de4a35be2902b9327b0c51 Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..357098f819 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -634,6 +634,7 @@ testCompareXMLToArgv(const void *data) { struct testQemuInfo *info =3D (void *) data; g_autofree char *migrateURI =3D NULL; + g_auto(virBuffer) actualBuf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actualargv =3D NULL; unsigned int flags =3D info->flags; unsigned int parseFlags =3D info->parseFlags; @@ -788,9 +789,12 @@ testCompareXMLToArgv(const void *data) if (testCompareXMLToArgvValidateSchema(&driver, migrateURI, info, flag= s) < 0) goto cleanup; - if (!(actualargv =3D virCommandToString(cmd, true))) + if (virCommandToStringBuf(cmd, &actualBuf, true, false) < 0) goto cleanup; + virBufferAddLit(&actualBuf, "\n"); + actualargv =3D virBufferContentAndReset(&actualBuf); + if (virTestCompareToFileFull(actualargv, info->outfile, false) < 0) goto cleanup; --=20 2.31.1