Make sure you're system has the vcan (SocketCAN) kernel module, otherwise it can not be loaded.
- Make sure alle prerequisites are installed and working.
- Run the
start-vcans.sh
. This enables the vcan kernel module and createsvcan0
,vcan1
andvcan2
. Otherwise run:- sudo modprobe vcan
- For all virtual can busses that should be created run.
- sudo ip link add dev type vcan fd on
- sudo ip link set up
- Configure the yakut monitoring tool for the current configuration. This can be done by
running
. export-yakut-variables.sh
or manually with the following steps:- Select all the vcans that should be monitored by setting the environment variable
export UAVCAN__CAN__IFACE='socketcan:vcan0 socketcan:vcan1 socketcan:vcan2
- Choose use of CAN-FD packets with
export UAVCAN__CAN__MTU=64
- Set the node id of the terminal. The node id 0 can be chosen safely, otherwise conflicts with tests might occure.
export UAVCAN__NODE__ID=0
- Select all the vcans that should be monitored by setting the environment variable
- Run the yakut monitor with the command
yakut monitor
. - In a different terminal, run
candump -decaxta any
for monitoring the can traffic.
The output of the monitoring tools can be captured like so:
y --tsvh mon > <name-of-file>.log
candump -decaxta any > <name-of-file>.log
Loading or building the CMakeList.txt in the root directory gives access to all test targets. They can be selected individually or run all at once by choosing the UnitTests target. Please be aware that test T104ChangeOfCommunicationInterfaceTest needs manual intervention and results gathered by running the UnitTest target are not correct. This test should be run individually.
- Make sure the
CAN_REDUNDANCY_FACTOR
macro insrc/Utility/Macros.h
is set to 1.
Execute the desired test.
- Make sure the
CAN_REDUNDANCY_FACTOR
macro insrc/Utility/Macros.h
is set to 3.
Execute the test T104ChangeOfCommunicationInterfaceTest. After 15 seconds disable one of the communication interfaces by running:
sudo ip link set vcan2 down
Verify with:
ip link show
The interface should have gone from
vcan2: <NOARP,UP,LOWER_UP>
to
vcan2: <NOARP>
After building the project using cmake go to the build directory. Here it is called build
. In there, all executables
can be found.
A specific test can be chosen by filtering for it using the --gtest_filter=<test-case>
command on the UnitTest target,
for example for the ReferenceConfigurationTest
like so:
build/src/Tests/UnitTests --gtest_filter=ReferenceConfigurationTest.ReferenceConfigurationTest:ReferenceConfigurationTest/*.ReferenceConfigurationTest:ReferenceConfigurationTest.ReferenceConfigurationTest/*:*/ReferenceConfigurationTest.ReferenceConfigurationTest/*:*/ReferenceConfigurationTest/*.ReferenceConfigurationTest --gtest_color=no