Skip to content

Customer port verification tests for cellular #4446

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 1 commit into from
Jun 29, 2017

Conversation

hasnainvirk
Copy link
Contributor

Description

Basic TCP/UDP tests for PPP based onboard cellular modems.
Tests basic public APIs defined in CellularBase.h
A customer port must pass this test set, hence verifying their
particular implementation.

Status

READY

Migrations

NO

@@ -0,0 +1,541 @@
#include "mbed.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

license please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

License was added @0xc0170 . i don't know why it's not visible in diff

*/

// The credentials of the SIM in the board.
#ifndef MBED_CONF_APP_DEFAULT_PIN
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be put in the header file, too much noise in the test code file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are coming from a json file needed to provide user configuration. If I create a header file that will be then included in every single build. Wouldn't it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The default value does not have to be defined in this C file. I think that's what martin is getting at.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, a header does not get included if you don't #include it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If TESTS/ folder is being skipped at build time then yes we can add a header file. Otherwise, this may cause contentions with user configuration for his/her application.

Copy link
Contributor

Choose a reason for hiding this comment

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

The TESTS/ folder is skipped by mbed compile

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, great to know. I thought only mbedignore was doing that locally,

Copy link
Contributor

Choose a reason for hiding this comment

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

As jimmy noted, my objection was that if the default config is inhte header file, the code file stays clean and only implementation there.. scrolling down through 100x lines of ifdef config values is not user friendly . This header file could come with the test in the same folder (default/main.cpp default/default_config.h)

/**
* Send an entire TCP data buffer until done
*/
static int sendAll(TCPSocket *sock, const char *data, int size)
Copy link
Contributor

Choose a reason for hiding this comment

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

noCamelCase send_all

/**
* Setup Test Environment
*/
utest::v1::status_t test_setup(const size_t number_of_cases) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you fix formatting ( { on the new line, I see 8 spaces on the line 495, etc)

*/
void test_connect_credentials() {

driver->disconnect();
Copy link
Contributor

Choose a reason for hiding this comment

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

tab here (misaligned?)

}

/**
* Verification tests for a successful porting
Copy link
Contributor

Choose a reason for hiding this comment

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

worth having on the top of the file or might be overlooked in here?

@hasnainvirk hasnainvirk force-pushed the add_cellular_unit_tests branch 4 times, most recently from 906f99b to c08fe08 Compare June 5, 2017 18:25
@hasnainvirk
Copy link
Contributor Author

@tommikas This is not passing integration tests because it can't find K64F resources in RAAS. Could you please make sure enough devices are availoable in RAAS ?

Basic TCP/UDP tests for PPP based onboard cellular modems.
Tests basic public APIs defined in CellularBase.h
A customer port must pass this test set, hence verifying their
particular implementation.
@hasnainvirk hasnainvirk force-pushed the add_cellular_unit_tests branch from c08fe08 to 09b07a4 Compare June 7, 2017 12:29
@VeliMattiLahtela
Copy link

Not failing on our Jenkins side.

@TuomoHautamaki
Copy link

@0xc0170 any idea how we could re-trigger tests: Cam-CI uvisor Build & Test? Seems that could be temp CI issue..

@TuomoHautamaki
Copy link

@AlessandroA any idea how we could re-trigger tests: Cam-CI uvisor Build & Test? Seems that could be temp CI issue..

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 8, 2017

retest uvisor

@hasnainvirk
Copy link
Contributor Author

@sg- morph test needed here
@TuomoHautamaki yeah, it was a temporary CI issue. All tests passed.

@sg- sg- added needs: CI and removed needs: work labels Jun 8, 2017
@hasnainvirk
Copy link
Contributor Author

@0xc0170 This will need CI too

@TuomoHautamaki
Copy link

@0xc0170 anything preventing this to be merged?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 20, 2017

@0xc0170 anything preventing this to be merged?

Review after the changes, and CI (will be queued once we get 5.5.1 tested today)

@@ -0,0 +1,69 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the intention with this .txt ? It is just a template for json file, that is not present but required by these tests. I dont see any defaults here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check the docs here https://github.com/ARMmbed/mbed_OS_API_Docs/blob/5.5/docs/APIs/communication/cellular.md#port-verification-testing

You can't have a json file here. Yes, it is template file, whose contents are copied to a json file when it is desirable to run these particular tests. A tutorial is also part of the file, check lines after license.

tr_debug("Sent %d, |%*.*s|", size, size, size, test_data);
tr_debug("Rcvd %d, |%*.*s|", size, size, size, (char * ) recv_data);
// We do not assert a failure here because ublox TCP echo server doesn't send
// back original data. It actually constructs a ublox message string. They need to fix it as
Copy link
Contributor

Choose a reason for hiding this comment

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

ublox ? isnt this generic test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use ublox's echo server for testing. It's a public echo server. However, unfortunately their TCP server doesn't echo back the data we send. It sends a packet of the correct length but with arbitrary data. UDP server works as it should. This was reported to them already.

TEST_ASSERT(driver->is_connected());

TEST_ASSERT(ip_address != NULL);
tr_debug("IP address %s.", ip_address);
Copy link
Contributor

Choose a reason for hiding this comment

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

how does this help if assert is first , then ip address ? If ip adress is null, it would finish on the assert, would never get to print it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, its a connectivity test. If you are connected, you should have an IP address as well.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Can you please share the tests results on some targets?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 22, 2017

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 22, 2017

To summarise, these tests cant be automated at the moment as they require additional details that are in the template ? I am missing this type of information.

Can you share the tests results run on the platform? How to automate these? can we anyhow?

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 615

Build failed!

@TuomoHautamaki
Copy link

There is no automation available out of the box. A set of tests cases and documentation are provided, allowing users to either execute tests manually, or develop a method for automating the verification.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 26, 2017

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 630

Test failed!

@theotherjimmy
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 643

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 28, 2017

retest uvisor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 678

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 29, 2017

retest uvisor

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2017

@hasnainvirk I believe we got one problem with this test, if all tests are run for a target, this reports as UNDEF, and causes CI to report a failure. We should have run nightly for this job, which would result with this error in this case. Please fix asap

20:06:36 	no test case report present, assuming test suite to be a single test case!
20:06:36 	test suite: features-netsocket-cellular-generic_modem_driver-tests-unit_tests-default
20:06:36 	test case: features-netsocket-cellular-generic_modem_driver-tests-unit_tests-default
20:06:36 mbedgt: test on hardware with target id: 0220000025414e450055501147e0001c30f1000097969900
20:06:36 mbedgt: test suite 'features-netsocket-cellular-generic_modem_driver-tests-unit_tests-default' ....... UNDEF in 14.79 sec
20:06:36 	test case: 'features-netsocket-cellular-generic_modem_driver-tests-unit_tests-default' ....... ERROR in 14.79 sec

internal link here for review http://mbed-ci-master-2.austin.arm.com:8081/job/test_matrix/631/target=KL46Z,toolchain=GCC_ARM/consoleFull

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2017

I found what is missing, sending a patch now

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.

8 participants