Closed Bug 1077330 Opened 10 years ago Closed 9 years ago

[Wifi] Add marionette test for Wifi certificate functions.

Categories

(Firefox OS Graveyard :: Wifi, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
2.2 S8 (20mar)
Tracking Status
firefox39 --- fixed

People

(Reporter: chucklee, Assigned: chucklee)

References

Details

Attachments

(1 file, 3 obsolete files)

The test should include import server certificate, import user certificate, import pkcs12 certificate, list imported certificates, and delete imported certificates.
Do certificate function test by import, list, then delete certificate of different types.
Attachment #8500892 - Flags: feedback?(vchang)
Attachment #8500892 - Flags: feedback?(hchang)
Comment on attachment 8500892 [details] [diff] [review]
WIP - Marionette test for wifi certificate API.

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

Looks neat and good to me! However, test flow seems similar in all test cases. 
Is there any chance to have |doTestCert| which takes a testCertInfo as argument
to remove the duplicated code in all test cases?
Attachment #8500892 - Flags: feedback?(hchang) → feedback+
Address comment 2.
Attachment #8500892 - Attachment is obsolete: true
Attachment #8500892 - Flags: feedback?(vchang)
Attachment #8503958 - Flags: review?(vchang)
Attachment #8503958 - Flags: review?(hchang)
Comment on attachment 8503958 [details] [diff] [review]
Marionette test for wifi certificate API.

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

I think you attach the wrong patches.
Attachment #8503958 - Flags: review?(vchang)
Attach correct patch, thanks Vincent.
Attachment #8503958 - Attachment is obsolete: true
Attachment #8503958 - Flags: review?(hchang)
Attachment #8505177 - Flags: review?(vchang)
Attachment #8505177 - Flags: review?(hchang)
Comment on attachment 8505177 [details] [diff] [review]
Marionette test for wifi certificate API.

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

Nothing incorrect to me! Thanks :) You may consider to remove one use of if-else
as I comment. 

By the way, these test cases verify the certificate import/delete. Is the stock 
goldfish hostapd able to support using that certificate?

::: dom/wifi/test/marionette/head.js
@@ +1389,5 @@
> +          return aTestCaseChain().then(() => deleteCert(nickname));
> +        } else {
> +          return deleteCert(nickname);
> +        }
> +      })

It could be written more clearly as the following:

.then(function(list) {
  for (let i = 0; i < usage.length; i++) {
    isnot(list[usage[i]].indexOf(nickname), -1,
          "Certificate \"" + nickname + "\" of usage " + usage[i] + " is imported");
  }
})
.then(aTestCaseChain)
.then(() => deleteCert(nickname))
Attachment #8505177 - Flags: review?(hchang) → review+
Comment on attachment 8505177 [details] [diff] [review]
Marionette test for wifi certificate API.

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

Good job !!! I think we are going to have test cases for connecting to EAP-xxx type APs soon.
Attachment #8505177 - Flags: review?(vchang) → review+
(In reply to Henry Chang [:henry] from comment #6)
> Comment on attachment 8505177 [details] [diff] [review]
> Marionette test for wifi certificate API.
> 
> Review of attachment 8505177 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Nothing incorrect to me! Thanks :) You may consider to remove one use of
> if-else
> as I comment. 
> 
> By the way, these test cases verify the certificate import/delete. Is the
> stock 
> goldfish hostapd able to support using that certificate?
> 

Imported certificates can be accessed by gecko and wpa_supplicant.
Also server requires different set of certificate, I am checking if hostapd on emulator has internal EAP server and how to set it up if it supports.
Still trying to figure out why this patch keeps busting mochitest B2G ICS Emulator opt M9: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6acea0825ebb
Try works after retry without modifying patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2bb4304e699c
Added marionette tests(test_wifi_manage_server_certificate.js, test_wifi_manage_user_certificate.js, test_wifi_manage_pkcs12_certificate.js) are passed: http://ftp.mozilla.org/pub/mozilla.org/b2g/try-builds/chuckli0706@gmail.com-2bb4304e699c/try-emulator/try_ubuntu64_vm-b2g-emulator_test-marionette-webapi-bm123-tests1-linux64-build52.txt.gz
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1af5abd672d3
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S8 (20mar)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: