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

vagrant: add Vagrantfile to test native in FreeBSD #14458

Merged
merged 2 commits into from
Aug 25, 2020

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jul 8, 2020

Contribution description

This provides a Vagrantfile for testing RIOT native in FreeBSD.

Testing procedure

Basically, follow the provided README.md. For the tapsetup stuff to work #14457 is required.

I also ran dist/tools/compile_and_run_for_board on it overnight, the results can be found here.

Basically there are some errors (but this does not block this PR), that can be summarized as such:

  • Cross-compiling C++ for 32-bit (this seems to be not easily fixable at least not just by installing from ports, maybe another argument for native: 64-Bit support? #6603)
  • Missing names like errno-values or GNU/Linux-specific functions such as backtrace
  • Missing shell commands like sha512sum or bridge and other missing tooling
  • POSIX definition clashes for pthreads
  • Timing errors (maybe related to xtimer_usleep wrong delay time #10073)
  • Some minor unexpected scheduling behavior as it seems
  • Missing root privileges for tests that require it (easily fixed for non-automated runs ;-))
  • Encoding formats that already in the past yielded different results for different toolchains like cayenne-lpp
  • Incompatibilities in OS-specific scapy sublayer
  • ...

All fixes that can be tackled as follow-ups (I will open a tracking issue if desired).

Issues/PRs references

None

@miri64 miri64 added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: tools Area: Supplementary tools OS: FreeBSD Host OS: This PR/issue concerns usage of RIOT with FreeBSD as a host system labels Jul 8, 2020
@miri64 miri64 added this to the Release 2020.07 milestone Jul 8, 2020
@miri64 miri64 requested a review from jia200x as a code owner July 8, 2020 07:32
@miri64 miri64 added the CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs label Jul 8, 2020
@miri64
Copy link
Member Author

miri64 commented Jul 27, 2020

Rebased and squashed to current master.

@leandrolanzieri
Copy link
Contributor

When trying to run the network test indicated in the README I get the following:

make: Entering directory '/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr'


/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr/bin/native/tests_gnrc_dhcpv6_client_6lbr.elf -z [::1]:17754 tap0 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

DHCPv6: Selecting interface 7 as upstream
main(): This is RIOT! (Version: 2020.10-devel-772-gf8d25-pr/no_archives)
> 
> 
> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/scapy/sendrecv.py", line 842, in _run
    *arg, **karg)] = iface
  File "/usr/local/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 239, in __init__
    super(L2bpfListenSocket, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 62, in __init__
    (self.ins, self.dev_bpf) = get_dev_bpf()
  File "/usr/local/lib/python3.7/site-packages/scapy/arch/bpf/core.py", line 115, in get_dev_bpf
    raise Scapy_Exception("No /dev/bpf handle is available !")
scapy.error.Scapy_Exception: No /dev/bpf handle is available !

Exception ignored in: <function _L2bpfSocket.__del__ at 0x80271d830>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 136, in __del__
    self.close()
  File "/usr/local/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 208, in close
    if not self.closed and self.ins is not None:
AttributeError: 'L2bpfListenSocket' object has no attribute 'ins'

Traceback (most recent call last):
  File "/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr/tests/01-run.py", line 173, in <module>
    sys.exit(run(testfunc, timeout=TIMEOUT, echo=True))
  File "/home/vagrant/RIOT/dist/pythonlibs/testrunner/__init__.py", line 30, in run
    testfunc(child)
  File "/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr/tests/01-run.py", line 114, in testfunc
    pkt = wait_for_dhcpv6_pkt(iface)
  File "/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr/tests/01-run.py", line 95, in wait_for_dhcpv6_pkt
    raise TimeoutError("Sniffing for DHCPv6 traffic timed out")
TimeoutError: Sniffing for DHCPv6 traffic timed out
make: *** [/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr/../../Makefile.include:746: test] Error 1
make: Leaving directory '/home/vagrant/RIOT/tests/gnrc_dhcpv6_client_6lbr'

@miri64
Copy link
Member Author

miri64 commented Aug 21, 2020

I pointed that out in OP though:

* Incompatibilities in OS-specific `scapy` sublayer

@leandrolanzieri
Copy link
Contributor

I pointed that out in OP though:

* Incompatibilities in OS-specific `scapy` sublayer

Ok, but then why is that particular example used in the README, knowing that it will not work?

@miri64
Copy link
Member Author

miri64 commented Aug 21, 2020

Ok, but then why is that particular example used in the README, knowing that it will not work?

Because I am stupid 😅 I used the first example found, not checking if it uses scapy or not. Will fix!

@miri64
Copy link
Member Author

miri64 commented Aug 21, 2020

Actually the applications start, but communication does not work. Just another thing to figure out ;-). I reworded it now to refer to examples/gnrc_networking.

@leandrolanzieri leandrolanzieri self-assigned this Aug 25, 2020
@leandrolanzieri
Copy link
Contributor

Please squash @miri64 !

@leandrolanzieri leandrolanzieri added the Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines label Aug 25, 2020
@leandrolanzieri leandrolanzieri added Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Aug 25, 2020
Copy link
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the instructions and got it working, also @miri64 has provided test output. Some follow-up work is needed but I see no reason not to merge this. ACK.

@miri64
Copy link
Member Author

miri64 commented Aug 25, 2020

Squashed and added whitelisting to the build system sanity check.

Vagrantfiles are not part of our build-system so they should be ignored
by its sanity check.
@leandrolanzieri leandrolanzieri added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 25, 2020
@leandrolanzieri leandrolanzieri merged commit bbfca7e into RIOT-OS:master Aug 25, 2020
@miri64 miri64 deleted the vagrant/enh/freebsd branch August 25, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs OS: FreeBSD Host OS: This PR/issue concerns usage of RIOT with FreeBSD as a host system Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants