Skip to content
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

Fix cellular dns test with IAR compiled binary #11220

Merged
merged 3 commits into from Aug 22, 2019

Conversation

jarvte
Copy link
Contributor

@jarvte jarvte commented Aug 14, 2019

Description

Binary compiled with IAR crashes when trying to print null string. Fixed to print 'null' when the dns test is trying to print an empty ip address.
Fixed also that there should not be an empty ip address after connect. After fix, still some modems don't give an ip address even they have it. This can't be fixed but network communication works properly.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@kivaisan @kimlep01

Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
@ciarmcom
Copy link
Member

@jarvte, thank you for your changes.
@kimlep01 @kivaisan @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-test @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

// no IPV4 address, return
return NULL;
}
len = _at.read_string(_ip, NSAPI_IPv4_SIZE);

Choose a reason for hiding this comment

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

PDP_IPV6_SIZE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, fixed

// in case stack type is not IPV4 only, try to look also for IPV6 address
if (_stack_type != IPV4_STACK) {
if (len != -1 && _stack_type != IPV4_STACK) {
// in case stack type is not IPV4 only, try to look also for IPV6 address
(void)_at.read_string(_ip, PDP_IPV6_SIZE);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, can't do that as this is an optional value

CellularContext now tries to get an IP address after connect and before
sending NSAPI_STATUS_GLOBAL_UP. Even if we don't the IP address from
the modem we will send NSAPI_STATUS_GLOBAL_UP and return success.
Modem has an ip address but for some reason some modems don't
give it to us.
// in case stack type is not IPV4 only, try to look also for IPV6 address
if (_stack_type != IPV4_STACK) {
if (len != -1 && _stack_type != IPV4_STACK) {
// in case stack type is not IPV4 only, try to look also for IPV6 address
(void)_at.read_string(_ip, PDP_IPV6_SIZE);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, can't do that as this is an optional value

Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-test

@adbridge
Copy link
Contributor

restarted

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 5c09ff1 into ARMmbed:master Aug 22, 2019
@adbridge
Copy link
Contributor

Sitting on top of 5.14 changes so targeting for 5.14 now instead

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.

None yet

9 participants