On 3/20/20 12:39 PM, Cornelia Huck wrote:
On Wed, 18 Mar 2020 23:27:15 +0100
Philippe Mathieu-Daudé <phi...@redhat.com> wrote:

Similarly to commit 4f370b1098, test-util-sockets fails in
restricted non-x86 Travis containers since they apparently
blacklisted some required system calls there.

Is "they" == "Travis admins"? Can we get them to remove those calls
from the blacklist?

I suppose, I copy/pasted Thomas's description from commit 4f370b1098.

No clue, but we can try :)


(I'm wondering why x86 allows those calls. Probably just because it has
been around for longer.)

Let's simply skip the test if we detect such an environment.

Reviewed-by: Daniel P. Berrangé <berra...@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com>
---
  tests/test-util-sockets.c | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index 5fd947c7bf..046ebec8ba 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -231,11 +231,18 @@ static void test_socket_fd_pass_num_nocli(void)
  int main(int argc, char **argv)
  {
      bool has_ipv4, has_ipv6;
+    char *travis_arch;
socket_init(); g_test_init(&argc, &argv, NULL); + travis_arch = getenv("TRAVIS_CPU_ARCH");
+    if (travis_arch && !g_str_equal(travis_arch, "x86_64")) {
+        g_printerr("Test does not work on non-x86 Travis containers.");
+        goto end;
+    }
+
      /* We're creating actual IPv4/6 sockets, so we should
       * check if the host running tests actually supports
       * each protocol to avoid breaking tests on machines



Reply via email to