diff mbox

[ovs-dev,V2,02/10] python tests: Skip python tests that kill the python daemon

Message ID 508339EC0242094682895ED3EC4EBA312E57177A@CBSEX1.cloudbase.local
State Not Applicable
Delegated to: Guru Shetty
Headers show

Commit Message

Paul Boca Aug. 31, 2016, 7:45 a.m. UTC
Hi Guru,

There are other tests that check if the daemon is running fine.
In my opinion we could skip this test on Windows and let it on Linux to run.

Paul

From: Guru Shetty [mailto:guru@ovn.org]

Sent: Tuesday, August 30, 2016 6:18 PM
To: Paul Boca
Cc: dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH V2 02/10] python tests: Skip python tests that kill the python daemon



On 30 August 2016 at 05:00, Paul Boca <pboca@cloudbasesolutions.com<mailto:pboca@cloudbasesolutions.com>> wrote:
If the python script is killed with `kill` command, the atexit
handler doesn't gets executed on Windows.
The kill of the process is done using NtTerminateProcess which
doesn't sends a signal to the process itself, if just terminates the process
from kernel mode.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com<mailto:pboca@cloudbasesolutions.com>>


Instead of skipping the test, why not just skip the line that tests for pid after the process is killed. I imagine that the test is still useful in other respects, like whether detach works fine?

---
V2: Initial commit
---
 tests/daemon-py.at<http://daemon-py.at> | 2 ++
 1 file changed, 2 insertions(+)

--
2.7.2.windows.1
_______________________________________________
dev mailing list
dev@openvswitch.org<mailto:dev@openvswitch.org>
http://openvswitch.org/mailman/listinfo/dev

Comments

Gurucharan Shetty Aug. 31, 2016, 6:05 p.m. UTC | #1
On 31 August 2016 at 00:45, Paul Boca <pboca@cloudbasesolutions.com> wrote:

> Hi Guru,
>
>
>
> There are other tests that check if the daemon is running fine.
>
> In my opinion we could skip this test on Windows and let it on Linux to
> run.
>

All right. I applied this.

>
>
> Paul
>
>
>
> *From:* Guru Shetty [mailto:guru@ovn.org]
> *Sent:* Tuesday, August 30, 2016 6:18 PM
> *To:* Paul Boca
> *Cc:* dev@openvswitch.org
> *Subject:* Re: [ovs-dev] [PATCH V2 02/10] python tests: Skip python tests
> that kill the python daemon
>
>
>
>
>
>
>
> On 30 August 2016 at 05:00, Paul Boca <pboca@cloudbasesolutions.com>
> wrote:
>
> If the python script is killed with `kill` command, the atexit
> handler doesn't gets executed on Windows.
> The kill of the process is done using NtTerminateProcess which
> doesn't sends a signal to the process itself, if just terminates the
> process
> from kernel mode.
>
> Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
>
>
>
> Instead of skipping the test, why not just skip the line that tests for
> pid after the process is killed. I imagine that the test is still useful in
> other respects, like whether detach works fine?
>
>
>
> ---
> V2: Initial commit
> ---
>  tests/daemon-py.at | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/daemon-py.at b/tests/daemon-py.at
> index 96dea07..11833c8 100644
> --- a/tests/daemon-py.at
> +++ b/tests/daemon-py.at
> @@ -126,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 pid file not removed if the daemon
> is killed
> +   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
> --
> 2.7.2.windows.1
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
>
>
diff mbox

Patch

diff --git a/tests/daemon-py.at<http://daemon-py.at> b/tests/daemon-py.at<http://daemon-py.at>
index 96dea07..11833c8 100644
--- a/tests/daemon-py.at<http://daemon-py.at>
+++ b/tests/daemon-py.at<http://daemon-py.at>
@@ -126,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 pid file not removed if the daemon is killed
+   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