# Loopback setup macOS for unit testing

**URL:** <https://forum.opencyphal.org/t/loopback-setup-macos-for-unit-testing/1772>\
**Category:** PyCyphal\
**Created:** [October 15, 2022, 7:53am UTC](https://forum.opencyphal.org/t/loopback-setup-macos-for-unit-testing/1772 "2022-10-15T07:53:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maksim.drachov](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/maksim.drachov/32/1577_2.png) [@maksim.drachov](https://forum.opencyphal.org/u/maksim.drachov)\
**Post date:** [October 15, 2022, 7:53am UTC](https://forum.opencyphal.org/t/loopback-setup-macos-for-unit-testing/1772/1 "2022-10-15T07:53:21Z")

</div>

As discussed [here](https://pycyphal.readthedocs.io/en/stable/pages/demo.html) in the documentation, macOS has some issues when running OpenCyphal.

This is especially difficult whenever trying to run unit tests, resulting in many failed cases.

To resolve this, I’ve started collecting all the IP addresses that need to be set in this [gist file](https://gist.github.com/maksimdrachov/54f0dcbaa5fb70578d77934d5018e08a).

So that when running `pytest -k udp`, instead of this:

 ![Screenshot 2022-10-15 at 10.46.54](https://forum.opencyphal.org/uploads/default/original/2X/6/65e30e543c92e4c443a5a8518a9a977fe8ff473c.png)

You’ll get this:

 ![Screenshot 2022-10-15 at 10.45.52](https://forum.opencyphal.org/uploads/default/original/2X/b/bcfb35b6427e3fcf7a60bea8191c34b0d341c5bf.png)

To run it, simply copy the files to your home directory and run `source ~/loopback-setup.sh`

After you’re done, don’t forget run `source ~/loopback-setup-down.sh`, as I’ve noticed it tends to overhead the CPU when kept running (at least on my Macbook Air).

So far, I’ve only added the IP addresses related to testing the `udp` part, if the need arises I’ll update the file with additional entries.
