From patchwork Thu Mar 8 00:24:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin-Gabriel Serdean X-Patchwork-Id: 882879 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zxWVD4RHZz9sgw for ; Thu, 8 Mar 2018 11:24:36 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2C5CAEED; Thu, 8 Mar 2018 00:24:35 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8FCCCEE9 for ; Thu, 8 Mar 2018 00:24:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E25E35D4 for ; Thu, 8 Mar 2018 00:24:32 +0000 (UTC) X-Originating-IP: 85.186.139.13 Received: from localhost.localdomain (unknown [85.186.139.13]) (Authenticated sender: aserdean@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 1467EA80C6; Thu, 8 Mar 2018 01:24:30 +0100 (CET) From: Alin Gabriel Serdean To: dev@openvswitch.org Date: Thu, 8 Mar 2018 02:24:19 +0200 Message-Id: <20180308002419.12520-1-aserdean@ovn.org> X-Mailer: git-send-email 2.16.1.windows.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Alin Gabriel Serdean Subject: [ovs-dev] [PATCH v2] tests-windows: Make flow extractor work on Windows X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org +Traceback (most recent call last): + File "../.././flowgen.py", line 204, in + flows = os.fdopen(3, 'wb') +OSError: [Errno 9] Bad file descriptor ./library.at:4: exit code was 1, expected 0 Unfortunately 3/4/5/.. FDs don't work on Windows. Switch to a filename open instead of opening the FDs. Signed-off-by: Alin Gabriel Serdean Acked-by: Ben Pfaff Acked-by: Ben Pfaff --- tests/flowgen.py | 5 ++--- tests/library.at | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/flowgen.py b/tests/flowgen.py index 221a8f2bc..976fe7a97 100755 --- a/tests/flowgen.py +++ b/tests/flowgen.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import socket import struct @@ -201,8 +200,8 @@ def output(attrs): packets.write(packet) -flows = os.fdopen(3, 'wb') -packets = os.fdopen(4, 'wb') +flows = open('flows', 'wb') +packets = open('pcap', 'wb') # Print pcap file header. packets.write(struct.pack('>LHHLLLL', diff --git a/tests/library.at b/tests/library.at index 5efbfbb7c..5bfea2f69 100644 --- a/tests/library.at +++ b/tests/library.at @@ -1,7 +1,7 @@ AT_BANNER([library unit tests]) AT_SETUP([flow extractor]) -AT_CHECK([$PYTHON $srcdir/flowgen.py >/dev/null 3>flows 4>pcap]) +AT_CHECK([$PYTHON $srcdir/flowgen.py >/dev/null]) AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors ]) AT_CLEANUP