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

Porting tests to new utest-greentea framework #62

Merged
merged 6 commits into from
Feb 26, 2016

Conversation

mazimkhan
Copy link

Following tests are ported to new utest-greentea framework. Also necessary changes have be done in the test code for tests to work and for clean tear down.

sockets-test-echo-tcp-client
sockets-test-echo-udp-client

For details on new utest - greentea framework please see description in PR ARMmbed/greentea#78

@mazimkhan
Copy link
Author

@bremoran @niklas-arm @PrzemekWirkus @0xc0170 @stegut01
Please review this PR. It is port for new utest-greentea framework. There might be some understanding gaps on socket and utest API. Guidance and documentation would be much appreciated.

@@ -41,6 +36,7 @@ void terminate(bool status, TCPEchoClient* client);

char out_buffer[] = "Hello World\n";
char buffer[256];
char out_success[] = "{{success}}\n{{end}}\n";

Choose a reason for hiding this comment

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

This string is confusing, is this just a payload used for test or actual control command?

Copy link
Author

Choose a reason for hiding this comment

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

Moved it outside from onRx() in original code to sit with other strings. It indicates to the host test that target test has validated a round trip (echo) data and now terminating. It is good stop to host test from echoing back as target client closes the connection right after sending this string.
But it should not be confused with serial k,v command.

@mazimkhan
Copy link
Author

CI build failing for error

error: mbed-drivers does not meet specification ~0.12.0 required by core-util

@niklarm
Copy link

niklarm commented Feb 23, 2016

I might be mistaken, but isn't TCP and UDP client already part of socket-test?
They are implemented from scratch, but they test the same thing

I did take the tests in this repo as a basis for the new tests, but with utest expressing the statefulness of these tests can be achieved much better without classes.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 24, 2016

@niklas-arm Yes, I asked Przemek the same question. I was told that all these public tests which are part of our modules will be updated to use the new greentea client, deprecate to use test_env. Plus, those tests you references, are not public yet. Przemek might add more details.

@mazimkhan
Copy link
Author

@niklas-arm if tests were moved to socket-test then as part of the move they should have been deleted from this repo. So that nobody wastes time in fixing or running them. Please remove these tests from this repo if not needed here now.

Anyway other purpose of updating these tests is to gain understanding of utest. You can atleast review from the perspective of utest usage.

@niklarm
Copy link

niklarm commented Feb 24, 2016

@niklas-arm if tests were moved to socket-test then as part of the move they should have been deleted from this repo. So that nobody wastes time in fixing or running them. Please remove these tests from this repo if not needed here now.

The tests weren't "moved", we just didn't make the new ones public, and we didn't update these.
Let's not remove these rewritten tests now, since they are slightly different from the HTTP request and Time Protocol test, which do not use local servers.
So let's keep these tests, especially as an example for how to use new host test mechanism (which look great btw!).

Anyway other purpose of updating these tests is to gain understanding of utest. You can atleast review from the perspective of utest usage.

I would have liked to have a more granular test cases, instead of one big class, similar to how socket-tests work, but if it works this way, it's fine too.

@mazimkhan
Copy link
Author

Good to know that the effort isn't wasted. We can surely have granular tests in socket-test/test.
@bremoran if you are happy with the change can you please merge it.

@@ -21,7 +21,9 @@
"minar": "^1.0.0"
},
"testDependencies": {
"mbed-drivers": "~0.11.1"
"mbed-drivers": "~0.11.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

This dependency is a little old.

@bremoran
Copy link
Contributor

A couple of minor comments. updating the dependency to mbed-drivers ~0.12.0 will fix the CI build error.

@mazimkhan
Copy link
Author

@bremoran review comments incorporated.

bremoran added a commit that referenced this pull request Feb 26, 2016
Porting tests to new utest-greentea framework
@bremoran bremoran merged commit 8effb7e into ARMmbed:devel_transport Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants