From patchwork Sun Jan 14 18:26:47 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: 860497 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=) 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 3zKQ1j0tx8z9s7s for ; Mon, 15 Jan 2018 05:27:04 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 6680DFB2; Sun, 14 Jan 2018 18:27:01 +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 B6C51FAF for ; Sun, 14 Jan 2018 18:27:00 +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 2F48218A for ; Sun, 14 Jan 2018 18:27:00 +0000 (UTC) X-Originating-IP: 86.125.249.173 Received: from localhost.localdomain (unknown [86.125.249.173]) (Authenticated sender: aserdean@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 470E4A80C7; Sun, 14 Jan 2018 19:26:58 +0100 (CET) From: Alin Gabriel Serdean To: dev@openvswitch.org Date: Sun, 14 Jan 2018 20:26:47 +0200 Message-Id: <20180114182647.13736-1-aserdean@ovn.org> X-Mailer: git-send-email 2.10.2.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] ovsdb-client.at: Fix ovsdb-client backup test on Win 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 The test: 1948. ovsdb-client.at:15: testing ovsdb-client backup and restore fails on Windows with: --- /dev/null 2018-01-14 20:09:57 +0200 +++ /c/_2018/january/14/ovs/tests/testsuite.dir/at-groups/1948/stderr @@ -0,0 +1,3 @@ +ovsdb-server: ovsdb error: backup: unexpected file format +ovsdb-server: Failed to read from child (The pipe has been ended. +) ./ovsdb-client.at:111: exit code was 1, expected 0 The root cause is that when redirecting output defaults to the Windows line endings(CRLF): $ file db db: ASCII text, with very long lines $ file backup backup: ASCII text, with very long lines, with CRLF line terminators Add a `dos2unix` command to convert to the line endings expected by ovsdb-server. Signed-off-by: Alin Gabriel Serdean --- tests/ovsdb-client.at | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ovsdb-client.at b/tests/ovsdb-client.at index 467175f..2f1f63b 100644 --- a/tests/ovsdb-client.at +++ b/tests/ovsdb-client.at @@ -49,6 +49,9 @@ AT_CAPTURE_FILE([ovsdb-server.log]) dnl Dump a copy of the data and a backup of it. AT_CHECK([ovsdb-client dump > dump1]) AT_CHECK([ovsdb-client backup > backup]) +if test "$IS_WIN32" = "yes"; then + dos2unix backup +fi dnl Mess up the data a little, verify that it changed, then restore it dnl and verify restoration.