Skip to content

Cellular: Added power and sim greentea and unit tests. #7146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

jarvte
Copy link
Contributor

@jarvte jarvte commented Jun 6, 2018

Description

  • created power and sim greentea tests
  • added more power and sim unit tests.
  • added 'int do_reset' param to API CellularPower method "virtual nsapi_error_t set_power_level(int func_level, int do_reset = 1);"
    This does not affect to current behaviour as default value is 1 and then it behaves in the old way.
  • AT_CellularSIM::get_imsi(char *imsi) now returns with NSAPI_ERROR_PARAMETER if the given imsi is null. This changes how method behaves but it fixes a crash (and invalid usage of method) so should not make a difference if one thinks this as a API change.

Internal ref to defect: IOTCELL-903-916

@mirelachirica @AnttiKauppila please review.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@0xc0170 0xc0170 requested a review from a team June 6, 2018 12:34
AnttiKauppila
AnttiKauppila previously approved these changes Jun 6, 2018
@jarvte
Copy link
Contributor Author

jarvte commented Jun 11, 2018

@0xc0170 could you please trigger the tests?

@cmonr
Copy link
Contributor

cmonr commented Jun 12, 2018

/morph build

cmonr
cmonr previously approved these changes Jun 12, 2018
*
* @remark See 3GPP TS 27.007 CFUN for more details
*
* @return zero on success
*/
virtual nsapi_error_t set_power_level(int func_level) = 0;
virtual nsapi_error_t set_power_level(int func_level, int do_reset = 1) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking for 5.10 due to the API addition.

Otherwise, LGTM.

@mbed-ci
Copy link

mbed-ci commented Jun 12, 2018

Build : SUCCESS

Build number : 2327
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7146/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

MBED_ASSERT(err == NSAPI_ERROR_OK);
wait_for_power(pwr);

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we leaving this dead code in? What is the purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test code made but wasn't able to test it. We will test and uncomment it once we got bg96 to raas & ci.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather leave it out rather commented-out code on master (stash it or push it to your local branch). Once tested, will be added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented test removed.

@mbed-ci
Copy link

mbed-ci commented Jun 12, 2018

@jarvte jarvte dismissed stale reviews from cmonr and AnttiKauppila via 9056036 June 12, 2018 11:24
@jarvte jarvte force-pushed the add_cellular_sim_and_power_tests branch from 7e21829 to 9056036 Compare June 12, 2018 11:24
0xc0170
0xc0170 previously approved these changes Jun 12, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 12, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 13, 2018

Test result is from the previous changeset, we will need to restart CI again

@cmonr
Copy link
Contributor

cmonr commented Jun 13, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

Build : SUCCESS

Build number : 2343
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7146/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 14, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 14, 2018

Crud. @jarvte Looks like this'll need a rebase and anther pass through CI...

@jarvte jarvte force-pushed the add_cellular_sim_and_power_tests branch from 9056036 to 7e1b048 Compare June 15, 2018 06:03
@cmonr
Copy link
Contributor

cmonr commented Jun 15, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 16, 2018

Build : SUCCESS

Build number : 2359
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7146/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 16, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 16, 2018

@jarvte
Copy link
Contributor Author

jarvte commented Jun 18, 2018

@cmonr ci-morph-exporter failure not related to this pr

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 18, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jun 18, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 18, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jun 18, 2018

@0xc0170 0xc0170 requested a review from a team June 18, 2018 13:06
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 18, 2018

@ARMmbed/mbed-os-wan Please rereview (can't see here any approvals)

@jarvte
Copy link
Contributor Author

jarvte commented Jun 19, 2018

@cmonr please approve and merge

@cmonr cmonr merged commit d1dc1e8 into ARMmbed:master Jun 19, 2018
@cmonr
Copy link
Contributor

cmonr commented Jun 19, 2018

@jarvte I was looking at this again, and was wondering something.

  • added 'int do_reset' param to API CellularPower method "virtual nsapi_error_t set_power_level(int func_level, int do_reset = 1);"
    This does not affect to current behaviour as default value is 1 and then it behaves in the old way.

I marked this for 5.10 because of the code addition in features/cellular/framework/AT/AT_CellularPower.cpp that adds _at.write_int(do_reset); and modifies the default behavior.

Could you explain how do_reset = 1 does not affect the previous behavior, when it looks like its addition results in a new reset behavior? I'm trying to make sure this is targeted to the proper release.

@jarvte
Copy link
Contributor Author

jarvte commented Jun 20, 2018

@cmonr this is actually a bug, I read spec again and noticed that default value should be ''0'. If you don't give that do_reset if same as not doing the reset for the modem before applying the new functionality. I will fix default value to '0' in next PR for network tests.

@jarvte
Copy link
Contributor Author

jarvte commented Jun 20, 2018

PR with the fix: #7269

@jarvte jarvte deleted the add_cellular_sim_and_power_tests branch June 20, 2018 06:46
@cmonr
Copy link
Contributor

cmonr commented Jun 20, 2018

@jarvte Wonderful! Since that was my only holdover for making this target a feature release, I'll mark it back for the next patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants