lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2026

  • 1 participants
  • 870 discussions
[M] Change in osmo-ttcn3-hacks[master]: CCID: Check if reader restarts WWT upon NULL procedure byte
by laforge 11 Jun '26

11 Jun '26
Attention is currently required from: jolly. laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42802?usp=email ) Change subject: CCID: Check if reader restarts WWT upon NULL procedure byte ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42802?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I4eb09e86f88df19d96e9ec55872654352ca2ebd5 Gerrit-Change-Number: 42802 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Thu, 11 Jun 2026 13:10:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Check if reader handles special P3 value 0x00 correctly
by laforge 11 Jun '26

11 Jun '26
Attention is currently required from: jolly. laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42801?usp=email ) Change subject: CCID: Check if reader handles special P3 value 0x00 correctly ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42801?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Icc3fd1937b9829fcf825c58d7b676aa2be2c48e7 Gerrit-Change-Number: 42801 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Thu, 11 Jun 2026 13:09:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Check if reader accepts highest P3 value 0xff
by laforge 11 Jun '26

11 Jun '26
Attention is currently required from: jolly. laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42800?usp=email ) Change subject: CCID: Check if reader accepts highest P3 value 0xff ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42800?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I298795d791f2964758bd4792e10131f92cf561bc Gerrit-Change-Number: 42800 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Thu, 11 Jun 2026 13:09:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Check if reader times out while expecting status words
by laforge 11 Jun '26

11 Jun '26
Attention is currently required from: jolly. laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42799?usp=email ) Change subject: CCID: Check if reader times out while expecting status words ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42799?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I054b56a9e2f10e5b984ad0398efb4be5696ce16c Gerrit-Change-Number: 42799 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Thu, 11 Jun 2026 13:09:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: CCID: Update titan.TestPorts.USB to current head
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42828?usp=email ) Change subject: CCID: Update titan.TestPorts.USB to current head ...................................................................... CCID: Update titan.TestPorts.USB to current head Update the USB test port dependency to include recent changes and bugfixes that are required for further CCID tests. Change-Id: I9dd769d2098822721f673b1293542fffa46542cc --- M deps/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index 49f601b..0bd40b4 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -123,7 +123,7 @@ titan.TestPorts.TELNETasp_commit= 873fe539642542cd9a901c208f1ec11c6d2f5387 titan.TestPorts.UDPasp_commit= 54176e95850654e5e8b0ffa2f1b5f35c412b949c titan.TestPorts.UNIX_DOMAIN_SOCKETasp_commit= R.2.A-13-gd34ab71 -titan.TestPorts.USB_commit= a9470fdc99c82fbf988f4508c3161118c9106e28 +titan.TestPorts.USB_commit= 4c2a9a55a5d3d635e08d851f55a171dd3f8b443c osmo-uecups_commit= ee9b225a66c2f84bcdcaf2fc27ee73d6aeb33b8e all: $(foreach dir,$(ALL_REPOS),$(dir)/update) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42828?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I9dd769d2098822721f673b1293542fffa46542cc Gerrit-Change-Number: 42828 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Truncated APDU test
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42791?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: CCID: Truncated APDU test ...................................................................... CCID: Truncated APDU test A SELECT APDU must have a header + two bytes of data (what to select). The test truncates this APDU in all variants, ranging from 6 bytes down to 0 bytes. The reader may respond with an error caused by invald request or with and error caused by timeout of the SIM. Change-Id: I3df2ad9871bccdd03f618a6a457671adb1624590 --- M ccid/CCID_Tests.ttcn 1 file changed, 41 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn index f5dae50..107d00d 100644 --- a/ccid/CCID_Tests.ttcn +++ b/ccid/CCID_Tests.ttcn @@ -43,6 +43,7 @@ const octetstring c_SIM_SELECT_EF_ICCID := '00A4000C022FE2'O; const octetstring c_SIM_READ_BINARY := '00B000000A'O; const octetstring c_UICC_GET_RESPONSE_BASE := 'a0c00000'O; +const octetstring c_UICC_TRUNCATED := '00a40004'O; /* Table 7 of ISO7816-3 */ type enumerated ISO7816_Fi { @@ -564,9 +565,47 @@ f_start_and_wait(); } +/* truncated transfer */ +private function f_TC_truncated() runs on Slot_CT +{ + var integer i; + var octetstring req; + var CCID_PDU pdu; + const record of octetstring c_status := { '6700'O, '6700'O, '6700'O, '6d00'O, '6881'O }; + + f_ccid_power_on(); + for (i := 4; i >= 0; i := i-1) { + log("Testing trunkted transfer block with ", i, " octet(s)."); + req := substr(c_UICC_TRUNCATED, 0, i); + pdu := f_ccid_xfr_pdu(req, ?); + if (pdu.hdr_in.bStatus.bmCommandStatus == CCID_CMD_STATUS_FAILED) { + log("Command failed as expected."); + continue; + } + if (pdu.u.DataBlock.abData == c_status[4 - i]) { + log("Got expected status result. (status ", c_status[4 - i], ")"); + continue; + } + setverdict(fail, "Unexpected SW1/SW2. (expected ", c_status[4 - i], ", got ", + pdu.u.DataBlock.abData, ")"); + mtc.stop; + } +} +testcase TC_truncated() runs on Test_CT +{ + var integer i; + + f_init(); + + for (i := 0; i < mp_use_slot_count; i := i+1) { + f_start_handler(refers(f_TC_truncated), i); + } + + f_start_and_wait(); +} + /* TODO */ -/* truncated message */ /* IccPowerOn with wrong voltage (> 0x04) */ /* XfrBlock on empty slot */ /* GetParameters on empty slot */ @@ -606,6 +645,7 @@ } execute( TC_unsupp_mechanical() ); execute( TC_unsupp_secure() ); + execute( TC_truncated() ); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42791?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3df2ad9871bccdd03f618a6a457671adb1624590 Gerrit-Change-Number: 42791 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: SIMTRACE: Add missing pres_pol to CardEmu_BD_Config message
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42792?usp=email ) Change subject: SIMTRACE: Add missing pres_pol to CardEmu_BD_Config message ...................................................................... SIMTRACE: Add missing pres_pol to CardEmu_BD_Config message Change-Id: I443e8151b0aa9bff150222ab6b507ed1f7946768 --- M library/SIMTRACE_Templates.ttcn M library/SIMTRACE_Types.ttcn 2 files changed, 6 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/library/SIMTRACE_Templates.ttcn b/library/SIMTRACE_Templates.ttcn index 05f738f..d9e6c9a 100644 --- a/library/SIMTRACE_Templates.ttcn +++ b/library/SIMTRACE_Templates.ttcn @@ -217,12 +217,14 @@ template (value) SIMTRACE_PDU ts_SIMTRACE_CEMU_CONFIG(template (value) CardEmu_FeatureFlags flags) := ts_SIMTRACE(SIMTRACE_MSGT_BD_CEMU_CONFIG, { cardem_bd_config := { features := flags, - slot_mux_nr := 0} }); + slot_mux_nr := 0, + pres_pol := 0} }); template (present) SIMTRACE_PDU tr_SIMTRACE_CEMU_CONFIG(template (present) CardEmu_FeatureFlags flags) := tr_SIMTRACE(SIMTRACE_MSGT_BD_CEMU_CONFIG, { cardem_bd_config := { features := flags, - slot_mux_nr := * } }); + slot_mux_nr := *, + pres_pol := * } }); /*********************************************************************** diff --git a/library/SIMTRACE_Types.ttcn b/library/SIMTRACE_Types.ttcn index d28df2f..55f5541 100644 --- a/library/SIMTRACE_Types.ttcn +++ b/library/SIMTRACE_Types.ttcn @@ -274,7 +274,8 @@ type record CardEmu_BD_Config { CardEmu_FeatureFlags features, - uint8_t slot_mux_nr optional + uint8_t slot_mux_nr optional, + uint8_t pres_pol optional }; /*********************************************************************** -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42792?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I443e8151b0aa9bff150222ab6b507ed1f7946768 Gerrit-Change-Number: 42792 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Check if reader handles truncated SIM response
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42795?usp=email ) Change subject: CCID: Check if reader handles truncated SIM response ...................................................................... CCID: Check if reader handles truncated SIM response The reader knows how many byte of data is expected in the SIM response. The emulated SIM will truncate that response, so that some data and the final status words are not sent by the SIM. The tests expects the reader to time out and return an appropriate error core. Change-Id: I6db6d7889a1355ee9aa2005e676fed5d20a3f2dc --- M ccid/CCID_Tests.ttcn 1 file changed, 39 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Hoernchen: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn index 158aa6e..e63044b 100644 --- a/ccid/CCID_Tests.ttcn +++ b/ccid/CCID_Tests.ttcn @@ -760,6 +760,44 @@ f_start_and_wait(); } +/* The SIM responds with truncated response. */ +private function f_TC_truncated_response() runs on CardemSlot_CT +{ + var octetstring req := c_SIM_READ_BINARY; + var octetstring res := '0102030405060708090a9000'O; + var CCID_PDU ccid_pdu; + + f_cardem_manager(); + + f_ccid_power_on(CCID_PWRSEL_3V0); + + /* Send a request towards reader. */ + CCID.send(ts_CCID_XfrBlock(g_slot_nr, req, 0)); + /* Receive the request by SIM. */ + f_cardem_receive(tr_SIMTRACE_CEMU_RX_DATA(?, req)); + /* Transmit the response by SIM. */ + f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := true), + req[1] & substr(res, 0, 5))); + /* Receive the response from reader. */ + ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?)); + if (ccid_pdu.hdr_in.bError != CCID_ERR_ICC_MUTE) { + setverdict(fail, "Unexpected Response or error code"); + mtc.stop; + } + + /* Stop simtrace emulation, to prevent race condition. */ + vc_Cardem.stop; + vc_Cardem.done; +} +testcase TC_truncated_response() runs on Test_CT +{ + f_init(); + + f_start_handler(refers(f_TC_truncated_response), mp_simtrace_slot, true); + + f_start_and_wait(); +} + /* TODO */ /* IccPowerOn with wrong voltage (> 0x04) */ @@ -803,7 +841,7 @@ execute( TC_unsupp_mechanical() ); execute( TC_unsupp_secure() ); execute( TC_truncated() ); - + execute( TC_truncated_response() ); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42795?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I6db6d7889a1355ee9aa2005e676fed5d20a3f2dc Gerrit-Change-Number: 42795 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: CCID: Integrate SIMTRACE emulation into test cases
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42793?usp=email ) Change subject: CCID: Integrate SIMTRACE emulation into test cases ...................................................................... CCID: Integrate SIMTRACE emulation into test cases This integration allows to add tests that use SIMtrace hardware instead of a physical SIM. These tests can be used to test handling of invalid behaviors, such as invalid responses or timeouts. The number of slots (mp_use_slot_count) are reduced to 7, so that the 8th slot can be used with a SIMtrace for subsequent tests. Change-Id: Ia27dd5198edb188bc73196ac3fbd6d56ba75812e --- M ccid/CCID_Tests.ttcn M ccid/gen_links.sh 2 files changed, 132 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn index 107d00d..0715fba 100644 --- a/ccid/CCID_Tests.ttcn +++ b/ccid/CCID_Tests.ttcn @@ -3,6 +3,7 @@ /* TTCN-3 tests for USB CCID (Chip Card Interface Device) * * (C) 2018-2019 by Harald Welte <laforge(a)gnumonks.org> + * (C) 2026 by Andreas Eversberg <aeversberg(a)sysmocom.de> */ import from General_Types all; @@ -16,18 +17,33 @@ import from CCID_Templates all; import from CCID_Emulation all; +import from SIMTRACE_Types all; +import from SIMTRACE_Templates all; +import from SIMTRACE_Emulation all; + modulepar { USB_Device_Match mp_usb_dev_match := { vid_pid := { vid := '1d50'H, pid := '6141'H } }; - integer mp_use_slot_count := 8; + USB_Device_Match mp_cardem_usb_dev_match := { vid_pid := { vid := '1d50'H, pid := '60e3'H } }; + integer mp_use_slot_count := 7; + integer mp_simtrace_slot := 7; boolean mp_test_power_off := true; boolean mp_test_set_params := false; boolean mp_quirk_resetpar_returns_slotsts := false; } + /* global test component; manages CCID device */ type component Test_CT { var CCID_Emulation_CT vc_CCID; port USB_PT USB; - var Slot_CT vc_SLOT[NR_SLOTS]; + var CardemSlot_CT vc_SLOT[NR_SLOTS]; + var ST_Emulation_CT vc_cardem_ref[NR_SLOTS]; + private var boolean Cardem_In_Use := false; +}; + +type component CardemSlot_CT extends Slot_CT { + var ST_Emulation_CT vc_Cardem := null; + port ST_USER_PT ST; + port ST_USER_PT ST_IRQ; }; /* maximum number of slots we are supporting in the test suite */ @@ -93,28 +109,46 @@ } }; -type function void_fn() runs on Slot_CT; +type function void_fn() runs on CardemSlot_CT; -/* first function inside Slot_CT; wait for CCID_EVENT_UP + call testcase-specific function */ -private function f_handler_init(void_fn fn, integer slot_nr) runs on Slot_CT { +/* first function inside CardemSlot_CT; wait for CCID_EVENT_UP + call testcase-specific function */ +private function f_handler_init(void_fn fn, integer slot_nr, ST_Emulation_CT v_cardem_ref) runs on CardemSlot_CT { g_slot_nr := slot_nr; - CCID.receive(CCID_Emulation_Event:{up_down:=CCID_EVENT_UP}); + vc_Cardem := v_cardem_ref; g_Tguard.start; activate(as_Tguard()); + CCID.receive(CCID_Emulation_Event:{up_down:=CCID_EVENT_UP}); fn.apply(); } /* start a single slot handler */ -private function f_start_handler(void_fn fn, integer slot_nr) runs on Test_CT +private function f_start_handler(void_fn fn, integer slot_nr, boolean use_cardem := false) runs on Test_CT { - var Slot_CT vc; + var ST_Emulation_CT vc_Cardem := null; - vc_SLOT[slot_nr] := Slot_CT.create("Slot" & int2str(slot_nr)); + vc_SLOT[slot_nr] := CardemSlot_CT.create("Slot" & int2str(slot_nr)); connect(vc_SLOT[slot_nr]:CCID, vc_CCID:SLOT[slot_nr]); - vc_SLOT[slot_nr].start(f_handler_init(fn, slot_nr)); + + if (use_cardem) { + if (Cardem_In_Use) { + setverdict(fail, "Only one CCID slot handler can use Cardem."); + mtc.stop; + } + vc_Cardem := ST_Emulation_CT.create("Cardem"); + map(vc_Cardem:USB, system:USB); + connect(vc_Cardem:INOUT, vc_SLOT[slot_nr]:ST); + connect(vc_Cardem:IRQ, vc_SLOT[slot_nr]:ST_IRQ); + Cardem_In_Use := true; + } + + vc_cardem_ref[slot_nr] := vc_Cardem; + + vc_SLOT[slot_nr].start(f_handler_init(fn, slot_nr, vc_Cardem)); + } +/* start a single Cardem slot handler */ private function f_wait_handlers_complete() runs on Test_CT { var integer i; @@ -127,9 +161,19 @@ } private function f_start_and_wait() runs on Test_CT { - /* start CCID_Emulation last, it will trigger all the per-slot components */ - var CCID_Emulation_Params cep := { usb_dev_match := mp_usb_dev_match }; - vc_CCID.start(CCID_Emulation.main(cep)); + var integer i; + + /* start CCID_Emulation and Cardem_Emulation last, it will trigger all the per-slot components */ + var CCID_Emulation_Params ccidp := { usb_dev_match := mp_usb_dev_match }; + var USB_IF_Params cardemp := { usb_dev_match := mp_cardem_usb_dev_match, usb_if_nr := 0 }; + vc_CCID.start(CCID_Emulation.main(ccidp)); + for (i := 0; i < NR_SLOTS; i := i+1) { + if (vc_SLOT[i] != null) { + if (vc_cardem_ref[i] != null) { + vc_cardem_ref[i].start(SIMTRACE_Emulation.main(cardemp)); + } + } + } f_wait_handlers_complete(); } @@ -142,7 +186,81 @@ } } +altstep as_cardem_any() runs on CardemSlot_CT { + var SIMTRACE_PDU pdu; + [] ST.receive(SIMTRACE_PDU:?) -> value pdu { + setverdict(fail, "Received unexpected CCID ", pdu); + self.stop; + } + [] ST.receive { + setverdict(fail, "Received unexpected non-CCID"); + self.stop; + } +} +/* transceive a Cardem command (expect 'rx' on IN) */ +function f_cardem_receive(template (present) SIMTRACE_PDU exp_rx) +runs on CardemSlot_CT return SIMTRACE_PDU { + var SIMTRACE_PDU pdu; + + alt { + [] ST.receive(exp_rx) -> value pdu { + return pdu; + } + [] as_cardem_any(); + } + return pdu; +} + +function f_cardem_transmit(template (value) SIMTRACE_PDU tx) +runs on CardemSlot_CT { + ST.send(tx); +} + +altstep as_cardem_manager() runs on CardemSlot_CT { + var SIMTRACE_PDU pdu; + + [] ST.receive(tr_SIMTRACE_CEMU_CONFIG(tr_FeatureFlags(true))) { + log("Got Config."); + repeat; + } + [] ST_IRQ.receive(tr_SIMTRACE_MODEM_STATUS()) { + log("Got Status."); + repeat; + } + [] ST.receive(tr_SIMTRACE_CEMU_PTS(?, ?)) { + log("Got PTS info."); + repeat; + } +} + +function f_cardem_manager() runs on CardemSlot_CT { + if (vc_Cardem == null) { + setverdict(fail, "Please enable Cardem support first."); + mtc.stop; + } + + activate(as_cardem_manager()); + + f_cardem_transmit(ts_SIMTRACE_CEMU_CONFIG(ts_FeatureFlags(true))); + f_cardem_transmit(ts_SIMTRACE_MODEM_SIM_SELECT(SIM_SELECT_REMOTE)); + f_cardem_transmit(ts_SIMTRACE_CEMU_SET_ATR('3b00'O)); + f_cardem_transmit(ts_SIMTRACE_CEMU_CARDINSERT(1)); + f_cardem_transmit(ts_SIMTRACE_MODEM_RESET(MODEM_RESET_PULSE, 300)); + f_cardem_transmit(ts_SIMTRACE_CEMU_SET_ATR('3b9f96801f878031e073fe211b674a4c753034054ba9'O)); + f_sleep(0.2); +} + +private function f_ccid_receive(template (present) CCID_PDU pdu_exp) runs on Slot_CT return CCID_PDU { + var CCID_PDU pdu_rx; + alt { + [] CCID.receive(pdu_exp) -> value pdu_rx { + } + [] as_ccid_any(); + } + + return pdu_rx; +} /*********************************************************************** * Test behavior regarding valid situations diff --git a/ccid/gen_links.sh b/ccid/gen_links.sh index dac7ffe..2f6f0ac 100755 --- a/ccid/gen_links.sh +++ b/ccid/gen_links.sh @@ -16,6 +16,7 @@ DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn " FILES+="Native_Functions.ttcn Native_FunctionDefs.cc " +FILES+="SIMTRACE_Types.ttcn SIMTRACE_Templates.ttcn SIMTRACE_Emulation.ttcn " gen_links $DIR $FILES gen_links_finish -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42793?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia27dd5198edb188bc73196ac3fbd6d56ba75812e Gerrit-Change-Number: 42793 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: CCID: Add test to verify a working Simtrace setup
by laforge 11 Jun '26

11 Jun '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42794?usp=email ) Change subject: CCID: Add test to verify a working Simtrace setup ...................................................................... CCID: Add test to verify a working Simtrace setup This test checks if a valid request is forwarded to SIMtrace and a valid response is returned back to the reader. Change-Id: I19264bc257024e9028996e417ff23bbbaebf5f92 --- M ccid/CCID_Tests.ttcn 1 file changed, 40 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn index 0715fba..158aa6e 100644 --- a/ccid/CCID_Tests.ttcn +++ b/ccid/CCID_Tests.ttcn @@ -591,6 +591,44 @@ f_start_and_wait(); } +/* A general test to verify a working simtrace. */ +private function f_TC_simtrace_test() runs on CardemSlot_CT +{ + var octetstring req := c_UICC_MANAGE_CHANNEL; + var octetstring res := '6200'O; + var CCID_PDU ccid_pdu; + + f_cardem_manager(); + + f_ccid_power_on(CCID_PWRSEL_3V0); + + /* Send a request towards reader. */ + CCID.send(ts_CCID_XfrBlock(g_slot_nr, req, 0)); + /* Receive the request by SIM. */ + f_cardem_receive(tr_SIMTRACE_CEMU_RX_DATA(?, req)); + /* Transmit the response by SIM. */ + f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := true), + res)); + /* Receive the response from reader. */ + ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?)); + if (ccid_pdu.u.DataBlock.abData != res) { + setverdict(fail, "Unexpected SW1/SW2"); + mtc.stop; + } + + /* Stop simtrace emulation, to prevent race condition. */ + vc_Cardem.stop; + vc_Cardem.done; +} +testcase TC_simtrace_test() runs on Test_CT +{ + f_init(); + + f_start_handler(refers(f_TC_simtrace_test), mp_simtrace_slot, true); + + f_start_and_wait(); +} + /* TODO */ @@ -755,6 +793,7 @@ execute( TC_successful_case_4() ); execute( TC_successful_case_1() ); execute( TC_successful_case_2_3() ); + execute( TC_simtrace_test() ); /* error handling */ execute( TC_inval_slot() ); @@ -764,6 +803,7 @@ execute( TC_unsupp_mechanical() ); execute( TC_unsupp_secure() ); execute( TC_truncated() ); + } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42794?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I19264bc257024e9028996e417ff23bbbaebf5f92 Gerrit-Change-Number: 42794 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • ...
  • 87
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.