Commit 508048a3 authored by Elemer Lelik's avatar Elemer Lelik
Browse files

bugfixes and new test cases

parent 403f5b67
# titan.TestPorts.SocketCANasp # titan.TestPorts.SocketCANasp
Main project page: Main project page:
https://projects.eclipse.org/projects/tools.titan https://projects.eclipse.org/projects/tools.titan
The source code of the TTCN-3 compiler and executor: The source code of the TTCN-3 compiler and executor:
https://github.com/eclipse/titan.core https://github.com/eclipse/titan.core
References:
https://www.kernel.org/doc/Documentation/networking/can.txt
Other useful documentation:
https://docs.python.org/3/library/socket.html (search for: "AF_CAN")
https://media.readthedocs.org/pdf/python-can/latest/python-can.pdf
http%3A%2F%2Fwww.can-cia.de%2Ffileadmin%2Fresources%2Fdocuments%2Fproceedings%2F2012_hartkopp.pdf
http://www.can-cia.de/fileadmin/resources/documents/proceedings/2012_hartkopp.pdf
http://v2.can-newsletter.org/uploads/media/raw/46c15d02e1fdd3b04e671693ec548ff7.pdf
# See file: src/initscript.sh:
#--------------------------------------
#!/bin/bash
# Add vcan module to kernel
sudo modprobe vcan
# Setup of virtual can vcan0
sudo ip link add dev vcan0 type vcan
# set it up at as a canfd can interface
sudo ip link set vcan0 mtu 72
sudo ip link set vcan0 up
# Setup of virtual can vcan1
sudo ip link add dev vcan1 type vcan
sudo ip link set vcan1 up
# example configuration of a physical can bus interface
#sudo ip link set can0 up type can bitrate 1000000
ifconfig
#--------------------------------------
cd src
./demo/initscript.sh
or alternatively
source demo/initscript.sh
make clean; make
ttcn3_start SocketCAN SocketCAN.cfg
or to run a certain testcase:
ttcn3_start SocketCAN SocketCAN.cfg SocketCANtest.tc_can_raw1 SocketCANtest.tc_can_bcm1
Review the newly created log files in the src directory
and use e.g. Wireshark to trace the CAN interfacce.
#--------------------------------------
Notes:
-Using multiple Test interfacces:
Currently the init script sets up multiple virtual can interfaces ("vcan0",
"vcan1" in oder to allow using multiple CAN interfaces.
The CAN interfaces have to be defined in the TTCN configuration files or may
alternatively be defined in the optional parameters of port messages commands
ioctl and send_data.
Handling of multiple CAN interfaces is work in progress and no test cases are
provided. In order to configure usage with multiple test interfaces,
test interfaces for each interface have to be defined in the MTC.
-CAN RAW:
CAN and CANFD has been implemented and tested.
Depending on the availability of the C-code #define "CAN_FD_FRAME"
in /usr/include/linux/can/bcm.h, CAN-FD support is enabled at compile time.
If you kernel does not have CANFD support comment out the #define "CAN_FD_FRAME
the file "src/SocketCAN_PT.cc"
The RAW setsockopt has path coverage. However no test coverage that insures
the setsockopt functionality provided by the kernel is working correctly.
For this purpose in the future might be added additional test cases.
-CAN BCM:
TX_SETUP, TX_DELETE have been tested, TX_READ is known to fail test cases.
Some tests have indicated, that that SocketCAN BCM does not support concurrently
active BCM channels.
The BCM has test coverage for TX_SETUP and TX_DELETE.
Return values other than the error code by the BCM are not yet supported.
-ISOTP:
Iso TP functionality has been added, however currently no options like padding
are supported. Feel free to request needed options.
First install the isotp kernel module as descibed here:
https://github.com/hartkopp/can-isotp-modules
./make_isotp.sh
sudo insmod ./can-isotp.ko
There is an endlessly running test case:
ttcn3_start SocketCAN SocketCAN.cfg Isotptest.tc_Isotp_Example001
-Merging of logfiles:
To merge the logfies from multiple Parallel Test Componets (PTCs) from a
single run in timely order into sigle file, run in demo directory:
$ ./merge.sh
the merged and pretty printed log file is found in "demo/log_merged_pretty.txt"
-Dunping CAN Frames using SocketCAN:
To dump all received can frames of e.g. "vcan0" run a seperate terminal:
$ candump "vcan0"
...@@ -171,7 +171,6 @@ function f_close_socket(in SocketCAN_socketid p_socket_id) ...@@ -171,7 +171,6 @@ function f_close_socket(in SocketCAN_socketid p_socket_id)
runs on PTC_isotp_CT { runs on PTC_isotp_CT {
pt_socketCAN.send(SocketCAN_close:{id:= p_socket_id}); pt_socketCAN.send(SocketCAN_close:{id:= p_socket_id});
} }
function f_send_isotp_message(in SocketCAN_socketid p_socket_id, function f_send_isotp_message(in SocketCAN_socketid p_socket_id,
in octetstring p_pdu) in octetstring p_pdu)
runs on PTC_isotp_CT{ runs on PTC_isotp_CT{
......
...@@ -28,7 +28,8 @@ LogEventTypes:= Yes ...@@ -28,7 +28,8 @@ LogEventTypes:= Yes
[EXECUTE] [EXECUTE]
//CAN RAW tests //CAN RAW tests
SocketCAN_RAW_test.tc_can_raw_send_and_receive_frame SocketCAN_RAW_test.tc_can_raw_send_and_receive_can_frame
SocketCAN_RAW_test.tc_can_raw_send_and_receive_canfd_frame
SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_FILTER SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_FILTER
SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_ERR_FILTER SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_ERR_FILTER
SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_LOOPBACK SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_LOOPBACK
...@@ -36,6 +37,7 @@ SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_RECV_OWN_MSGS ...@@ -36,6 +37,7 @@ SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_RECV_OWN_MSGS
SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_FD_FRAMES SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_FD_FRAMES
SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_JOIN_FILTERS SocketCAN_RAW_test.tc_can_raw_setsockopt_CAN_RAW_JOIN_FILTERS
//CAN BCM tests //CAN BCM tests
SocketCAN_BCM_test.tc_can_bcm_TX_SETUP_TX_DELETE SocketCAN_BCM_test.tc_can_bcm_TX_SETUP_TX_DELETE_can_frame
// broken CAN BCM tests: // broken CAN BCM tests:
//SocketCAN_BCM_test.tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken SocketCAN_BCM_test.tc_can_bcm_TX_SETUP_TX_DELETE_canfd_frame
//SocketCAN_BCM_test.tc_can_bcm_TX_SETUP_TX_READ
...@@ -21,7 +21,7 @@ import from Can all ...@@ -21,7 +21,7 @@ import from Can all
template SocketCAN_CAN_or_CAN_FD_frame a_CAN_frame (template CAN_frame p_can_frame) := {can_frame := p_can_frame} template SocketCAN_CAN_or_CAN_FD_frame a_CAN_frame (template CAN_frame p_can_frame) := {can_frame := p_can_frame}
testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC { testcase tc_can_bcm_TX_SETUP_TX_DELETE_can_frame() runs on MTC {
// here are 5 CAN frames cyclicly started with TX_SETUP (can_id = 66), but after receiving // here are 5 CAN frames cyclicly started with TX_SETUP (can_id = 66), but after receiving
// a sequnce of 10 frames the cyclic sending of the frames is stopped with TX_DELETE (can id = 66). // a sequnce of 10 frames the cyclic sending of the frames is stopped with TX_DELETE (can id = 66).
...@@ -37,6 +37,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC { ...@@ -37,6 +37,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC {
connect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync) connect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync)
var CAN_frame v_can_frame1, v_can_frame2, v_can_frame3, v_can_frame4, v_can_frame5; var CAN_frame v_can_frame1, v_can_frame2, v_can_frame3, v_can_frame4, v_can_frame5;
var CANFD_frame v_canfd_frame1
var SocketCAN_bcm_frame v_bcm_activation_frame, v_bcm_deactivation_frame var SocketCAN_bcm_frame v_bcm_activation_frame, v_bcm_deactivation_frame
...@@ -47,16 +48,16 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC { ...@@ -47,16 +48,16 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC {
v_can_frame5 := {can_id := '00000005'O, can_pdu := '5555555555555555'O}; v_can_frame5 := {can_id := '00000005'O, can_pdu := '5555555555555555'O};
template SocketCAN_CAN_or_CAN_FD_frames a_expected_can_frames := { template SocketCAN_CAN_or_CAN_FD_frames a_expected_can_frames := {
{can_frame := v_can_frame1}, {can_frame := v_can_frame1},
{can_frame := v_can_frame2}, {can_frame := v_can_frame2},
{can_frame := v_can_frame3}, {can_frame := v_can_frame3},
{can_frame := v_can_frame4}, {can_frame := v_can_frame4},
{can_frame := v_can_frame5}, {can_frame := v_can_frame5},
{can_frame := v_can_frame1}, {can_frame := v_can_frame1},
{can_frame := v_can_frame2}, {can_frame := v_can_frame2},
{can_frame := v_can_frame3}, {can_frame := v_can_frame3},
{can_frame := v_can_frame4}, {can_frame := v_can_frame4},
{can_frame := v_can_frame5} {can_frame := v_can_frame5}
} }
v_bcm_activation_frame := { v_bcm_activation_frame := {
...@@ -121,8 +122,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC { ...@@ -121,8 +122,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE() runs on MTC {
all component.kill; all component.kill;
} }
testcase tc_can_bcm_TX_SETUP_TX_DELETE_canfd_frame() runs on MTC {
testcase tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken() runs on MTC {
// here are 5 CAN frames cyclicly started with TX_SETUP (can_id = 66), but after receiving // here are 5 CAN frames cyclicly started with TX_SETUP (can_id = 66), but after receiving
// a sequnce of 10 frames the cyclic sending of the frames is stopped with TX_DELETE (can id = 66). // a sequnce of 10 frames the cyclic sending of the frames is stopped with TX_DELETE (can id = 66).
...@@ -137,8 +137,131 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken() runs on MTC { ...@@ -137,8 +137,131 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken() runs on MTC {
connect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync) connect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync)
connect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync) connect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync)
var CAN_frame v_can_frame1, v_can_frame2, v_can_frame3, v_can_frame4, v_can_frame5; var CANFD_frame v_canfd_frame1, v_canfd_frame2, v_canfd_frame3, v_canfd_frame4, v_canfd_frame5
var SocketCAN_bcm_frame v_bcm_activation_frame, v_bcm_deactivation_frame
v_canfd_frame1 :=
{can_id := '00000011'O,
can_flags := '10101010'B,
can_pdu := '1111111111111111'O
};
v_canfd_frame2 :=
{can_id := '00000012'O,
can_flags := '10101010'B,
can_pdu := '22222222222222222222222222222222'O
};
v_canfd_frame3 :=
{can_id := '00000013'O,
can_flags := '10101010'B,
can_pdu := '4444444444444444444444444444444444444444444444444444444444444444'O
};
v_canfd_frame4 :=
{can_id := '00000014'O,
can_flags := '10101010'B,
can_pdu := '55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555'O
};
v_canfd_frame5 :=
{can_id := '00000015'O,
can_flags := '01010101'B,
can_pdu := '0123'O
};
template SocketCAN_CAN_or_CAN_FD_frames a_expected_can_frames := {
{canfd_frame := v_canfd_frame1},
{canfd_frame := v_canfd_frame2},
{canfd_frame := v_canfd_frame3},
{canfd_frame := v_canfd_frame4},
{canfd_frame := v_canfd_frame5}
}
v_bcm_activation_frame := {
opcode := '00000001'O, // TX_SETUP
flags := '00000000000000000000000000000011'B, // refers to SETTIMER | STARTTIMER
// CAN_FD_FRAME flag is automatically set the
// test port for CANFD frames
count := 0,
ival1 := {0, 0},
ival2 := {0, 100000},
can_id := '00000042'O, // should become octetstring in the future
frames := {canfd_frame := {
v_canfd_frame1,
v_canfd_frame2,
v_canfd_frame3,
v_canfd_frame4,
v_canfd_frame5}}
}
v_bcm_deactivation_frame := {
opcode := '00000002'O, // TX_DELETE
flags := '00001000000000000000000000000000'B,
// CAN_FD_FRAME flag is automatically set the
// test port for CANFD frames
count := 0,
ival1 := {0, 0},
ival2 := {0, 0},
can_id := '00000042'O,
frames := {canfd_frame := {}} // needs to be canfd-frame here, to stop canfd frames
}
var BCM_cmds v_cmds :=
{
{phase := e_testbody2, bcm_frame := v_bcm_activation_frame},
{phase := e_testbody5, bcm_frame := v_bcm_deactivation_frame}
}
v_ptc_bcmConfigurator.start(f_ptc_bcmComandSendInitiator(v_cmds))
var SocketCAN_CAN_or_CAN_FD_frame v_frame_to_receive1
v_frame_to_receive1 := {canfd_frame := v_canfd_frame1}
// stop when receiving v_frame_to_receive
v_ptc_rawFrameReceiver1.start(f_ptc_RawFrameReceiver(e_testbody3, v_frame_to_receive1))
// stop when receiving v_frame_to_receive
v_ptc_rawFrameReceiver2.start(f_ptc_RawFrameSequenceReceiver(e_testbody4, a_expected_can_frames, e_testbody5, 2.0))
var e_Phase v_phase
for(v_phase := c_firstPhase; v_phase < e_testcase_complete; v_phase := f_incMTCPhase(v_phase)) {
f_startPhase(v_phase)
log("MTC: ", v_phase)
f_awaitEndPhase(v_phase)
}
all component.done;
log("MTC done")
disconnect(mtc:pt_sync, v_ptc_bcmConfigurator:pt_sync)
disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync)
disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync)
all component.kill;
}
testcase tc_can_bcm_TX_SETUP_TX_READ() runs on MTC {
// here are 5 CAN frames cyclicly started with TX_SETUP (can_id = 66), then with TX_READ the status is read
var PTC v_ptc_bcmConfigurator := PTC.create("PTC1_ptc_bcmConfigurator") alive
var PTC v_ptc_rawFrameReceiver1 := PTC.create("PTC2_ptc_rawFrameReceiver1") alive
f_addSyncSlaveSet(v_ptc_bcmConfigurator, v_PTCSet)
f_addSyncSlaveSet(v_ptc_rawFrameReceiver1, v_PTCSet)
connect(mtc:pt_sync, v_ptc_bcmConfigurator:pt_sync)
connect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync)
var CAN_frame v_can_frame1, v_can_frame2, v_can_frame3, v_can_frame4, v_can_frame5;
var CANFD_frame v_canfd_frame1
var SocketCAN_bcm_frame v_bcm_activation_frame, v_bcm_deactivation_frame, v_bcm_read_status_frame var SocketCAN_bcm_frame v_bcm_activation_frame, v_bcm_deactivation_frame, v_bcm_read_status_frame
v_can_frame1 := {can_id := '00000001'O, can_pdu := '1111111111111111'O}; v_can_frame1 := {can_id := '00000001'O, can_pdu := '1111111111111111'O};
...@@ -147,20 +270,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken() runs on MTC { ...@@ -147,20 +270,7 @@ testcase tc_can_bcm_TX_SETUP_TX_DELETE_TX_READ__broken() runs on MTC {
v_can_frame4 := {can_id := '00000004'O, can_pdu := '4444444444444444'O}; v_can_frame4 := {can_id := '00000004'O, can_pdu := '4444444444444444'O};
v_can_frame5 := {can_id := '00000005'O, can_pdu := '5555555555555555'O}; v_can_frame5 := {can_id := '00000005'O, can_pdu := '5555555555555555'O};
template SocketCAN_CAN_or_CAN_FD_frames a_expected_can_frames := { v_bcm_activation_frame := {
{can_frame := v_can_frame1},
{can_frame := v_can_frame2},
{can_frame := v_can_frame3},
{can_frame := v_can_frame4},
{can_frame := v_can_frame5},
{can_frame := v_can_frame1},
{can_frame := v_can_frame2},
{can_frame := v_can_frame3},
{can_frame := v_can_frame4},
{can_frame := v_can_frame5}
}
v_bcm_activation_frame := {
opcode := '00000001'O, // TX_SETUP opcode := '00000001'O, // TX_SETUP
flags := '00000000000000000000000000000011'B, // refers to SETTIMER | STARTTIMER flags := '00000000000000000000000000000011'B, // refers to SETTIMER | STARTTIMER
count := 0, count := 0,
...@@ -175,16 +285,6 @@ v_bcm_activation_frame := { ...@@ -175,16 +285,6 @@ v_bcm_activation_frame := {
v_can_frame5}} v_can_frame5}}
} }
v_bcm_deactivation_frame := {
opcode := '00000002'O, // TX_DELETE
flags := '00000000000000000000000000000000'B,
count := 0,
ival1 := {0, 0},
ival2 := {0, 0},
can_id := '00000042'O,
frames := {can_frame := {}}
}
v_bcm_read_status_frame := { v_bcm_read_status_frame := {
opcode := '00000003'O, // TX_READ opcode := '00000003'O, // TX_READ
flags := flags :=
...@@ -198,27 +298,21 @@ v_bcm_activation_frame := { ...@@ -198,27 +298,21 @@ v_bcm_activation_frame := {
can_id := '00000042'O, can_id := '00000042'O,
frames := {can_frame := {}} frames := {can_frame := {}}
} }
var BCM_cmds v_cmds := var BCM_cmds v_cmds :=
{ {
//{phase := e_testbody2, bcm_frame := v_bcm_activation_frame}, {phase := e_testbody1, bcm_frame := v_bcm_activation_frame},
{phase := e_testbody3, bcm_frame := v_bcm_read_status_frame}, {phase := e_testbody3, bcm_frame := v_bcm_read_status_frame}
{phase := e_testbody4, bcm_frame := v_bcm_deactivation_frame},
{phase := e_testbody6, bcm_frame := v_bcm_read_status_frame}
} }
v_ptc_bcmConfigurator.start(f_ptc_bcmComandSendReceiveInitiator(v_cmds)) v_ptc_bcmConfigurator.start(f_ptc_bcmComandSendReceiveInitiator(v_cmds))
var SocketCAN_CAN_or_CAN_FD_frame v_frame_to_receive1, v_frame_to_receive5 var SocketCAN_CAN_or_CAN_FD_frame v_frame_to_receive1
v_frame_to_receive1 := {can_frame := v_can_frame1} v_frame_to_receive1 := {can_frame := v_can_frame1}
v_frame_to_receive5 := {can_frame := v_can_frame5}
// stop when receiving v_frame_to_receive
v_ptc_rawFrameReceiver1.start(f_ptc_RawFrameReceiver(e_testbody3, v_frame_to_receive1))
// stop when receiving v_frame_to_receive // stop when receiving v_frame_to_receive
v_ptc_rawFrameReceiver2.start(f_ptc_RawFrameSequenceReceiver(e_testbody5, a_expected_can_frames, e_testbody6, 2.0)) v_ptc_rawFrameReceiver1.start(f_ptc_RawFrameReceiver(e_testbody1, v_frame_to_receive1))
var e_Phase v_phase var e_Phase v_phase
...@@ -234,7 +328,6 @@ v_bcm_activation_frame := { ...@@ -234,7 +328,6 @@ v_bcm_activation_frame := {
disconnect(mtc:pt_sync, v_ptc_bcmConfigurator:pt_sync) disconnect(mtc:pt_sync, v_ptc_bcmConfigurator:pt_sync)
disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync) disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver1:pt_sync)
disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver2:pt_sync)
all component.kill; all component.kill;
} }
......
...@@ -22,7 +22,7 @@ import from Can all ...@@ -22,7 +22,7 @@ import from Can all
import from Raw all import from Raw all
import from CanError all import from CanError all
testcase tc_can_raw_send_and_receive_frame() runs on MTC { testcase tc_can_raw_send_and_receive_can_frame() runs on MTC {
var PTC v_ptc_rawSendInitiator := PTC.create("PTC1_ptc_rawSendInitiator") alive var PTC v_ptc_rawSendInitiator := PTC.create("PTC1_ptc_rawSendInitiator") alive
var PTC v_ptc_rawFrameReceiver := PTC.create("PTC2_ptc_rawFrameReceiver") alive var PTC v_ptc_rawFrameReceiver := PTC.create("PTC2_ptc_rawFrameReceiver") alive
...@@ -57,6 +57,45 @@ testcase tc_can_raw_send_and_receive_frame() runs on MTC { ...@@ -57,6 +57,45 @@ testcase tc_can_raw_send_and_receive_frame() runs on MTC {
all component.kill; all component.kill;
} }
testcase tc_can_raw_send_and_receive_canfd_frame() runs on MTC {
var PTC v_ptc_rawSendInitiator := PTC.create("PTC1_ptc_rawSendInitiator") alive
var PTC v_ptc_rawFrameReceiver := PTC.create("PTC2_ptc_rawFrameReceiver") alive
f_addSyncSlaveSet(v_ptc_rawSendInitiator, v_PTCSet)
f_addSyncSlaveSet(v_ptc_rawFrameReceiver, v_PTCSet)
connect(mtc:pt_sync, v_ptc_rawSendInitiator:pt_sync)
connect(mtc:pt_sync, v_ptc_rawFrameReceiver:pt_sync)
var SocketCAN_CAN_or_CAN_FD_frame v_canfd_frame_to_send
v_canfd_frame_to_send := {canfd_frame :=
{can_id := '00000015'O,
can_flags := '10101010'B,
can_pdu := '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'O}
}
v_ptc_rawSendInitiator.start(f_ptc_RawSendInitiator(e_testbody2, v_canfd_frame_to_send))
v_ptc_rawFrameReceiver.start(f_ptc_RawFrameReceiver(e_testbody3, v_canfd_frame_to_send))
var e_Phase v_phase
for(v_phase := c_firstPhase; v_phase < e_testcase_complete;v_phase := f_incMTCPhase(v_phase)) {
f_startPhase(v_phase)
log("MTC: ", v_phase)
f_awaitEndPhase(v_phase)
}
all component.done;
log("MTC done")
disconnect(mtc:pt_sync, v_ptc_rawSendInitiator:pt_sync)
disconnect(mtc:pt_sync, v_ptc_rawFrameReceiver:pt_sync)
all component.kill;
}
testcase tc_can_raw_setsockopt_CAN_RAW_FILTER() runs on MTC { testcase tc_can_raw_setsockopt_CAN_RAW_FILTER() runs on MTC {
var PTC v_ptc_rawSetFilters := PTC.create("PTC1_ptc_rawSetFilters") alive var PTC v_ptc_rawSetFilters := PTC.create("PTC1_ptc_rawSetFilters") alive
......
/* Copyright (c) 2010, 2016 Ericsson AB /* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Michael Josenhans * Michael Josenhans
******************************************************************************/ ******************************************************************************/
// //
// File: SocketCANtest.ttcn // File: SocketCANtest.ttcn
// Description: SocketCAN port type test // Description: SocketCAN port type test
// //
module SocketCAN_Templates { module SocketCAN_Templates {
import from SocketCAN_Types all; import from SocketCAN_Types all;
import from Bcm all import from Bcm all
import from Can all import from Can all
template SocketCAN_Result a_result(in SocketCAN_Result_code v_result_code) := { template SocketCAN_Result a_result(in SocketCAN_Result_code v_result_code) := {
result_code := v_result_code, result_code := v_result_code,
err := *, err := *,
err_text := * err_text := *
} }
template SocketCAN_socket_result template SocketCAN_socket_result
a_SocketCAN_socket_result(template SocketCAN_Result p_result) := { a_SocketCAN_socket_result(template SocketCAN_Result p_result) := {
id := ?, id := ?,
result := p_result result := p_result
} }
template SocketCAN_ioctl_result template SocketCAN_ioctl_result
a_SocketCAN_ioctl_result(template SocketCAN_Result p_result) := { a_SocketCAN_ioctl_result(template SocketCAN_Result p_result) := {
ifr := ?, ifr := ?,
result := p_result result := p_result
} }
template SocketCAN_connect_result template SocketCAN_connect_result
a_SocketCAN_connect_result(template SocketCAN_Result p_result) := { a_SocketCAN_connect_result(template SocketCAN_Result p_result) := {
result := p_result result := p_result
} }
template SocketCAN_bind_result template SocketCAN_bind_result
a_SocketCAN_bind_result(template SocketCAN_Result p_result) := { a_SocketCAN_bind_result(template SocketCAN_Result p_result) := {
result := p_result result := p_result