New issue
Advanced search Search tips

Issue 776425 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

factory: Add reference implementation of ActivateRegCode

Project Member Reported by hungte@chromium.org, Oct 19 2017

Issue description

In latest shopfloor service API, we have the ActivateRegCode implementation. This should be implemented by partner, but since the output was actually defined in CPFE ( https://www.google.com/chromeos/partner/fe/docs/factory/factoryregistrationguide.html ), we should have a reference implementation in Umpire and FactoryServer, so partners who forgot (or who thinks they don't need) doing it would still have some backup files on factory server.

Additionally, we should add a shopfloor_service@ActivateRegCode call in GRT_Items reference test list.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/c5439fd2182cdcbd3673cf5de715f653fae6c05b

commit c5439fd2182cdcbd3673cf5de715f653fae6c05b
Author: Wei-Han Chen <stimim@google.com>
Date: Fri Oct 20 13:08:58 2017

shopfloor service: default implementation for ActivateRegCode

Since the file format of registration_code_log.csv is specified on
ChormeOS Partner website, we can have a default implementation for
partners.

BUG= chromium:776425 
TEST=manual, make test

Change-Id: I6b9e4ebbf4f80f1a6b5d79545c60edd782446170
Reviewed-on: https://chromium-review.googlesource.com/729330
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Pi-Hsun Shih <pihsun@chromium.org>

[modify] https://crrev.com/c5439fd2182cdcbd3673cf5de715f653fae6c05b/py/shopfloor/shopfloor_service.py

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 20 2017

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 25 2017

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/9d7d743ab93129491b06125847ba8f0b3416e26d

commit 9d7d743ab93129491b06125847ba8f0b3416e26d
Author: Hung-Te Lin <hungte@chromium.org>
Date: Thu Oct 26 15:06:21 2017

test_lists: Move ActivateRegCode to GRTItems.

The ActivateRegCode should be in GRTItems so partners may override it.

BUG= chromium:776425 
TEST=manual

Change-Id: I58348661ab3c85d8bf7134fb90e1b88e743431e0
Reviewed-on: https://chromium-review.googlesource.com/737602
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>

[modify] https://crrev.com/9d7d743ab93129491b06125847ba8f0b3416e26d/py/test/test_lists/generic_grt.test_list.json

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/65aa648b54d7032080f8ca4dca81f6e4fc934298

commit 65aa648b54d7032080f8ca4dca81f6e4fc934298
Author: Hung-Te Lin <hungte@chromium.org>
Date: Mon Oct 30 08:31:34 2017

server: Add 'UploadCSVEntry' API for storing registration codes.

Not all partners need to implement their own version of ActivateRegCode
in shopfloor service. Since the format is fixed, we can put the
implementation in factory servers (factory_server and Umpire).

The new 'UploadCSVEntry' is a general function for storing data from
device that should not be associated with device serial number, for
example registration code. For factory_server, the CSV file will be
created in `shopfloor_data` folder. For Umpire, the data is in
`umpire_data/csv`.

For backward compatibility, a pytest can invoke
UploadCSVEntry('registration_code_log', [board, ubind, gbind, timestamp, hwid])
to get same results.

If a partner needs to have regcode also sent to their real shopfloor
backend, then they run `shopfloor_service` pytest using API
ActivateRegCode.

BUG= chromium:776425 
TEST=make test; manual invoked XMLRPC API 'UploadCSVEntry'
     manually invoked pytest 'Upload Reg Codes'

Change-Id: I80c0aa79120684b63ffd85cd077d83033c1d1704
Reviewed-on: https://chromium-review.googlesource.com/739682
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>

[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/test/test_lists/generic_common.test_list.json
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/shopfloor/factory_server.py
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/umpire/server/rpc_dut.py
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/po/zh-CN.po
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/shopfloor/factory_server_unittest.py
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/shopfloor/shopfloor_service.py
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/test/pytests/sync_factory_server.py
[modify] https://crrev.com/65aa648b54d7032080f8ca4dca81f6e4fc934298/py/test/test_lists/generic_grt.test_list.json

Owner: hungte@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment