Libstore file transfer unit tests fail when IPv6 is disabled in the kernel #564

Closed
opened 2024-10-30 19:57:03 +00:00 by scriptis · 6 comments

Describe the bug

When IPv6 is disabled on a system building Lix, several tests in lix/tests/unit/libstore/filetransfer.cc fail to run:

[ RUN      ] FileTransfer.reportsSetupErrors
unknown file: Failure
C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body.

[  FAILED  ] FileTransfer.reportsSetupErrors (1 ms)
[ RUN      ] FileTransfer.defersFailures
unknown file: Failure
C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body.

[  FAILED  ] FileTransfer.defersFailures (0 ms)
[ RUN      ] FileTransfer.handlesContentEncoding
unknown file: Failure
C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body.

[  FAILED  ] FileTransfer.handlesContentEncoding (1 ms)
[ RUN      ] FileTransfer.usesIntermediateLinkHeaders
unknown file: Failure
C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body.

[  FAILED  ] FileTransfer.usesIntermediateLinkHeaders (0 ms)
[----------] 5 tests from FileTransfer (5 ms total)

Steps To Reproduce

  1. Disable IPv6 in the kernel: boot.kernelParams = [ "ipv6.disable=1" ];.
  2. Attempt to build and test Lix.

Expected behavior

Tests do not fail.

nix --version output

nix (Lix, like Nix) 2.91.0

Additional context

filetransfer.cc uses an IPv6 listener; can this be an IPv4 listener instead?

## Describe the bug When IPv6 is disabled on a system building Lix, several tests in `lix/tests/unit/libstore/filetransfer.cc` fail to run: ``` [ RUN ] FileTransfer.reportsSetupErrors unknown file: Failure C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body. [ FAILED ] FileTransfer.reportsSetupErrors (1 ms) [ RUN ] FileTransfer.defersFailures unknown file: Failure C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body. [ FAILED ] FileTransfer.defersFailures (0 ms) [ RUN ] FileTransfer.handlesContentEncoding unknown file: Failure C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body. [ FAILED ] FileTransfer.handlesContentEncoding (1 ms) [ RUN ] FileTransfer.usesIntermediateLinkHeaders unknown file: Failure C++ exception with description "error: socket() failed: Address family not supported by protocol" thrown in the test body. [ FAILED ] FileTransfer.usesIntermediateLinkHeaders (0 ms) [----------] 5 tests from FileTransfer (5 ms total) ``` ## Steps To Reproduce 1. Disable IPv6 in the kernel: `boot.kernelParams = [ "ipv6.disable=1" ];`. 2. Attempt to build and test Lix. ## Expected behavior Tests do not fail. ## `nix --version` output `nix (Lix, like Nix) 2.91.0` ## Additional context [`filetransfer.cc`](https://git.lix.systems/lix-project/lix/src/branch/main/tests/unit/libstore/filetransfer.cc#L40) uses an IPv6 listener; can this be an IPv4 listener instead?
scriptis added the
bug
label 2024-10-30 19:57:03 +00:00
Owner

This is a really hard one, most of us are using IPv6 all the time and if we could disable IPv4, we would do it. I am inclined to mark as wontfix, if you have a need of a kernel without a working IPv6 stack, consider not running the Lix tests as well and just build it.

This is a really hard one, most of us are using IPv6 all the time and if we could disable IPv4, we would do it. I am inclined to mark as wontfix, if you have a need of a kernel without a working IPv6 stack, consider not running the Lix tests as well and just build it.
Author

Mm, alright. Was using Lix on a box that has a bunch of custom routing stuff and just turned off IPv6 entirely since I wasn't using it, suppose I can turn it back on and just configure it to drop all packets.

Mm, alright. Was using Lix on a box that has a bunch of custom routing stuff and just turned off IPv6 entirely since I wasn't using it, suppose I can turn it back on and just configure it to drop all packets.
Author

Aside--if you are okay with me swapping this to use 127.0.0.1 instead of [::1] for just this test, I've got a changeset prepared

Aside--if you are okay with me swapping this to use 127.0.0.1 instead of [::1] for just this test, I've got a changeset prepared
Owner

Ideally, we would like to use only IPv6 in our tests except for IPv4 specifics behaviors, thank you for that change set, but we would prefer to keep it that way.

Ideally, we would like to use only IPv6 in our tests except for IPv4 specifics behaviors, thank you for that change set, but we would prefer to keep it that way.
Owner

Thank you for your understanding!

Thank you for your understanding!
Author

Yep, no problem! Thanks for all your hard work!

Yep, no problem! Thanks for all your hard work!
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#564
No description provided.