From patchwork Mon Aug 15 00:48:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 659085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3sCH103VkVz9t1C for ; Mon, 15 Aug 2016 10:48:34 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id EE7881087B; Sun, 14 Aug 2016 17:48:32 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 2EB8310879 for ; Sun, 14 Aug 2016 17:48:32 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 3EA0F1631E7 for ; Sun, 14 Aug 2016 18:48:31 -0600 (MDT) X-ASG-Debug-ID: 1471222109-0b32377fd714c50001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id JCdxyhUXAF2W7z0E (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 14 Aug 2016 18:48:29 -0600 (MDT) X-Barracuda-Envelope-From: ryanmoats@ryans-macbook-pro-4.local X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO fed1rmfepo202.cox.net) (68.230.241.147) by mx1-pf1.cudamail.com with SMTP; 15 Aug 2016 00:48:29 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at ryans-macbook-pro-4.local does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 68.230.241.147 X-Barracuda-RBL-IP: 68.230.241.147 Received: from fed1rmimpo209.cox.net ([68.230.241.160]) by fed1rmfepo202.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160815004828.RWKX1413.fed1rmfepo202.cox.net@fed1rmimpo209.cox.net> for ; Sun, 14 Aug 2016 20:48:28 -0400 Received: from Ryans-MacBook-Pro-4.local ([68.13.99.247]) by fed1rmimpo209.cox.net with cox id XCoT1t00Q5LF6cs01CoTnE; Sun, 14 Aug 2016 20:48:28 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090203.57B1115C.0039, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=KNj6dAxo c=1 sm=1 tr=0 a=Jmqd6mthTashISSy/JkQqg==:117 a=Jmqd6mthTashISSy/JkQqg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=VnNF1IyMAAAA:8 a=3-jnNgDIC9TwDLYiR98A:9 a=skCgnbhlp52w9zbo2JeP:22 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: by Ryans-MacBook-Pro-4.local (Postfix, from userid 501) id D24EE6730B8; Sun, 14 Aug 2016 19:48:26 -0500 (CDT) X-CudaMail-Envelope-Sender: ryanmoats@ryans-macbook-pro-4.local From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-E1-813022539 X-CudaMail-DTE: 081416 X-CudaMail-Originating-IP: 68.230.241.147 Date: Sun, 14 Aug 2016 19:48:24 -0500 X-ASG-Orig-Subj: [##CM-E1-813022539##][PATCH] Simplify partial map Py3 IDL test added by commit a59912a0 Message-Id: <1471222104-64744-1-git-send-email-rmoats@us.ibm.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1471222109 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32016 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] Simplify partial map Py3 IDL test added by commit a59912a0 X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Commit a59912a0 ("python: Add support for partial map and partial set updates") added unit tests for the partial map function for the python IDL. However, because Python3 doesn't order dictionaries consistently, this test is a crap shoot for systems that support Python3. As a short term fix, do not use a dictionary with multiple elements for the partial map test case. Change-Id: Ibdec10ebd895051321b9bff7d9fe8a7e0bd9eb88 Signed-off-by: Ryan Moats --- tests/ovsdb-idl.at | 8 ++++---- tests/test-ovsdb.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at index c61d2e7..b2899b6 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -1110,14 +1110,14 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-c OVSDB_CHECK_IDL_PY([partial-map idl], [['["idltest", {"op":"insert", "table":"simple2", - "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]'] + "row":{"name":"myString1","smap":["map",[["key1","value1"]]]} }]'] ], [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapdelelement'], -[[000: name=myString1 smap={key2: value2 key1: value1} imap={} +[[000: name=myString1 smap={key1: value1} imap={} 001: commit, status=success -002: name=String2 smap={key2: value2 key1: myList1} imap={3: myids2} +002: name=String2 smap={key1: myList1} imap={3: myids2} 003: commit, status=success -004: name=String2 smap={key1: myList1} imap={3: myids2} +004: name=String2 smap={} imap={3: myids2} 005: done ]]) diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py index 86f0168..2ea2bd5 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -450,7 +450,7 @@ def idl_set(idl, commands, step): row.__setattr__('name', 'String2') elif name == 'partialmapdelelement': row = idltest_find_simple2(idl, 'String2') - row.delkey('smap', 'key2', 'value2') + row.delkey('smap', 'key1', 'myList1') elif name == 'partialrenamesetadd': row = idltest_find_simple3(idl, 'mySet1') row.addvalue('uset',