Skip to content

Commit

Permalink
tests: Run filter-redirector and -mirror test only on POSIX systems
Browse files Browse the repository at this point in the history
This way we can get rid of the ugly #ifdefs in the code which makes
it easier to extend later.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <1502951113-4246-2-git-send-email-thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
huth authored and cohuck committed Aug 30, 2017
1 parent b1b2fea commit 7f57d58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
8 changes: 4 additions & 4 deletions tests/Makefile.include
Expand Up @@ -283,8 +283,8 @@ ifeq ($(CONFIG_VHOST_USER_NET_TEST_i386),)
check-qtest-x86_64-$(CONFIG_VHOST_USER_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF)
endif
check-qtest-i386-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
check-qtest-i386-y += tests/test-filter-mirror$(EXESUF)
check-qtest-i386-y += tests/test-filter-redirector$(EXESUF)
check-qtest-i386-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
check-qtest-i386-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF)
check-qtest-i386-y += tests/postcopy-test$(EXESUF)
check-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF)
check-qtest-i386-y += tests/numa-test$(EXESUF)
Expand Down Expand Up @@ -325,8 +325,8 @@ check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
gcov-files-ppc64-y += hw/usb/hcd-xhci.c
check-qtest-ppc64-y += $(check-qtest-virtio-y)
check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF)
check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
check-qtest-ppc64-y += tests/numa-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_IVSHMEM) += tests/ivshmem-test$(EXESUF)
Expand Down
5 changes: 0 additions & 5 deletions tests/test-filter-mirror.c
Expand Up @@ -17,9 +17,6 @@

static void test_mirror(void)
{
#ifndef _WIN32
/* socketpair(PF_UNIX) which does not exist on windows */

int send_sock[2], recv_sock;
char *cmdline;
uint32_t ret = 0, len = 0;
Expand Down Expand Up @@ -74,8 +71,6 @@ static void test_mirror(void)
g_free(recv_buf);
close(recv_sock);
unlink(sock_path);

#endif
}

int main(int argc, char **argv)
Expand Down
10 changes: 0 additions & 10 deletions tests/test-filter-redirector.c
Expand Up @@ -59,9 +59,6 @@

static void test_redirector_tx(void)
{
#ifndef _WIN32
/* socketpair(PF_UNIX) which does not exist on windows */

int backend_sock[2], recv_sock;
char *cmdline;
uint32_t ret = 0, len = 0;
Expand Down Expand Up @@ -129,15 +126,10 @@ static void test_redirector_tx(void)
unlink(sock_path0);
unlink(sock_path1);
qtest_end();

#endif
}

static void test_redirector_rx(void)
{
#ifndef _WIN32
/* socketpair(PF_UNIX) which does not exist on windows */

int backend_sock[2], send_sock;
char *cmdline;
uint32_t ret = 0, len = 0;
Expand Down Expand Up @@ -203,8 +195,6 @@ static void test_redirector_rx(void)
unlink(sock_path0);
unlink(sock_path1);
qtest_end();

#endif
}

int main(int argc, char **argv)
Expand Down

0 comments on commit 7f57d58

Please sign in to comment.