-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Customer port verification tests for cellular #4446
Conversation
@@ -0,0 +1,541 @@ | |||
#include "mbed.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license please
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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,
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
906f99b
to
c08fe08
Compare
@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.
c08fe08
to
09b07a4
Compare
Not failing on our Jenkins side. |
@0xc0170 any idea how we could re-trigger tests: Cam-CI uvisor Build & Test? Seems that could be temp CI issue.. |
@AlessandroA any idea how we could re-trigger tests: Cam-CI uvisor Build & Test? Seems that could be temp CI issue.. |
retest uvisor |
@sg- morph test needed here |
@0xc0170 This will need CI too |
@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 @@ | |||
{ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
/morph test |
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? |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
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. |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
retest uvisor /morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
retest uvisor |
@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
internal link here for review http://mbed-ci-master-2.austin.arm.com:8081/job/test_matrix/631/target=KL46Z,toolchain=GCC_ARM/consoleFull |
I found what is missing, sending a patch now |
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