6.3.9 File System Context

3GPP51.013Release 17Test specification for Subscriber Identity Module (SIM) Application Programming Interface (API) for Java CardTS

6.3.9.1 Initial Context

Test Area Reference: FWK_FSC_INIT

6.3.9.1.1 Conformance Requirements

6.3.9.1.1.1 Normal Execution

  • CRRN1: At the invocation of the processToolkit method of a toolkit applet, the current file is the MF.

6.3.9.1.1.2 Parameters errors

No requirements.

6.3.9.1.1.3 Context errors

No requirements.

6.3.9.1.2 Test Suite Files

Test Script: FWK_FSC_INIT_1.scr

Test Applet: FWK_FSC_INIT_1.java

FWK_FSC_INIT_2.java

Load Script: FWK_FSC_INIT_1.ldr

Cleanup Script: FWK_FSC_INIT_1.clr

FWK_FSC_INIT_2.clr

Parameter File: FWK_FSC_INIT_1.par

6.3.9.1.3 Test Procedure

Id

Description

API/Framework Expectation

APDU Expectation

0

SIM Initialization

Responses ignored.

1

MF is the selected DF in processToolkit()

An ENVELOPE APDU containing a formatted SMS PP for Applet 1 is issued to the SIM

byte[] fci = new byte[10]

fciOffset = 0

fciLength = 7

status()

No exception shall be thrown.

Shall return 7.

fci shall contain the following part of the FCI structure:

< XX XX XX XX 3F 00 01 >

2

No EF is selected

rehabilitate ()

SIMView exception shall be thrown with reason NO_EF_SELECTED

3

MF is selected even when an applet triggered before selected any other file…

Applets 1 and 2 register to EVENT_DOWNLOAD_USER_ACTIVITY. Applet 1 has higher priority than Applet 2.

An ENVELOPE "EVENT – USER ACTIVITY" is sent to the SIM

1 – Applet 1:

– is triggered by event_event_download_user_activity

– selects DF_GSM and EF_IMSI

2 – Applet 2:

– is triggered by event_event_download_user_activity

fciOffset = 0

fciLength = 7

status()

3 – rehabilitate ()

1 – No exception shall be thrown.

2 – No exception shall be thrown. Shall return 7.

fci shall contain the following part of the FCI structure:

< XX XX XX XX 3F 00 01 >

3 – SIMView exception shall be thrown with reason NO_EF_SELECTED

6.3.9.1.4 Test Coverage

CRR Number

Test Case Number

CRRN1

1, 2, 3

6.3.9.2 Context Preservation (current file)

Test Area Reference: FWK_FSC_CUFI

6.3.9.2.1 Conformance Requirements

6.3.9.2.1.1 Normal execution

  • CRRN1: When calling the method select (), the current files (file context) of any other applets shall not be changed (see 3GPP TS 43.019 [7] – clause 5.2).
  • CRRN2: The select() methods select a file without changing the current file of any other applet or of the subscriber session.
  • CRRN3: After invocation of ProactiveHandler.send() method: the current file context of the toolkit applet is unchanged (see 3GPP TS 43.019 [7] – clause 5.2.).

6.3.9.2.1.2 Parameters errors

No requirements.

6.3.9.2.1.3 Context errors

No requirements.

6.3.9.2.2 Test Suite Files

Test Script: FWK_FSC_CUFI_1.scr

Test Applet: FWK_FSC_CUFI_1.java

FWK_FSC_CUFI_2.java

Load Script: FWK_FSC_CUFI_1.ldr

Cleanup Script: FWK_FSC_CUFI_1.clr

FWK_FSC_CUFI_2.clr

Parameter File: FWK_FSC_CUFI_1.par

6.3.9.2.3 Test Procedure

Id

Description

API/Framework Expectation

APDU Expectation

0

SIM Initialization

Responses ignored.

1

No change to file context by another applet

Applet1 registers to EVENT_FORMATTED_SMS_PP_ENV.

Applet2 registers to EVENT_CALL_CONTROL_BY_SIM

1 – Applet 1:

– is triggered by a formatted SMS

– selects DF_SIMTEST and EF_TARU

– fileOffset = 0; dataLength = 2; dataOffset = 0;

– buffer = {0xCA, 0xFE }

– updateBinary (): first 2 bytes of EF_TARU are written as ‘CA FE’.

– issues a proactive command "Get Inkey".

2 – An ENVELOPE APDU containing a CALL CONTROL BY SIM is issued to the SIM

Applet 2:

– is triggered by a CALL CONTROL BY SIM

– selects DF_TELECOM and EF_ADN.

3 – The terminal response for Get Inkey reactivates Applet 1:

– fileOffset = 0; respLength = 2; respOffset = 0;

– readBinary () info buffer2

1 – No exception shall be thrown.

2 – No exception shall be thrown.

3 – No exception shall be thrown. The value of buffer2 is { 0xCA, 0xFE }

A GET INKEY proactive command is fetched from the SIM

2

No change to file context by subscriber session

1 – Applet 1

– issues a proactive command "Get Inkey".

2 – Subscriber session selects DF_TELECOM and EF_ADN.

3 – The terminal response for Get Inkey reactivates Applet 1:

– fileOffset = 0; respLength = 2; respOffset = 0;

– readBinary () info buffer2

1 – No exception shall be thrown.

3 – No exception shall be thrown. The value of buffer2 is { 0xCA, 0xFE }

1 – A GET INKEY proactive command is fetched from the SIM

3

No change by applet of subscriber session context

1 – Applet 1:

– selects DF_SIMTEST and EF_TNU

– issues a proactive command "Get Inkey".

2 – subscriber session reads record 1 of current file (shall be EF_ADN)

3 – The terminal response for Get Inkey reactivates Applet 1, which terminates execution

1 – No exception shall be thrown.

3 – No exception shall be thrown.

1 – A GET INKEY proactive command is fetched from the SIM

2 – READ RECORD absolute number 1 shall read "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF" (from EFADN)

6.3.9.2.4 Test Coverage

CRR Number

Test Case Number

CRRN1

1

CRRN2

1, 2, 3

CRRN3

1,2

6.3.9.3 Context Preservation (current record pointer)

Test Area Reference: FWK_FSC_CURE

6.3.9.3.1 Conformance Requirements

6.3.9.3.1.1 Normal execution

  • CRRN1: When the seek method is called by one applet, the record pointer of any other applet is not changed.
  • CRRN2: updateRecord: the current record pointer of other applets / subscriber shall not be changed in case of linear fixed EF
  • CRRN3: updateRecord: the record pointer of a cyclic EF shall be changed for all other applets / subscriber to the record number 1.
  • CRRN4: readRecord: read data bytes of the linear fixed or cyclic EF currently selected by the applet without changing the current record pointer of any other applet / subscriber.
  • CRRN5: increase: the last updated record of the cyclic EF currently selected becomes record number 1 for every other applet and subscriber session.

6.3.9.3.1.2 Parameters errors

No requirements.

6.3.9.3.1.3 Context errors

No requirements.

6.3.9.3.2 Test Suite Files

Test Script: FWK_FSC_CURE_1.scr

Test Applet: FWK_FSC_CURE_1.java

FWK_FSC_CURE_2.java

Load Script: FWK_FSC_CURE_1.ldr

Cleanup Script: FWK_FSC_CURE_1.clr

FWK_FSC_CURE_2.clr

Parameter File: FWK_FSC_CURE_1.par

6.3.9.3.3 Test Procedure

Id

Description

API/Framework Expectation

APDU Expectation

0

SIM Initialization

Responses ignored.

1

Seek without affecting another record pointer

Applet1 registers to EVENT_FORMATTED_SMS_PP_ENV

Applet 2 registers to EVENT_CALL_CONTROL_BY_SIM

1 – Applet 1:

– is triggered by a formatted SMS event

– selects DF_SIMTEST and EF_LARU

– reads record 2 using NEXT so that the current record pointer is set to record 2

– issues a proactive command, e.g. Get Inkey.

2 – An ENVELOPE APDU containing a CALL CONTROL BY SIM is issued to the SIM

Applet 2:

– is triggered by a CALL CONTROL event

– selects DF_SIMTEST and EF_LARU

– performs a seek of pattern {0x55} from beginning forward, which finds record 1.

– returns from processToolkit

3 – The terminal response for Get Inkey reactivates Applet 1:

– call readRecord() using CURRENT

– the record read should still be record 2 of EF_LARU, containing {0xAA, 0xAA, 0xAA, 0xAA}

1 – No exception shall be thrown.

2 – No exception shall be thrown.

3 – No exception shall be thrown.

1 – A GET INKEY proactive command is fetched from the SIM

2

updateRecord in linear fixed EF without affecting current pointer of others

1 – Applet 1:

– is triggered by a formatted SMS event

– selects DF_SIMTEST and EF_LARU

– reads record 2 using NEXT so that the current record pointer is set to record 2

– issues a proactive command, e.g. Get Inkey.

2 – An ENVELOPE APDU containing a CALL CONTROL BY SIM is issued to the SIM

Applet 2:

– is triggered by a CALL CONTROL BY SIM event

– selects DF_SIMTEST and EF_LARU

– updates record 1, by using mode "NEXT".

– returns from processToolkit

3 – The terminal response for Get Inkey reactivates Applet 1:

– call readRecord() using CURRENT

– the record read should still be record 2 of EF_LARU, containing {0xAA, 0xAA, 0xAA, 0xAA}

1 – No exception shall be thrown.

2 – No exception shall be thrown.

3 – No exception shall be thrown.

1 – A GET INKEY proactive command is fetched from the SIM

3

readRecord in linear fixed EF without affecting current pointer of others

1 – Applet 1:

– is triggered by a formatted SMS event

– selects DF_SIMTEST and EF_LARU

– reads record 2 using NEXT so that the current record pointer is set to record 2

– issues a proactive command, e.g. Get Inkey.

2 – An ENVELOPE APDU containing a CALL CONTROL BY SIM is issued to the SIM

Applet 2:

– is triggered by a CALL CONTROL BY SIM event

– selects DF_SIMTEST and EF_LARU

– reads record 1, by using mode "NEXT".

– returns from processToolkit

3 – The terminal response for Get Inkey reactivates Applet 1:

– call readRecord() using CURRENT

– the record read should still be record 2 of EF_LARU, containing {0xAA, 0xAA, 0xAA, 0xAA}

1 – No exception shall be thrown.

2 – No exception shall be thrown.

3 – No exception shall be thrown.

1 – A GET INKEY proactive command is fetched from the SIM

6.3.9.3.4 Test Coverage

CRR Number

Test Case Number

CRRN1

1

CRRN2

2

CRRN3

not tested (see note)

CRRN4

3

CRRN5

not tested (see note)

NOTE: These requirements have not been tested because of an inconsistent behaviour in 3GPP TS 43.019 [7], which is foreseen to be corrected in future releases.