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

Adds an NFC System Test suite #9184

Merged
merged 14 commits into from Feb 11, 2019

Conversation

@ConradBraam
Copy link
Contributor

commented Dec 21, 2018

Description

A icetea test framework based test suite, requires a card reader attached to the host and a target which is NFC capable using one of the supported drivers+shield.
see: readme file /TEST_APPS/testcases/nfc/README.MD includes notes to make test work with customer supplied NFC drivers, and memory limitations. Test suite only supports Type4 tag emulation EEPROM/Controller chips.

Pull request type

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

Reviewers

Release Notes

Adds an automated test suite which provides Standalone and End-2-End validation for either the supported PN512 NFC Controller shield or the M24SR NFC EEPROM. This is an icetea framework based test suite and requires additional hardware.

@0xc0170

This comment has been minimized.

Copy link
Member

commented Dec 21, 2018

Please review Travis astyle job, there are failures.

I assume once reviewers are done, this will be rebased (history needs clean up - some merges can be eliminated as well)

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Dec 21, 2018

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2018

@ConradBraam Looks like the review-bot found an interesting issue with the PR.

This PR has a merge commit from ARMmbed/master in it, which confused the bot. Please remove the commit, and instead rebase your master branch to update this PR.

@cmonr cmonr added needs: work and removed needs: review labels Dec 21, 2018

@cmonr cmonr removed request for ARMmbed/mbed-os-core Dec 21, 2018

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2018

@ConradBraam Taking a closer look at this commit, it looks like multiple merges from ARMmbed/master into this PR branch occurred, which will make the resolution much more difficult.

I would suggest taking a look at interactive rebasing the branch (git rebase -i) for more information.

@geky @kjbracey-arm Y'all konw a bit more git-fu than I do. Any suggestions?

@OPpuolitaival
Copy link
Contributor

left a comment

I will send information in email

TEST_APPS/device/nfcapp/SmartPoster.cpp Outdated
@@ -0,0 +1,284 @@
/* mbed Microcontroller Library

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

smart poster class is only for testing? shouldn't it be available for normal usage?

This comment has been minimized.

Copy link
@pan-

pan- Jan 2, 2019

Member

That would be useful to have a Smart Poster class in the codebase however we should do design review of the example one and see if it can fit the mbed os codebase.

TEST_APPS/device/nfcapp/main.cpp Outdated
using mbed::nfc::ndef::common::span_from_cstr;


//void cmd_ready_cb(int retcode)

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

leftover debug?

TEST_APPS/device/nfcapp/main.cpp Outdated
}

const char *errorcodes = // descriptions from nfc/stack/nfc_errors.h
" 0 NFC_OK \n"

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

does \n without \r work as a newline?

TEST_APPS/device/nfcapp/nfccommands.cpp Outdated
#include "nfcprocess.h"
#include "nfccommands.h"

events::EventQueue nfcQueue;

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

are these meant to be global?
you also mix naming convetions, camel, snake (and hungarian notation?)

This comment has been minimized.

Copy link
@donatieng
TEST_APPS/device/nfcapp/nfccommands.cpp Outdated
#if MBED_CONF_NFCEEPROM
mbed::nfc::NFCEEPROMDriver& eeprom_driver = get_eeprom_driver(nfcQueue);

return ( (NFCTestShim *)(new NFCProcessEEPROM(nfcQueue, eeprom_driver)) );

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

it's OK, you don't need to cast

This comment has been minimized.

Copy link
@donatieng
TEST_APPS/device/nfcapp/nfccommands.cpp Outdated
}

int HandleTestCommand::cmd_read_message(int argc, char *argv[]) {
nfcQueue.call(pNFC_Test_Shim, &NFCTestShim::on_read_nfceeprom);

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

the "on_" prefix is confusing as this isn't an event triggered by reading

This comment has been minimized.

Copy link
@ConradBraam

ConradBraam Dec 31, 2018

Author Contributor

changed this to follow the cmd_ prefix which makes the invoke source clearer and is consistent

TEST_APPS/device/nfcapp/nfccommands.cpp Outdated
return(CMDLINE_RETCODE_INVALID_PARAMETERS);
} else {
// parse arg and queue it up
char * uri = (char*)malloc(MAX_URL_LENGTH+1);

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

you can malloc and copy the correct length

This comment has been minimized.

Copy link
@ConradBraam

ConradBraam Dec 31, 2018

Author Contributor

Good spot, cleaner to copy just the string.

TEST_APPS/device/nfcapp/nfccommands.cpp Outdated

// todo: jira IOTPAN-295
int HandleTestCommand::cmd_erase(int argc, char *argv[]){
nfcQueue.call(pNFC_Test_Shim, &NFCTestShim::on_erase);

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm Dec 28, 2018

Member

same problem with on_ prefix (unless I misunderstood the flow?)

This comment has been minimized.

Copy link
@ConradBraam

ConradBraam Dec 31, 2018

Author Contributor

cmd_ prefixed now

@ConradBraam ConradBraam force-pushed the ConradBraam:master branch to 4965d3c Feb 6, 2019

@pan-

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

@cmonr Git magic applied.
@paul-szczepanek-arm any thing left ?

@ConradBraam

This comment has been minimized.

Copy link
Contributor Author

commented Feb 6, 2019

@0xc0170 Anything still left to cover?

@0xc0170 0xc0170 dismissed their stale review Feb 7, 2019

will rereview shortly

Show resolved Hide resolved .gitignore Outdated
Show resolved Hide resolved TEST_APPS/device/nfcapp/NFCCommands.cpp Outdated
@0xc0170

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

This test addition deserves release notes addition ! please add it to the first comment above (following ARMmbed/mbed-os-5-docs#933)

@adbridge adbridge added needs: CI and removed needs: work labels Feb 8, 2019

@NirSonnenschein

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2019

starting CI

@mbed-ci

This comment has been minimized.

Copy link

commented Feb 10, 2019

Test run: SUCCESS

Summary: 9 of 9 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 requested a review from AnotherButler Feb 11, 2019

LGTM

@0xc0170

This comment has been minimized.

Copy link
Member

commented Feb 11, 2019

@AnotherButler Can you please review Readme addition here?

Waiting for the last review from docs, and this will be ready for integration

@0xc0170 0xc0170 merged commit 830c3ec into ARMmbed:master Feb 11, 2019

24 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 9199 cycles
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.