Skip to content

Commit

Permalink
fix: Add hotfix script to fix not working integration tests on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Oct 9, 2024
1 parent a78e3d9 commit 3dab4ef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions misc/setup-loopback-addresses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# TODO: Consider finding a better method than running the script.
# On macOS, unlike Linux, loopback addresses other than 127.0.0.1 are not assigned by default, which may cause integration tests to fail.
# In that case, please run the following script first.

# TODO: Support other octets as well, not just the last octet.
for i in {1..254}; do
if [[ "$(uname)" == "Darwin" ]]; then
sudo ifconfig lo0 alias 127.0.0.$i up
elif [[ "$(uname)" == "Linux" ]]; then
sudo ifconfig lo:0 127.0.0.$i netmask 255.0.0.0 up
else
echo "Unsupported OS"
exit 1
fi
done

0 comments on commit 3dab4ef

Please sign in to comment.