From nobody Mon Feb 9 07:56:00 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.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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554219831285329.2193317822024; Tue, 2 Apr 2019 08:43:51 -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 3035A30715CA; Tue, 2 Apr 2019 15:43:50 +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 0639E6248C; Tue, 2 Apr 2019 15:43:50 +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 B1A0E4EE07; Tue, 2 Apr 2019 15:43:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x32FgNaR012256 for ; Tue, 2 Apr 2019 11:42:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 85AC75C21A; Tue, 2 Apr 2019 15:42:23 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C5015C237 for ; Tue, 2 Apr 2019 15:42:22 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 2 Apr 2019 17:41:52 +0200 Message-Id: <88a6144e77524965a22c9431953971da7e967871.1554219669.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 13/14] vvv SQUASH HERE: reformat parseFile output data 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.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 02 Apr 2019 15:43:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Remove trailing slashes and call json_reformat --- tests/virjsondata/parse-Harder-out.json | 17 +- tests/virjsondata/parse-NotSoSimple-out.json | 18 +- tests/virjsondata/parse-Simple-out.json | 7 +- tests/virjsondata/parse-VeryHard-out.json | 167 ++++++++++++++++--- 4 files changed, 177 insertions(+), 32 deletions(-) diff --git a/tests/virjsondata/parse-Harder-out.json b/tests/virjsondata/pa= rse-Harder-out.json index 31b3edd731..1cdac1f0c9 100644 --- a/tests/virjsondata/parse-Harder-out.json +++ b/tests/virjsondata/parse-Harder-out.json @@ -1,4 +1,13 @@ -{"return":[{"filename":\ -"unix:/home/berrange/.libvirt/qemu/lib/tck.monitor,server",\ -"label":"charmonitor"},{"filename":"pty:/dev/pts/158",\ -"label":"charserial0"}],"id":"libvirt-3"} +{ + "return": [ + { + "filename": "unix:/home/berrange/.libvirt/qemu/lib/tck.monitor= ,server", + "label": "charmonitor" + }, + { + "filename": "pty:/dev/pts/158", + "label": "charserial0" + } + ], + "id": "libvirt-3" +} diff --git a/tests/virjsondata/parse-NotSoSimple-out.json b/tests/virjsonda= ta/parse-NotSoSimple-out.json index e679cd1813..c6553b74af 100644 --- a/tests/virjsondata/parse-NotSoSimple-out.json +++ b/tests/virjsondata/parse-NotSoSimple-out.json @@ -1,3 +1,15 @@ -{"QMP":{"version":{"qemu":\ -{"micro":91,"minor":13,"major":0},\ -"package":" (qemu-kvm-devel)"},"capabilities":[]}} +{ + "QMP": { + "version": { + "qemu": { + "micro": 91, + "minor": 13, + "major": 0 + }, + "package": " (qemu-kvm-devel)" + }, + "capabilities": [ + + ] + } +} diff --git a/tests/virjsondata/parse-Simple-out.json b/tests/virjsondata/pa= rse-Simple-out.json index c6e85e1ceb..167bdccdf8 100644 --- a/tests/virjsondata/parse-Simple-out.json +++ b/tests/virjsondata/parse-Simple-out.json @@ -1 +1,6 @@ -{"return":{},"id":"libvirt-1"} +{ + "return": { + + }, + "id": "libvirt-1" +} diff --git a/tests/virjsondata/parse-VeryHard-out.json b/tests/virjsondata/= parse-VeryHard-out.json index e10d605950..dc64fc1661 100644 --- a/tests/virjsondata/parse-VeryHard-out.json +++ b/tests/virjsondata/parse-VeryHard-out.json @@ -1,24 +1,143 @@ -{"return":[{"name":"quit"},{"name":\ -"eject"},{"name":"change"},{"name":"screendump"},\ -{"name":"stop"},{"name":"cont"},{"name":\ -"system_reset"},{"name":"system_powerdown"},\ -{"name":"device_add"},{"name":"device_del"},\ -{"name":"cpu"},{"name":"memsave"},{"name":\ -"pmemsave"},{"name":"migrate"},{"name":\ -"migrate_cancel"},{"name":"migrate_set_speed"},\ -{"name":"client_migrate_info"},{"name":\ -"migrate_set_downtime"},{"name":"netdev_add"},\ -{"name":"netdev_del"},{"name":"block_resize"},\ -{"name":"balloon"},{"name":"set_link"},{"name":\ -"getfd"},{"name":"closefd"},{"name":"block_passwd"},\ -{"name":"set_password"},{"name":"expire_password"},\ -{"name":"qmp_capabilities"},{"name":\ -"human-monitor-command"},{"name":"query-version"},\ -{"name":"query-commands"},{"name":"query-chardev"},\ -{"name":"query-block"},{"name":"query-blockstats"},\ -{"name":"query-cpus"},{"name":"query-pci"},{"name":\ -"query-kvm"},{"name":"query-status"},{"name":\ -"query-mice"},{"name":"query-vnc"},{"name":\ -"query-spice"},{"name":"query-name"},{"name":\ -"query-uuid"},{"name":"query-migrate"},{"name":\ -"query-balloon"}],"id":"libvirt-2"} +{ + "return": [ + { + "name": "quit" + }, + { + "name": "eject" + }, + { + "name": "change" + }, + { + "name": "screendump" + }, + { + "name": "stop" + }, + { + "name": "cont" + }, + { + "name": "system_reset" + }, + { + "name": "system_powerdown" + }, + { + "name": "device_add" + }, + { + "name": "device_del" + }, + { + "name": "cpu" + }, + { + "name": "memsave" + }, + { + "name": "pmemsave" + }, + { + "name": "migrate" + }, + { + "name": "migrate_cancel" + }, + { + "name": "migrate_set_speed" + }, + { + "name": "client_migrate_info" + }, + { + "name": "migrate_set_downtime" + }, + { + "name": "netdev_add" + }, + { + "name": "netdev_del" + }, + { + "name": "block_resize" + }, + { + "name": "balloon" + }, + { + "name": "set_link" + }, + { + "name": "getfd" + }, + { + "name": "closefd" + }, + { + "name": "block_passwd" + }, + { + "name": "set_password" + }, + { + "name": "expire_password" + }, + { + "name": "qmp_capabilities" + }, + { + "name": "human-monitor-command" + }, + { + "name": "query-version" + }, + { + "name": "query-commands" + }, + { + "name": "query-chardev" + }, + { + "name": "query-block" + }, + { + "name": "query-blockstats" + }, + { + "name": "query-cpus" + }, + { + "name": "query-pci" + }, + { + "name": "query-kvm" + }, + { + "name": "query-status" + }, + { + "name": "query-mice" + }, + { + "name": "query-vnc" + }, + { + "name": "query-spice" + }, + { + "name": "query-name" + }, + { + "name": "query-uuid" + }, + { + "name": "query-migrate" + }, + { + "name": "query-balloon" + } + ], + "id": "libvirt-2" +} --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list