How to implement CAN-SOME/IP communication routing test

Different from UDP-based in-vehicle communication routing, routing based on SOME/IP protocol adds service discovery (Service Discovery) and service publishing (Service Publish). So for test engineers, how to implement CAN-SOME/IP routing testing Woolen cloth?

01Understand  routing implementation methods

First, we must understand the routing design principles based on the SOME/IP protocol. If the function is implemented on the Ethernet node, the Ethernet node is the server and the gateway is the client. If the function is implemented on the CAN node, the gateway is the server and the Ethernet node is the client. It is implemented by the gateway. Routing between Ethernet nodes and CAN nodes. It includes two routing methods: message routing and signal routing.

picture

So, how do CAN messages and SOME/IP messages correspond to each other? For example:

In the following example, the ServiceID and MethodID in the SOME/IP header can be associated with the specified CAN message.

picture

in:

A stands for ServiceID

B stands for BusID

C stands for CAN MessageID

E is used to distinguish Method, or Event/Notifier messages

Message routing: The payload of the CAN message is mapped to the payload of the service interface. The gateway implements message routing between CAN and SOME/IP protocols without changing the data content and data length.

picture

Signal routing: Parameters in the service interface are mapped to signals in the CAN message. Gateway implements conversion between different data types.

picture

02 Understand the test content

Message routing does not involve signal content analysis, and the test can be completed without loading the database file when testing input. However, signal routing involves the serialization and deserialization of SOME/IP interface parameters, and the database needs to be loaded for testing.

Common test points

The main test points of communication routing include: checking whether the target network segment, message type, MessageID, payload length, payload are correct, and whether the routing delay time meets the requirements.

The test points of reverse testing mainly include: payload length is larger or smaller than expected, invalid ID, etc.

Stability-related test points mainly include: high load, repeated power on and off, repeated sleep, etc.

Take CAN-->SOME/IP message routing as an example. Given certain routing information, test Payload consistency.

routing information

Source network segment (CAN)

Target network segment (SOME/IP)

MessageID:0x100

DLC:8

ServiceID:0x0001

MessageType:Notification

EventgroupID:0x0001

NotificationID:0x8100

Test steps

Step1 : Check if the gateway Offer ServiceID 0x0001

Step2 : Tester simulates the client, subscribes to the event group with ServiceID 0x0001 and EventgroupID 0x0001, and checks whether the gateway replies with the corresponding SubscribeACK

Step3 : Simulate sending CAN messages on the source network segment, with ID 0x100 and data 01 02 03 04 05 06 07 08. Check whether the corresponding SOME/IP message is received.

Step4 : Check whether the received payload is consistent with the sent payload

03 Automated testing solutions

test environment

The test environment built must be able to establish communication with the DUT and control the power on, off and wake-up of the DUT. You can refer to the following test topology to monitor the communication of the DUT, simulate the Tester node, and simulate CAN and Ethernet nodes to communicate with the DUT. The test system consists of CANoe test software, VT board, VN 5650, VN 16XX, program-controlled power supply and DUT.

picture

test script

In the above test steps, Tester needs to simulate the CAN node and SOME/IP service client. The development of the test script can be based on the CAPL language and the SomeIP_IL.dll file provided by Vector, and is divided into the following steps.

❶ In TCP/IP Stack, set the IP/MAC address for Tester

❷ Simulate sending CAN messages

❸Call the SomeIpOpenLocalApplicationEndpoint function to create an Endpoint

❹ Call the SomeIpCreateConsumedServiceInstance function, specify ServiceID and InstanceID

❺ Call the SomeIpAddConsumedEventGroup function and specify the EventgroupID

❻ Call the SomeIpCreateFieldConsumer function, specify the NotificationID, and the callback when receiving this Notification message

❼ Create a callback function. When receiving the Notification message, compare whether the payload is consistent.

After the callback function is triggered, an example of the data parsing method:

picture

Test Results

CANoe monitoring messages and data processing results display:

picture

By calling the SomeIP_IL.dll file, the service discovery process between Tester and the gateway can be realized, as well as the reception and invocation of the service interface, to further achieve the purpose of testing.

The testing principle of SOME/IP-->CAN routing is similar to the above. The function in the dll file is called to simulate the behavior of the server. The test of signal routing can realize automated testing by importing SOME/IP and CAN database files.

The above is the relevant content of CAN-SOME/IP routing testing that we have shared with you. If you have any questions or automated testing needs, you can contact us at any time. Thank you for reading~

Guess you like

Origin blog.csdn.net/m0_47334080/article/details/131721890