Skip to content
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

Modify captived integration tests so they are not machine-dependent. #98

Open
glfejer opened this issue Aug 27, 2019 · 1 comment
Open

Comments

@glfejer
Copy link
Contributor

glfejer commented Aug 27, 2019

The captived integration tests behave differently depending on the machine that is used to run them.
Specifically, the network interface status is different because some machines don't have wireless lan.
Currently, we the tests don't validate the fields that could differ.

From @drbild :
The simplest method for "mocking" C library calls is to use the linker wrap functionality. See option 1 here: https://stackoverflow.com/a/2925879
But yeah, that will take a bit of work to set up.

Take a look at my ip -br thought in my other comment before making a final decision, but I'm ok with any of the three options:

1. Use ip -br (if the -br flag is accepted on the router card)
2. Use a mock getifaddrs (for example, via the linker wrap function)
3. Leave as is, but open an issue to improve.

I added code to mock the interface data, but changed course for expediency. The code is on the branch:
https://github.com/glfejer/xaprc/tree/mock-getifaddrs
The problem was that mac osx linker does not support the --wrap option.

@glfejer
Copy link
Contributor Author

glfejer commented Aug 27, 2019

With mocking the interface, we will not need the #if defined(__APPLE__) in defines.hpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants