Closed Bug 1159134 Opened 9 years ago Closed 9 years ago

[B2G][STK] Add Test Coverage for STK related requests.

Categories

(Firefox OS Graveyard :: Emulator, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog, firefox41 fixed)

RESOLVED FIXED
2.2 S14 (12june)
tracking-b2g backlog
Tracking Status
firefox41 --- fixed

People

(Reporter: bevis, Assigned: bevis)

References

Details

Attachments

(6 files, 6 obsolete files)

60 bytes, text/x-github-pull-request
edgar
: review+
Details | Review
60 bytes, text/x-github-pull-request
edgar
: review+
Details | Review
62 bytes, text/x-github-pull-request
edgar
: review+
Details | Review
62 bytes, text/x-github-pull-request
edgar
: review+
Details | Review
5.19 KB, patch
bevis
: review+
Details | Diff | Splinter Review
24.72 KB, patch
bevis
: review+
Details | Diff | Splinter Review
[Tracking Requested - why for this release]:

To ensure there won't be any regression after bug 1114938 (Refactor STK with IPDL) is fixed, I'd like to improve our test coverage for STK related requests defined MozIcc.webidl [1].

However, currently, there is no way to know what STK response exactly be sent into the modem for the verification.

AFAIK, the AT command of +CSIM is available in TS 27.007 to send raw APDU as a generic SIM IO for EF access, STK responses, and EAP/AKA authentications. [2] 

Hence, we could wrap the hex data of REQUEST_STK_SET_PROFILE, REQUEST_STK_SEND_ENVELOPE_COMMAND, REQUEST_STK_SEND_TERMINAL_RESPONSE into the APDU[3] with +CSIM and with an additional console command to peek the hex data from test case to verdict the test result.

The command APDU structure is defined as followed in [3]:
  Code  | Length |  Description
--------+--------+-------------------------------------
  CLA   |   1    | Class of Instruction
  INS   |   1    | Instruction Code
  P1    |   1    | Instruction Parameter 1
  P2    |   1    | Instruction Parameter 2
  Lc    |  0-1   | Length of Command Data
  Data  |  Lc    | Command Data String
  Le    |  0-1   | Maximum number of data bytes 
        |        | expected in response of the command

[1] https://dxr.mozilla.org/mozilla-central/source/dom/webidl/MozIcc.webidl#183-234
[2] http://www.etsi.org/deliver/etsi_ts/127000_127099/127007/08.05.00_60/ts_127007v080500p.pdf
[3] http://www.etsi.org/deliver/etsi_ts/102200_102299/102221/09.02.00_60/ts_102221v090200p.pdf
Hi Edgar,

May I have your review for this changes?

Thanks!
Attachment #8604024 - Flags: review?(echen)
Hi Edgar,

May I have your review for this change?

Thanks!
Attachment #8604025 - Flags: review?(echen)
Attachment #8604025 - Attachment is patch: true
Attachment #8604025 - Attachment mime type: text/x-github-pull-request → text/plain
Attachment #8604024 - Attachment description: Part 1: Map STK related requests into +CSIM command. r=echen → Part 1: Map STK related requests into +CSIM command.
Attachment #8604025 - Attachment is patch: false
Attachment #8604025 - Attachment mime type: text/plain → text/x-github-pull-request
Per offline discussion, please also help to attach the test you wanna to add in this bug as well. Thank you.
(In reply to Edgar Chen [:edgar][:echen] from comment #3)
> Per offline discussion, please also help to attach the test you wanna to add
> in this bug as well. Thank you.

Sure, I'll move the related test cases I've done locally for bug 1114938 to this one for further review.
Summary: [B2G][STK] Add support to peek last +CSIM request from console command. → [B2G][STK] Add Test Coverage for STK related requests.
This patch include the fix of improper CTLV encoding in STK related request.

Hi Edgar,

May I have your review for these changes?

Thanks!
Attachment #8605638 - Flags: review?(echen)
Add Marionette test cases for STK related requests.
Attachment #8605639 - Flags: review?(echen)
Since I am working on the branching/porting things (see bug 1163968) now, please expect a delayed response and you probably need to rebase and provide a new PR after it's done.
Comment on attachment 8604024 [details] [review]
Part 1: Map STK related requests into +CSIM command.

Looks good, but master is for emulator-kk now, please also send a PR to b2g-ril_v7 [1] which is for emualtor-ics. Thank you.

[1] https://github.com/mozilla-b2g/platform_hardware_ril/commits/b2g-ril_v7
Attachment #8604024 - Flags: review?(echen) → review+
Comment on attachment 8604025 [details] [review]
Part 2: Add new console command to peek last stk request.

Please see my comments on github. And emulator-ics now moves to b2g-ics branch, please create a new PR to b2g-ics branch. Thank you.
Attachment #8604025 - Flags: review?(echen)
Comment on attachment 8605638 [details] [diff] [review]
Part 3: Fix improper CTLV encoding in STK Responses

Review of attachment 8605638 [details] [diff] [review]:
-----------------------------------------------------------------

Please revise the commit title: Just start with `Part 1` for the gecko patch. Thank you.
Attachment #8605638 - Flags: review?(echen) → review+
Comment on attachment 8605639 [details] [diff] [review]
Part 4: Add Test Cases for STK related Requests.

Review of attachment 8605639 [details] [diff] [review]:
-----------------------------------------------------------------

Nice. Thank you.

::: dom/icc/tests/marionette/head.js
@@ +155,5 @@
> + *
> + * @return A deferred promise.
> + */
> +function peekLastRequestedApdu() {
> +  let cmd = "stk lastapdu";

Unused variable.
Attachment #8605639 - Flags: review?(echen) → review+
rename as part#1 patch in gecko.
Attachment #8610462 - Flags: review+
rename as part#2 patch in gecko.
Attachment #8605638 - Attachment is obsolete: true
Attachment #8605639 - Attachment is obsolete: true
Attachment #8610463 - Flags: review+
Attachment #8610445 - Flags: review?(echen) → review+
Attachment #8610446 - Flags: review?(echen) → review+
I just found the latest version of AT command spec (v12.8.0) has already defined commands for terminal response and envelope command [1], +CUSATT and +CUSATE. What about using those commands, instead of generic SIM IO? (Sorry, I should point this out early)

[1] http://www.etsi.org/deliver/etsi_ts/127000_127099/127007/12.08.00_60/ts_127007v120800p.pdf
(In reply to Edgar Chen [:edgar][:echen] from comment #18)
> I just found the latest version of AT command spec (v12.8.0) has already
> defined commands for terminal response and envelope command [1], +CUSATT and
> +CUSATE. What about using those commands, instead of generic SIM IO? (Sorry,
> I should point this out early)
> 
> [1]
> http://www.etsi.org/deliver/etsi_ts/127000_127099/127007/12.08.00_60/
> ts_127007v120800p.pdf

Never mind.
It's my mistake for not checking the latest version of this Spec.
It make our implementation more clear if we adopt these 2 UAT specific AT commands.

Thanks for pointing out this. :)
Comment on attachment 8610445 [details] [review]
Patch: (RIL_ICS) Map STK related requests into +CUSATT/+CUSATE command.

Per comment 18, I'll update this patch with new approach instead.
Attachment #8610445 - Flags: review+
Comment on attachment 8610446 [details] [review]
Patch: (RIL_KK) Map STK related requests into +CUSATT/+CUSATE command.

Per comment 18, I'll update this patch with new approach instead.
Attachment #8610446 - Flags: review+
Comment on attachment 8610447 [details] [review]
Patch: (RIL_ICS) Add new console command to peek last stk request.

Per comment 18, I'll update this patch with new approach instead.
Attachment #8610447 - Flags: review?(echen)
Comment on attachment 8610461 [details] [review]
Patch: (RIL_KK) Add new console command to peek last stk request.

Per comment 18, I'll update this patch with new approach instead.
Attachment #8610461 - Flags: review?(echen)
Comment on attachment 8610445 [details] [review]
Patch: (RIL_ICS) Map STK related requests into +CUSATT/+CUSATE command.

update implementation with +CUSATT/+CUSATE command.
Attachment #8610445 - Attachment description: Patch: (RIL_ICS) Map STK related requests into +CSIM command. → Patch: (RIL_ICS) Map STK related requests into +CUSATT/+CUSATE command.
Attachment #8610445 - Attachment is patch: true
Attachment #8610445 - Attachment mime type: text/x-github-pull-request → text/plain
Attachment #8610445 - Flags: review?(echen)
Comment on attachment 8610446 [details] [review]
Patch: (RIL_KK) Map STK related requests into +CUSATT/+CUSATE command.

update implementation with +CUSATT/+CUSATE command.
Attachment #8610446 - Attachment description: Patch: (RIL_KK) Map STK related requests into +CSIM command. → Patch: (RIL_KK) Map STK related requests into +CUSATT/+CUSATE command.
Attachment #8610446 - Attachment is patch: true
Attachment #8610446 - Attachment mime type: text/x-github-pull-request → text/plain
Attachment #8610446 - Flags: review?(echen)
Comment on attachment 8610447 [details] [review]
Patch: (RIL_ICS) Add new console command to peek last stk request.

update pull request with +CUSATT/+CUSATE adopted.
Attachment #8610447 - Attachment is patch: true
Attachment #8610447 - Attachment mime type: text/x-github-pull-request → text/plain
Attachment #8610447 - Flags: review?(echen)
Comment on attachment 8610461 [details] [review]
Patch: (RIL_KK) Add new console command to peek last stk request.

update pull request with +CUSATT/+CUSATE adopted.
Attachment #8610461 - Attachment is patch: true
Attachment #8610461 - Attachment mime type: text/x-github-pull-request → text/plain
Attachment #8610461 - Flags: review?(echen)
Attachment #8610445 - Attachment is patch: false
Attachment #8610445 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8610446 - Attachment is patch: false
Attachment #8610446 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8610447 - Attachment is patch: false
Attachment #8610447 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8610461 - Attachment is patch: false
Attachment #8610461 - Attachment mime type: text/plain → text/x-github-pull-request
update final patch.
Attachment #8610462 - Attachment is obsolete: true
Attachment #8612164 - Flags: review+
update final patch.
Attachment #8610463 - Attachment is obsolete: true
Attachment #8612166 - Flags: review+
Comment on attachment 8610445 [details] [review]
Patch: (RIL_ICS) Map STK related requests into +CUSATT/+CUSATE command.

Thank you.
Attachment #8610445 - Flags: review?(echen) → review+
Attachment #8610446 - Flags: review?(echen) → review+
Comment on attachment 8610447 [details] [review]
Patch: (RIL_ICS) Add new console command to peek last stk request.

Looks good. Thank you.
Attachment #8610447 - Flags: review?(echen) → review+
Attachment #8610461 - Flags: review?(echen) → review+
Set checkin-needed for emulator parts at 1st stage and keep this bug open to set checkin-needed again for gecko parts at 2nd stage.
Keywords: checkin-needed
Whiteboard: [KEEP_STATUS_OPEN]
sorry, not aware of the nits to be addressed.
I'll update the patch again in emulator parts.
Keywords: checkin-needed
Whiteboard: [KEEP_STATUS_OPEN]
Address nits in github.

Set checkin-needed for emulator parts at 1st stage and 
keep this bug open to set checkin-needed again for gecko parts at 2nd stage.
Keywords: checkin-needed
Whiteboard: [KEEP_STATUS_OPEN]
I will help to merge, thank you.
Keywords: checkin-needed
try server result is green:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=99b44a488587

set checkin-needed for landing gecko patches. 
i.e., attachment #8612164 [details] [diff] [review] and attachment 8612166 [details] [diff] [review].
Keywords: checkin-needed
Whiteboard: [KEEP_STATUS_OPEN]
https://hg.mozilla.org/mozilla-central/rev/ec84531589e4
https://hg.mozilla.org/mozilla-central/rev/abeb01323218
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S14 (12june)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: