Skip to contentSkip to conversation

tests/qtest/netdev-socket: Do not test multicast on Darwin

PATCH In review Philippe Mathieu-Daudé 2 participants 4 messages Sep 18, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest/netdev-socket: Do not test multicast on Darwin

Do not run this test on Darwin, otherwise we get:

qemu-system-arm: -netdev dgram,id=st0,remote.type=inet,remote.host=230.0.0.1,remote.port=1234: can't add socket to multicast group 230.0.0.1: Can't assign requested address Broken pipe
../../tests/qtest/libqtest.c:191: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
Abort trap: 6

---
 tests/qtest/netdev-socket.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/netdev-socket.c +4 -2
index 8eed54801f..3fc2ac26d0 100644
@@ -401,7 +401,7 @@ static void test_dgram_inet(void)
     qtest_quit(qts0);
 }
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
 static void test_dgram_mcast(void)
 {
     QTestState *qts;
@@ -414,7 +414,9 @@ static void test_dgram_mcast(void)
 
     qtest_quit(qts);
 }
+#endif
 
+#ifndef _WIN32
 static void test_dgram_unix(void)
 {
     QTestState *qts0, *qts1;
@@ -511,7 +513,7 @@ int main(int argc, char **argv)
     if (has_ipv4) {
         qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
         qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
         qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
 #endif
     }
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines · Philippe Mathieu-Daudé

Do not run this test on Darwin, otherwise we get:

qemu-system-arm: -netdev dgram,id=st0,remote.type=inet,remote.host=230.0.0.1,remote.port=1234: can't add socket to multicast group 230.0.0.1: Can't assign requested address Broken pipe
../../tests/qtest/libqtest.c:191: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
Abort trap: 6

---
  tests/qtest/netdev-socket.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/netdev-socket.c +3 -1
index 8eed54801f..3fc2ac26d0 100644
@@ -401,7 +401,7 @@ static void test_dgram_inet(void)
      qtest_quit(qts0);
  }
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
  static void test_dgram_mcast(void)
  {
      QTestState *qts;
@@ -414,7 +414,9 @@ static void test_dgram_mcast(void)
 
      qtest_quit(qts);
  }
+#endif
 
+#ifndef _WIN32
  static void test_dgram_unix(void)
  {
      QTestState *qts0, *qts1;

tests/qtest/netdev-socket.c int main(int argc, char **argv) · line 519

Quoted 8 lines
tests/qtest/netdev-socket.c +1 -1
@@ -511,7 +513,7 @@ int main(int argc, char **argv)
      if (has_ipv4) {
          qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
          qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
          qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
  #endif
      }

I'll queue this for my next pull request.

#2 lore raw
Quoted 14 lines · Thomas Huth
Quoted 11 lines · Philippe Mathieu-Daudé

Do not run this test on Darwin, otherwise we get:

   qemu-system-arm: -netdev dgram,id=st0,remote.type=inet,remote.host=230.0.0.1,remote.port=1234: can't add socket to multicast group 230.0.0.1: Can't assign requested address Broken pipe
   ../../tests/qtest/libqtest.c:191: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
   Abort trap: 6

---
  tests/qtest/netdev-socket.c | 6 ++++--

  1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 3 lines

I'll queue this for my next pull request.

Great, thank you Thomas!

#3 lore raw
In reply to Philippe Mathieu-Daudé

I just noticed Jason wasn't Cc'ed. Assuming this test belongs to "Network device backends", Cc'ing him. (Should we add the test entry in MAINTAINERS?)

Quoted 44 lines · Philippe Mathieu-Daudé

Do not run this test on Darwin, otherwise we get:

qemu-system-arm: -netdev dgram,id=st0,remote.type=inet,remote.host=230.0.0.1,remote.port=1234: can't add socket to multicast group 230.0.0.1: Can't assign requested address Broken pipe
../../tests/qtest/libqtest.c:191: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
Abort trap: 6

---
  tests/qtest/netdev-socket.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/netdev-socket.c +4 -2
index 8eed54801f..3fc2ac26d0 100644
@@ -401,7 +401,7 @@ static void test_dgram_inet(void)
      qtest_quit(qts0);
  }
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
  static void test_dgram_mcast(void)
  {
      QTestState *qts;
@@ -414,7 +414,9 @@ static void test_dgram_mcast(void)
 
      qtest_quit(qts);
  }
+#endif
 
+#ifndef _WIN32
  static void test_dgram_unix(void)
  {
      QTestState *qts0, *qts1;
@@ -511,7 +513,7 @@ int main(int argc, char **argv)
      if (has_ipv4) {
          qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
          qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
          qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
  #endif
      }