Skip to content

Skip Bare Metal green tea test for PSA component #11821

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 2 commits into from
Nov 12, 2019

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Nov 6, 2019

Description (required)

PSA test framework requires RTOS to run so added MBED_CONF_RTOS_PRESENT to all the test cases.

Summary of change (What the change is for and why)
  1. PSA components get added to green tea test build based on targets.json.
  2. PSA test framework uses RTOS threads and test cases run on this created threads.
  3. Added MBED_CONF_RTOS_PRESENT guard to all PSA test cases to skip in the green tea test framework
  • Note: These changes are done as identified that PSA component uses RTOS API and not a very detailed analysis of the component.
  1. Tested the green tea test on below list of targets with bare metal config and added the logs in
    IOTCORE-1397[https://jira.arm.com/browse/IOTCORE-1397] Jira ticket
  • K64F
  • K66F
  • Nucleo F429ZI
  • Nucleo F411RE
  • Nucleo L073RZ
  • Nucleo F207ZG
  1. A main green tea test framework and mbed-os test cases change for bare metal is available in PR Bare metal greentea support #11721
Documentation (Details of any document updates required)

Pull request type (required)

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results (required)

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers (optional)

@Patater @jamesbeyond @evedon @hugueskamba


Release Notes (required for feature/major PRs)

Summary of changes
Impact of changes
Migration actions required

-PSA test framework uses the RTOS threads to run test cases so added MBED_CONF_RTOS_PRESENT to all the test cases.
@ciarmcom
Copy link
Member

ciarmcom commented Nov 6, 2019

@rajkan01, thank you for your changes.
@Patater @evedon @jamesbeyond @hugueskamba @ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-test @ARMmbed/mbed-os-tls please review.

@rajkan01 rajkan01 changed the title Enable the Bare Metal green tea test Skip Bare Metal green tea test for PSA component Nov 6, 2019
@Patater Patater requested a review from jainvikas8 November 6, 2019 15:37
MBED_ASSERT((type > COMPLIANCE_TEST_START) && (type < COMPLIANCE_TEST_END));
Thread thread(osPriorityNormal, TEST_STACK_SIZE, NULL);
thread.start(main_wrapper);
thread.join();
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need these ifdefs? Will this function run when there is no RTOS? What do we want this function to do if there is no RTOS?

If this function will run, and we want it to be more than a no-op, perhaps we should call main_wrapper() here.

Copy link
Contributor Author

@rajkan01 rajkan01 Nov 6, 2019

Choose a reason for hiding this comment

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

@Patater When we do "mbed test -m NUCLEO_F411RE -t GCC_ARM --app-config TESTS/configs/baremetal.json" then build tools build mbed-os and green tea test with bare-metal configuration and No RTOS.

pal_mbed_os_intf.cpp uses RTOS API which leads to undefined threads APIs and builds fails.so I added the ifdefs to make the build pass.

This is the first level changes to make green tea test to run in bare metal once this PR gets merged then please do necessary changes on PSA to make it work for bare-metal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is pal_mbed_os_intf.cpp included in the build at all? Is it needed for anything in baremetal?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am happy with this approach (no-op in test_start()) so long as greentea sees the PSA tests are skipped, not that they passed (because pass is meaningless if the tests did nothing).

Copy link
Contributor

Choose a reason for hiding this comment

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

You could have returned a non-zero value but it is not checked anywhere...

MBED_ASSERT((type > COMPLIANCE_TEST_START) && (type < COMPLIANCE_TEST_END));
Thread thread(osPriorityNormal, TEST_STACK_SIZE, NULL);
thread.start(main_wrapper);
thread.join();
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

I am happy with this approach (no-op in test_start()) so long as greentea sees the PSA tests are skipped, not that they passed (because pass is meaningless if the tests did nothing).

@Patater
Copy link
Contributor

Patater commented Nov 6, 2019

Please make sure this doesn't break testing on NXP LPC55S69 or Cypress PSoC 6 target. Thanks.

#ifndef TARGET_PSA
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets.
#if !defined(TARGET_PSA) || !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets and RTOS.
Copy link
Contributor

Choose a reason for hiding this comment

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

PSA-targets with RTOS present.

Copy link
Contributor Author

@rajkan01 rajkan01 Nov 8, 2019

Choose a reason for hiding this comment

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

Yes PSA test cases use threads to run the test case and in bare-metal we don't have any thread support so i guarded with MBED_CONF_RTOS_PRESENT

@@ -238,4 +238,4 @@ int main()
return !Harness::run(specification);
}

#endif // TARGET_PSA
#endif // TARGET_PSA || !defined(MBED_CONF_RTOS_PRESENT)
Copy link
Contributor

Choose a reason for hiding this comment

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

!defined (TARGET_PSA)

@@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p001, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment update, please. - // !defined(MBED_CONF_RTOS_PRESENT)

@@ -16,3 +19,4 @@ int main(void)
test_start(test_entry_p002, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p005, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment update please to all files - // !defined(MBED_CONF_RTOS_PRESENT)

@jainvikas8
Copy link
Contributor

jainvikas8 commented Nov 7, 2019

Hi @rajkan01,
So with your changes, I happen to test the LPC55S69 target.
I see PSA compliance test passing with the following commands with sets to default profile.
mbed test --compile -m LPC55S69_NS -n *compliance* -t ARMC6 --run
But if the bare-metal profile is used then I do see them passing rather than skipping, Is this a known behavior?
mbed test -m LPC55S69_NS -t ARMC6 --app-config TESTS/configs/baremetal.json -n *compliance* --run

Please, could you share the mbed test command lines to test this target. Thanks.
Thanks.

@evedon
Copy link
Contributor

evedon commented Nov 8, 2019

Hi @rajkan01,
So with your changes, I happen to test the LPC55S69 target.
I see PSA compliance test passing with the following commands with sets to default profile.
mbed test --compile -m LPC55S69_NS -n *compliance* -t ARMC6 --run
But if the bare-metal profile is used then I do see them passing rather than skipping, Is this a known behavior?
mbed test -m LPC55S69_NS -t ARMC6 --app-config TESTS/configs/baremetal.json -n *compliance* --run

Please, could you share the mbed test command lines to test this target. Thanks.
Thanks.

The expected behaviour is that the tests should be skipped. @rajkan01 please look into it

@evedon
Copy link
Contributor

evedon commented Nov 8, 2019

Hi @rajkan01,
So with your changes, I happen to test the LPC55S69 target.
I see PSA compliance test passing with the following commands with sets to default profile.
mbed test --compile -m LPC55S69_NS -n *compliance* -t ARMC6 --run
But if the bare-metal profile is used then I do see them passing rather than skipping, Is this a known behavior?
mbed test -m LPC55S69_NS -t ARMC6 --app-config TESTS/configs/baremetal.json -n *compliance* --run
Please, could you share the mbed test command lines to test this target. Thanks.
Thanks.

The expected behaviour is that the tests should be skipped. @rajkan01 please look into it

@jainvikas8 This PR disables bare metal tests for PSA component but bare metal support in greentea is added in #11721. So if you want to run bare metal tests on LPC55S69 you need both PRs.
Furthermore, I am not sure how you ran the bare metal tests on LPC55S69. @rajkan01 tried to compile the tests for this target and the compilation fails.
We have manually tested this PR on 6 golden boards and have agreed with @jamesbeyond that the rest of the golden boards will be tested in nightly CI and any issue will be handled as defect.

@jainvikas8
Copy link
Contributor

@evedon @rajkan01
I ran those tests following the steps below on the changes of this PR:
Step 1: Delete everything in BUILD directory
Step 2: mbed test --compile -m LPC55S69_NS -n *compliance* -t ARMC6 --run
Step 3: mbed test -m LPC55S69_NS -t ARMC6 --app-config TESTS/configs/baremetal.json -n *compliance* --run

If the above steps are correct:

  • Realized that I didn't build those tests on step 3 (missing --compile option), of course, it fails if I use that.
  • Probably step 3 using already compiled tests from step 2?

Run output attached
step2.txt
step3.txt

@jamesbeyond
Copy link
Contributor

@evedon @rajkan01
I ran those tests following the steps below on the changes of this PR:
Step 1: Delete everything in BUILD directory
Step 2: mbed test --compile -m LPC55S69_NS -n *compliance* -t ARMC6 --run
Step 3: mbed test -m LPC55S69_NS -t ARMC6 --app-config TESTS/configs/baremetal.json -n *compliance* --run

If the above steps are correct:

  • Realized that I didn't build those tests on step 3 (missing --compile option), of course, it fails if I use that.
  • Probably step 3 using already compiled tests from step 2?

Run output attached
step2.txt
step3.txt

you need to remove --run but add -c to give a clean build

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

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

look good

@rajkan01
Copy link
Contributor Author

rajkan01 commented Nov 11, 2019

@adbridge @0xc0170 Please start the CI

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 11, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 11, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 11, 2019

Might be internet internal issue, restarted tests

@0xc0170 0xc0170 merged commit d556bf6 into ARMmbed:master Nov 12, 2019
@0xc0170 0xc0170 removed the needs: CI label Nov 12, 2019
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.

9 participants