-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Three subtests fail in socket-api-tests #7
Comments
Some We can reproduce this in Python:
Those definitely do not all have I don’t have a full explanation for why this wasn’t failing in the past, but it seems like the test code should be setting diff --git a/tests/socket-api-tests.c b/tests/socket-api-tests.c
index 722e037..8b08672 100644
--- a/tests/socket-api-tests.c
+++ b/tests/socket-api-tests.c
@@ -985,7 +985,10 @@ void assert_addrinfo(struct addrinfo* rp, int exp_socktype, short exp_port)
START_TEST(getaddrinfo_valid)
{
struct addrinfo *rp, *res = NULL;
- struct addrinfo hints = {.ai_family = AF_UNSPEC};
+ struct addrinfo hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_socktype = SOCK_STREAM
+ };
ck_assert(mm_getaddrinfo("localhost", "ssh", &hints, &res) == 0);
for (rp = res; rp != NULL; rp = rp->ai_next) |
Given the above, the failure in I’m not sure if this is a very good test, but I can get it to work again by asking for diff --git a/tests/socket-api-tests.c b/tests/socket-api-tests.c
index 8b08672..5e133f6 100644
--- a/tests/socket-api-tests.c
+++ b/tests/socket-api-tests.c
@@ -1016,7 +1016,7 @@ START_TEST(getaddrinfo_error)
ck_assert(mm_getaddrinfo("localhost", "joke", &hints, &res) == -1);
ck_assert_int_eq(mm_get_lasterror_number(), MM_ENOTFOUND);
- hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_socktype = SOCK_RAW;
ck_assert(mm_getaddrinfo("localhost", "ssh", &hints, &res) == -1);
ck_assert_int_eq(mm_get_lasterror_number(), MM_ENOTFOUND);
hints.ai_socktype = 0; |
For the I’m not sure what to do about this one. The outcome is clearly not what was intended, but seems to be “correct” in terms of what the API guarantees. I think I’ll go ahead and open a PR to fix |
This works, in lieu of entirely disabling the test: diff --git a/tests/socket-api-tests.c b/tests/socket-api-tests.c
index 5e133f6..cc7916b 100644
--- a/tests/socket-api-tests.c
+++ b/tests/socket-api-tests.c
@@ -1162,7 +1162,7 @@ START_TEST(create_invalid_sockclient)
ck_assert(mm_create_sockclient("dummy://localhost") == -1);
ck_assert_int_eq(mm_get_lasterror_number(), MM_ENOTFOUND);
- ck_assert(mm_create_sockclient("ssh://localhost:10") == -1);
+ ck_assert(mm_create_sockclient("tcp://localhost:10") == -1);
ck_assert_int_eq(mm_get_lasterror_number(), ECONNREFUSED);
ck_assert(mm_create_sockclient("tcp://localhost") == -1); …so I’ll do that downstream for now, but it does not test exactly the same thing, so I’m not adding it to #8 without maintainer feedback. |
It suffices when building directly in a git checkout as described above, but not when building the Fedora package in a chroot:
In Python session in a normal terminal in Fedora 38:
Same thing in a
The error is different than the one the test expects when the chroot has networking disabled, but what happens if we enable netwroking?
Oh, it succeeds. Here, instead of Anyway, I am not sure the assumptions baked into |
We noticed this when the
mmlib
package in Fedora Linux started to fail to build from source on Fedora 38, 39 (which is about to be released), and 40 (Rawhide/development). However, I can reproduce it in a fresh git checkout of the currentmaster
, f416f7a.testlog.txt
I haven’t attempted to dig more deeply into why these might be failing.
The text was updated successfully, but these errors were encountered: