From nobody Sun Feb 8 22:57:53 2026 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.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; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498567661638714.2669548813736; Tue, 27 Jun 2017 05:47:41 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 44E2564D28; Tue, 27 Jun 2017 12:47: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 00CC08A78A; Tue, 27 Jun 2017 12:47: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 9BF771853E30; Tue, 27 Jun 2017 12:47:35 +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 v5RClYKA023870 for ; Tue, 27 Jun 2017 08:47:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1C6088A779; Tue, 27 Jun 2017 12:47:34 +0000 (UTC) Received: from andariel.redhat.com (ovpn-204-24.brq.redhat.com [10.40.204.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC6D8A768; Tue, 27 Jun 2017 12:47:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 44E2564D28 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 44E2564D28 From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 27 Jun 2017 14:46:50 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 9/9] tests: Validate that JSON deflattening fixed nested json pseudo-protocol strings 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 27 Jun 2017 12:47:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Sheepdog and possibly others use nested objects for network server and thus could be specified in a way that libvirt would not parse. Validates that https://bugzilla.redhat.com/show_bug.cgi?id=3D1464821 is fixed properly. Reviewed-by: John Ferlan --- tests/virjsondata/deflatten-qemu-sheepdog-in.json | 11 +++++++++++ tests/virjsondata/deflatten-qemu-sheepdog-out.json | 13 +++++++++++++ tests/virjsontest.c | 1 + tests/virstoragetest.c | 10 ++++++++++ 4 files changed, 35 insertions(+) create mode 100644 tests/virjsondata/deflatten-qemu-sheepdog-in.json create mode 100644 tests/virjsondata/deflatten-qemu-sheepdog-out.json diff --git a/tests/virjsondata/deflatten-qemu-sheepdog-in.json b/tests/virj= sondata/deflatten-qemu-sheepdog-in.json new file mode 100644 index 000000000..7c0286300 --- /dev/null +++ b/tests/virjsondata/deflatten-qemu-sheepdog-in.json @@ -0,0 +1,11 @@ +{ + "driver": "raw", + "file": { + "server.host": "10.10.10.10", + "server.port": "7000", + "tag": "", + "driver": "sheepdog", + "server.type": "inet", + "vdi": "Alice" + } +} diff --git a/tests/virjsondata/deflatten-qemu-sheepdog-out.json b/tests/vir= jsondata/deflatten-qemu-sheepdog-out.json new file mode 100644 index 000000000..258b44a76 --- /dev/null +++ b/tests/virjsondata/deflatten-qemu-sheepdog-out.json @@ -0,0 +1,13 @@ +{ + "driver": "raw", + "file": { + "server": { + "host": "10.10.10.10", + "port": "7000", + "type": "inet" + }, + "tag": "", + "driver": "sheepdog", + "vdi": "Alice" + } +} diff --git a/tests/virjsontest.c b/tests/virjsontest.c index b3ce6591a..5f89a3e1c 100644 --- a/tests/virjsontest.c +++ b/tests/virjsontest.c @@ -521,6 +521,7 @@ mymain(void) DO_TEST_DEFLATTEN("double-key", false); DO_TEST_DEFLATTEN("concat", true); DO_TEST_DEFLATTEN("concat-double-key", false); + DO_TEST_DEFLATTEN("qemu-sheepdog", true); return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index f34408395..90fcf36ca 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -1575,6 +1575,16 @@ mymain(void) "\n" " \n" "\n"); + TEST_BACKING_PARSE("json:{\"driver\": \"raw\"," + "\"file\": {\"server.host\": \"10.10.10.10\"," + "\"server.port\": \"7000\"," + "\"tag\": \"\"," + "\"driver\": \"sheepdog\"," + "\"server.type\": \"inet\"," + "\"vdi\": \"Alice\"}}", + "\n" + " \n" + "\n"); #endif /* WITH_YAJL */ cleanup: --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list