From patchwork Mon Aug 29 16:13:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Boca X-Patchwork-Id: 663721 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 3sNGsx5Pjyz9sBg for ; Tue, 30 Aug 2016 02:13:40 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 61955102FC; Mon, 29 Aug 2016 09:13:36 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 6BC7F102FB for ; Mon, 29 Aug 2016 09:13:35 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id D005F4203EA for ; Mon, 29 Aug 2016 10:13:34 -0600 (MDT) X-ASG-Debug-ID: 1472487211-09eadd3ce61f220001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id k0mL7o9OCtw18vo2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Aug 2016 10:13:31 -0600 (MDT) X-Barracuda-Envelope-From: pboca@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx1-pf1.cudamail.com with SMTP; 29 Aug 2016 16:13:31 -0000 Received-SPF: pass (mx1-pf1.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 E48A040D18; Mon, 29 Aug 2016 19:13:29 +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 eNIvxIYn-_Dv; Mon, 29 Aug 2016 19:13:09 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 2B1BD40275; Mon, 29 Aug 2016 19:13:09 +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; Mon, 29 Aug 2016 18:13:09 +0200 X-CudaMail-Envelope-Sender: pboca@cloudbasesolutions.com From: Paul Boca To: Guru Shetty X-CudaMail-MID: CM-E1-828033085 X-CudaMail-DTE: 082916 X-CudaMail-Originating-IP: 91.232.152.5 Thread-Topic: [ovs-dev] [PATCH 01/12] python tests: Skip python tests specific to Linux X-ASG-Orig-Subj: [##CM-E1-828033085##]RE: [ovs-dev] [PATCH 01/12] python tests: Skip python tests specific to Linux Thread-Index: AQHR/6e9W8vWOF0bZ0yY919ciJ9a16BbYIsAgAS/oOA= Date: Mon, 29 Aug 2016 16:13:08 +0000 Message-ID: <508339EC0242094682895ED3EC4EBA312E57121B@CBSEX1.cloudbase.local> References: <1472222398-5780-1-git-send-email-pboca@cloudbasesolutions.com> <1472222398-5780-2-git-send-email-pboca@cloudbasesolutions.com> In-Reply-To: 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-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1472487211 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.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=BSF_SC0_MISMATCH_TO, HTML_MESSAGE, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32425 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 HTML_MESSAGE BODY: HTML included in message 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: "dev@openvswitch.org" Subject: Re: [ovs-dev] [PATCH 01/12] python tests: Skip python tests specific to Linux 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" Hi Guru, please see my comment inline. Thanks, Paul From: Guru Shetty [mailto:guru@ovn.org] Sent: Friday, August 26, 2016 8:39 PM To: Paul Boca Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH 01/12] python tests: Skip python tests specific to Linux On 26 August 2016 at 07:40, Paul Boca > wrote: 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. Some tests use undefined switches, on Windows, for `kill` command. Signed-off-by: Paul-Daniel Boca > --- tests/daemon-py.at | 14 ++++++++++++++ 1 file changed, 14 insertions(+) and I found this bug http://bugs.python.org/issue26350. The test fails because the pid file isn’t delelted on detached process exit. I will update that description. + 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, uses Linux specific kill signal + 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, uses Linux specific kill signal + 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, uses Linux specific kill signal + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([status]) AT_CAPTURE_FILE([stderr]) -- 2.7.2.windows.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev diff --git a/tests/daemon-py.at b/tests/daemon-py.at index e59c11d..99ad038 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, the detached process isn't visible in msys Can you explain what the above means? Glancing at the test tells me that something similar works for C code. Why is python different? It may make sense to make this as part of a separate commit. [Paul Boca] I wrote that explanation because I didn’t saw the PID of the child process in `ps`. I debugged a little and observed that the SIGTERM handler isn’t executed on Windows