Support running integration tests on macOS#524
Support running integration tests on macOS#524mtjhrc wants to merge 6 commits intocontainers:mainfrom
Conversation
3159e54 to
edf1b4d
Compare
3bafd76 to
abdaf7e
Compare
abdaf7e to
5808778
Compare
e0795f9 to
126ed51
Compare
|
After the fixes to to the tests in this PR and #543 which fixes an issue in the implementation all tests now pass on macOS correctly. |
Signed-off-by: Matej Hrica <mhrica@redhat.com>
Use correct platform-specific library directory (lib vs lib64) and library path env variable (DYLD_LIBRARY_PATH vs LD_LIBRARY_PATH). Signed-off-by: Matej Hrica <mhrica@redhat.com>
Signed-off-by: Matej Hrica <mhrica@redhat.com>
Signed-off-by: Matej Hrica <mhrica@redhat.com>
Make TcpTester::run_server also leak the file descriptor for the stream socket. Closing the fd caused the tests to fail on macOS (they randomly worked on Linux I suppose). Signed-off-by: Matej Hrica <mhrica@redhat.com>
Explicitly specify a /tmp directory, this fixes an issue on macOS where the default tmp path that gets used could be very long, causing unix domain socket tests to fail due to path length. Signed-off-by: Matej Hrica <mhrica@redhat.com>
946e1e2 to
03d29c1
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request successfully introduces macOS support for integration tests by handling platform-specific library paths, implementing cross-compilation for the guest agent, and addressing path length limitations for Unix domain sockets. The addition of a Skip state in the test runner is a good improvement for handling platform-unsupported tests. I have identified a few areas where the implementation could be made more robust, particularly regarding support for Intel-based Macs.
|
|
||
| test: test-prefix | ||
| cd tests; RUST_LOG=trace LD_LIBRARY_PATH="$$(realpath ../test-prefix/lib64/)" PKG_CONFIG_PATH="$$(realpath ../test-prefix/lib64/pkgconfig/)" ./run.sh test --test-case "$(TEST)" $(TEST_FLAGS) | ||
| cd tests; RUST_LOG=trace $(LIBPATH_VAR_$(OS))="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/):$(EXTRA_LIBPATH_$(OS)):$${$(LIBPATH_VAR_$(OS))}" PKG_CONFIG_PATH="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/pkgconfig/)" ./run.sh test --test-case "$(TEST)" $(TEST_FLAGS) |
There was a problem hiding this comment.
This doesn't work on macOS with SIP enabled. macOS's shells unset certain security sensitive environment variables like DYLD_LIBRARY_PATH before executing the script, so ./run.sh here can't see the value.
One option could be setting the path in an alternative environment variable and having ./run.sh export DYLD_LIBRARY_PATH with that value itself.
This PR makes sure our
make testsimply just works on macOS.Note that this currently utilizes the same tests as linux which is the
libkrunfw/virtio-fsuse-case (not the commonly used EFI+disk variant on macOS), these test can hopefully be added later, still though this is quite useful for testing virtio devices.This also disables vsock and tsi/vsock tests since these currently fail on macOS (the TSI is understandable, but I'm not sure about the vsock failure) - we can investigate or declare this unsupported later.TODO:
Since we currently don't have a macOS CI that supports virtualization, these tests still have to be ran locally.