From nobody Mon Feb 9 04:50:39 2026 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=1592241130; cv=none; d=zohomail.com; s=zohoarc; b=PFHL2u5zRj5165KmoZ745SaBF2J8sctfl6MrrraEcRwJqjJagvECxxDhwpkd4VLr8zPr9iQtJ9YCjzdSFQitH03zUxkc3Z1uEaP34EKpFeB/wQ1wMb6aPihpYKDTB+YQWuG5I6EUfHXgKaalbEFgV2n4J49rfKGH/65hIBkhxYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241130; 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=ffsGb92HEpv7V7JsmFdeyCMGFNmI6FyslGhew6BYvpA=; b=mGeJ+ivvM5+MCA7zL3slGcDKMATkotFkdSE5FKKBcC3QFJirX81HzzOoxynBoK26YUMgoPnWbpIJGbTT/VNIxuns7X5oAcY68JQ5KDRm7RMfYxQXhJZrTGB2QA0+HegjSfCdDP1533tVMBbwukKhZ/JANFLA2MJMW0GDqDwKbrc= 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 159224113039714.484596441060944; Mon, 15 Jun 2020 10:12:10 -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-475-4Ez3Kz86PoavLeHdR3Q-5Q-1; Mon, 15 Jun 2020 13:11:26 -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 C1D098018AC; Mon, 15 Jun 2020 17:11:20 +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 9D52760C84; Mon, 15 Jun 2020 17:11:20 +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 6F6A495AAC; Mon, 15 Jun 2020 17:11:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHATpb004678 for ; Mon, 15 Jun 2020 13:10:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5D7E2100238D; Mon, 15 Jun 2020 17:10:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id C533E100238C for ; Mon, 15 Jun 2020 17:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241129; 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=ffsGb92HEpv7V7JsmFdeyCMGFNmI6FyslGhew6BYvpA=; b=g8nPkWzfs10df59IMPZHRye/3cRcwOsxtxueOdssQ1ilLyMlv4QAtkH0feVYgM0TXTQEie AkOScSHrqhwhe7EelYYVyk069GPVQLe06LqGipG9sd9hSG2REPMot+xAuwd8iAPDdPbww+ lQ2mF6t98HfktWszjLq66MFU/tX+4Jo= X-MC-Unique: 4Ez3Kz86PoavLeHdR3Q-5Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/32] qemublocktest: Add 'empty' case for incremental backup test Date: Mon, 15 Jun 2020 19:09:53 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 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" Use the new test data when calculating incremental backup operations. As incremental backup fails with no bitmap the test code is modified to allow testing this case too. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 19 ++++++++++--------- .../backupmerge/empty-out.json | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 tests/qemublocktestdata/backupmerge/empty-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8d613d7cac..9e54c254e8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -793,17 +793,16 @@ testQemuBackupIncrementalBitmapCalculate(const void *= opaque) incremental =3D testQemuBackupGetIncremental(data->incremental); - if (!(mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incrementa= l, - data->chain, - nodedata, - "testdisk"))= ) { - VIR_TEST_VERBOSE("failed to calculate merged bitmaps"); - return -1; + if ((mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incremental, + data->chain, + nodedata, + "testdisk")))= { + if (!(actual =3D virJSONValueToString(mergebitmaps, true))) + return -1; + } else { + actual =3D g_strdup("NULL\n"); } - if (!(actual =3D virJSONValueToString(mergebitmaps, true))) - return -1; - return virTestCompareToFile(actual, expectpath); } @@ -1312,6 +1311,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); + TEST_BACKUP_BITMAP_CALCULATE("basic-flat", bitmapSourceChain, "current= ", "basic"); TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, = "d", "basic"); TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "ba= sic"); diff --git a/tests/qemublocktestdata/backupmerge/empty-out.json b/tests/qem= ublocktestdata/backupmerge/empty-out.json new file mode 100644 index 0000000000..7951defec1 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/empty-out.json @@ -0,0 +1 @@ +NULL --=20 2.26.2