After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 686058 - OpenBSD: disable ipv6_v4mapped test
OpenBSD: disable ipv6_v4mapped test
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.34.x
Other OpenBSD
: Normal trivial
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-10-12 20:45 UTC by Antoine Jacoutot
Modified: 2013-01-09 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
disable ipv6_v4mapped test on OpenBSD (1012 bytes, patch)
2012-10-12 20:45 UTC, Antoine Jacoutot
none Details | Review
force ipv6_v4mapped to pass on connection refused (1.14 KB, patch)
2012-10-19 13:41 UTC, Antoine Jacoutot
needs-work Details | Review
force pass even if we don't speak IPv4 (1006 bytes, patch)
2013-01-08 10:13 UTC, Antoine Jacoutot
reviewed Details | Review
force pass even if we don't speak IPv4-mapped (1.34 KB, patch)
2013-01-09 15:02 UTC, Antoine Jacoutot
accepted-commit_now Details | Review

Description Antoine Jacoutot 2012-10-12 20:45:53 UTC
Created attachment 226354 [details] [review]
disable ipv6_v4mapped test on OpenBSD

Hi.

IPv6 mapped addresses are not and will never be supported on OpenBSD.
So disable the regression test accordingly and output a small informational message.

Thoughts?
Comment 1 Dan Winship 2012-10-15 11:59:06 UTC
Hm... so OpenBSD has the defines but doesn't implement the behavior? I think it would be better to just have the test deal with getting back EOPNOTSUPP or whatever, and consider that a passing result as well (with no #ifdef OpenBSD at all).
Comment 2 Antoine Jacoutot 2012-10-19 13:41:42 UTC
Created attachment 226824 [details] [review]
force ipv6_v4mapped to pass on connection refused

(In reply to comment #1)
> Hm... so OpenBSD has the defines but doesn't implement the behavior? I think it
> would be better to just have the test deal with getting back EOPNOTSUPP or
> whatever, and consider that a passing result as well (with no #ifdef OpenBSD at
> all).

What about this patch. When v4-mapped addresses are not supported, we get a connection refused. I'm not super happy about the "OK" lie but well...
Comment 3 Antoine Jacoutot 2013-01-02 14:27:52 UTC
Hi Dan.

Any input on this patch? Or a better way to do it?
Thanks.-• Don't leak temporary fds pointing to /dev/null (fd.o #56927, Michel HERMIER)
+• Unix-specific:
+  · Check for functions in libpthread correctly, fixing compilation on
+    (at least) OpenBSD (fd.o #47239, Simon)
+  · Don't leak temporary fds pointing to /dev/null (fd.o #56927,
+    Michel HERMIER)
Comment 4 Dan Winship 2013-01-08 02:38:38 UTC
Comment on attachment 226824 [details] [review]
force ipv6_v4mapped to pass on connection refused

The connection might fail for some other reason though... we should just be checking whether or not the setsockopt() in create_server() succeeds. (And that really ought to be using g_socket_set_option() now...) Or alternatively, after calling create_server(), test_ipv6_v4mapped() could call g_socket_supports_ipv4() on data->server.

> I'm not super happy about the "OK" lie but well...

You can call g_test_message() to output a warning about the test not actually getting run. (I think the output of that doesn't actually get printed unless you run with -v, but at least there's *some* way of seeing what's happening.)
Comment 5 Antoine Jacoutot 2013-01-08 10:13:08 UTC
Created attachment 232957 [details] [review]
force pass even if we don't speak IPv4

Hi Dan.

Thanks for the tips.
New patch that implements the alternate solution you proposed (simpler imho).

$ gtester --verbose ./socket -o test-report.xml 
TEST: ./socket... (pid=20242)
  /socket/ipv4_sync:                                                   OK
  /socket/ipv4_async:                                                  OK
  /socket/ipv6_sync:                                                   OK
  /socket/ipv6_async:                                                  OK
  /socket/ipv6_v4mapped:                                               OK
  /socket/close_graceful:                                              OK
  /socket/timed_wait:                                                  OK
  /socket/address:                                                     OK
  /socket/unix-from-fd:                                                OK
  /socket/unix-connection:                                             OK
  /socket/unix-connection-ancillary-data:                              OK
PASS: ./socket

And test-report.xml contains:
<message>
Test not run: not supported by the OS
</message>
Comment 6 Dan Winship 2013-01-08 14:36:36 UTC
Comment on attachment 232957 [details] [review]
force pass even if we don't speak IPv4

>+      g_test_message ("Test not run: not supported by the OS");

I had thought that this would prepend the test name, but from what you quoted, it looks like it doesn't. So you should add "test_ipv6_ipv4mapped: " there.

>+      return;

This leaks @data, including the server thread, etc. If you're ever likely to be doing memory-leak-checking, you might want to fix that. Otherwise, feel free to commit.
Comment 7 Antoine Jacoutot 2013-01-08 14:47:49 UTC
g_slice_free (IPTestData, data);(In reply to comment #6)
> (From update of attachment 232957 [details] [review])
> >+      g_test_message ("Test not run: not supported by the OS");
> 
> I had thought that this would prepend the test name, but from what you quoted,
> it looks like it doesn't. So you should add "test_ipv6_ipv4mapped: " there.

Sorry, I wasn't clear enough. The complete report does include the test path:

    <testcase path="/socket/ipv6_v4mapped">
      <message>
Test not run: not supported by the OS
      </message>
      <duration>0.000250</duration>
      <status exit-status="0" n-forks="0" result="success"/>
    </testcase>

> >+      return;
> 
> This leaks @data, including the server thread, etc. If you're ever likely to be
> doing memory-leak-checking, you might want to fix that. Otherwise, feel free to
> commit.

Well I'd rather have a clean commit that doesn't introduce any leaks ;-)
Looks like throwing the following should be enough, right (e.g. right after g_test_message)?
    g_slice_free (IPTestData, data);
Comment 8 Dan Winship 2013-01-08 15:00:24 UTC
no, you need to free some of the members of data, and also get data->thread to exit...

I guess it would be simpler to move the check to the setsockopt() call in create_server(), and if it fails, then unref data->server, free data, and return NULL, and check for NULL in test_ipv6_ipv4mapped()
Comment 9 Antoine Jacoutot 2013-01-09 15:02:39 UTC
Created attachment 233082 [details] [review]
force pass even if we don't speak IPv4-mapped

Sorry for being dumb... I'm not really familiar with this area.
Hopefully this is what you meant.
Comment 10 Dan Winship 2013-01-09 15:05:50 UTC
Comment on attachment 233082 [details] [review]
force pass even if we don't speak IPv4-mapped

that works
Comment 11 Antoine Jacoutot 2013-01-09 15:30:31 UTC
Thanks Dan, it's in: cb1876b