From patchwork Tue Jul 26 12:01:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Boca X-Patchwork-Id: 652727 X-Patchwork-Delegate: guru@ovn.org 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 3rzGyB73zCz9t15 for ; Tue, 26 Jul 2016 22:04:34 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 419BB10B3D; Tue, 26 Jul 2016 05:04:34 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 7775710AF2 for ; Tue, 26 Jul 2016 05:04:33 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 0CA0F1E03A9 for ; Tue, 26 Jul 2016 06:04:33 -0600 (MDT) X-ASG-Debug-ID: 1469534672-09eadd464958e320001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id vcU14Q5xLcKrbO3Q (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 26 Jul 2016 06:04:32 -0600 (MDT) X-Barracuda-Envelope-From: pboca@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx3-pf2.cudamail.com with SMTP; 26 Jul 2016 12:04:31 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at cloudbasesolutions.com designates 91.232.152.5 as permitted sender) X-Barracuda-Apparent-Source-IP: 91.232.152.5 X-Barracuda-RBL-IP: 91.232.152.5 Received: from localhost (localhost [127.0.0.1]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 7860F409C9 for ; Tue, 26 Jul 2016 15:04:30 +0300 (EEST) X-Virus-Scanned: amavisd-new at cloudbasesolutions.com Received: from cbssmtp1.cloudbase.local ([127.0.0.1]) by localhost (cbssmtp1.cloudbase.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B8V_qiJc1z3A for ; Tue, 26 Jul 2016 15:04:10 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 41CD1409BB for ; Tue, 26 Jul 2016 15:01:11 +0300 (EEST) Received: from CBSEX1.cloudbase.local ([10.77.78.3]) by CBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0301.000; Tue, 26 Jul 2016 14:01:11 +0200 X-CudaMail-Envelope-Sender: pboca@cloudbasesolutions.com From: Paul Boca To: "dev@openvswitch.org" X-CudaMail-MID: CM-V2-725006536 X-CudaMail-DTE: 072616 X-CudaMail-Originating-IP: 91.232.152.5 Thread-Topic: [PATCH V9 08/17] python tests: Skip python tests on Windows where POSIX pid is used X-ASG-Orig-Subj: [##CM-V2-725006536##][PATCH V9 08/17] python tests: Skip python tests on Windows where POSIX pid is used Thread-Index: AQHR5zVmcBoODfjp40Wezp7l/npaWw== Date: Tue, 26 Jul 2016 12:01:10 +0000 Message-ID: <1469534454-7672-9-git-send-email-pboca@cloudbasesolutions.com> References: <1469534454-7672-1-git-send-email-pboca@cloudbasesolutions.com> In-Reply-To: <1469534454-7672-1-git-send-email-pboca@cloudbasesolutions.com> Accept-Language: en-US, it-IT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.78.1] MIME-Version: 1.0 X-GBUdb-Analysis: 0, 91.232.152.5, Ugly c=0.36638 p=-0.485714 Source Normal X-MessageSniffer-Rules: 0-0-0-9826-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1469534672 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA 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.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31531 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Subject: [ovs-dev] [PATCH V9 08/17] python tests: Skip python tests on Windows where POSIX pid is used 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" There is a difference between POSIX pid and Windows pid, not all the time are equal. On Windows when a python script is started, a sh command is triggered as the parent for script. So when we try to get the daemon pid with 'echo $!', this will get the pid of sh not of python.exe as expected. Also the 'kill' command expects a POSIX pid, not the Windows pid written by the python daemons in pid file. Signed-off-by: Paul-Daniel Boca Acked-by: Alin Gabriel Serdean --- V2: No changes V3: No changes V4: No changes V5: No changes V6: No changes V7: Added comments explaining why the tests are skipped. Enabled back the JSON-RPC tests V8: No changes V9: No changes --- tests/daemon-py.at | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/daemon-py.at b/tests/daemon-py.at index e59c11d..b1ff4fd 100644 --- a/tests/daemon-py.at +++ b/tests/daemon-py.at @@ -3,6 +3,8 @@ AT_BANNER([daemon unit tests - Python]) m4_define([DAEMON_PYN], [AT_SETUP([daemon - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_KEYWORDS([python daemon]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([expected]) @@ -26,6 +28,8 @@ DAEMON_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) m4_define([DAEMON_MONITOR_PYN], [AT_SETUP([daemon --monitor - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([parent]) AT_CAPTURE_FILE([parentpid]) @@ -73,6 +77,8 @@ DAEMON_MONITOR_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) m4_define([DAEMON_MONITOR_RESTART_PYN], [AT_SETUP([daemon --monitor restart exit code - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([parent]) AT_CAPTURE_FILE([parentpid]) @@ -120,6 +126,8 @@ DAEMON_MONITOR_RESTART_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) m4_define([DAEMON_DETACH_PYN], [AT_SETUP([daemon --detach - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) # Start the daemon and make sure that the pidfile exists immediately. # We don't wait for the pidfile to get created because the daemon is @@ -142,6 +150,8 @@ m4_define([CHECK], m4_define([DAEMON_DETACH_MONITOR_PYN], [AT_SETUP([daemon --detach --monitor - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([daemon]) AT_CAPTURE_FILE([olddaemon]) AT_CAPTURE_FILE([newdaemon]) @@ -219,6 +229,8 @@ DAEMON_DETACH_MONITOR_ERRORS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) m4_define([DAEMON_DETACH_CLOSES_FDS_PYN], [AT_SETUP([daemon --detach closes standard fds - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([status]) AT_CAPTURE_FILE([stderr]) @@ -243,6 +255,8 @@ DAEMON_DETACH_CLOSES_FDS_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3]) m4_define([DAEMON_DETACH_MONITOR_CLOSES_FDS_PYN], [AT_SETUP([daemon --detach --monitor closes standard fds - $1]) AT_SKIP_IF([test $2 = no]) + # Skip this test for Windows, echo $! gives shell pid instead of parent process + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([status]) AT_CAPTURE_FILE([stderr])