GNOME Bugzilla – Bug 686058
OpenBSD: disable ipv6_v4mapped test
Last modified: 2013-01-09 15:30:31 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?
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).
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...
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 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.)
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 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.
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);
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()
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 on attachment 233082 [details] [review] force pass even if we don't speak IPv4-mapped that works
Thanks Dan, it's in: cb1876b