diff options
author | Paul Boca <pboca@cloudbasesolutions.com> | 2016-08-30 12:00:57 +0000 |
---|---|---|
committer | Gurucharan Shetty <guru@ovn.org> | 2016-08-30 08:13:10 -0700 |
commit | fef32d76d36ae1ec6092ce42e7ad97b4051ee5ab (patch) | |
tree | 8215d9558b22d7d70e64311545e9050712106e4b | |
parent | 54b78c9501f7887e1a2d6290ef1d44ee42a9222f (diff) | |
download | openvswitch-fef32d76d36ae1ec6092ce42e7ad97b4051ee5ab.tar.gz |
python tests: Skip python tests specific to Linux.
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 <pboca@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
-rw-r--r-- | tests/daemon-py.at | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/daemon-py.at b/tests/daemon-py.at index e59c11d4b..96dea07c3 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]) @@ -142,6 +148,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 +227,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 +253,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]) |