mkumatag / openbmc-automation

Test OpenBMC Distribution, moved to - https://github.com/openbmc/openbmc-test-automation
Apache License 2.0
5 stars 11 forks source link

PreTag test_power_restore.robot': Non-existing setting '[Documentation]'. #57

Closed gkeishin closed 8 years ago

gkeishin commented 8 years ago

[ ERROR ] Error in file '/home/rango/FTC_OPENBMC_TEST/openbmc-automation/tests/test_power_restore.robot': Non-existing setting '[Documentation]'. [ ERROR ] Suite 'Test Power Restore' contains no tests without tag 'reboot tests'.

  1. There is a extra Documentation in the setting .
  2. Since the tox.in uses that tag to look into the test suite, the template here having this tag failed during lookup.. [Tags] reboot_tests

So the solution we could do is to add the tags in the keywords....

$ git whatchanged tests/test_power_restore.robot commit 2ce8f5346c09bed830a70415ea91687d2bc6e75d Author: Ratan Gupta ratagupt@in.ibm.com Date: Thu Mar 3 15:43:45 2016 +0530

Test automation for power restoration policy

Few more changes in test cases

Changes made as per the new interfaces

:000000 100644 0000000... d0e27d5... A tests/test_power_restore.robot

commit 2ce8f5346c09bed830a70415ea91687d2bc6e75d Author: Ratan Gupta ratagupt@in.ibm.com Date: Thu Mar 3 15:43:45 2016 +0530

Test automation for power restoration policy

Few more changes in test cases

Changes made as per the new interfaces

:000000 100644 0000000... d0e27d5... A tests/test_power_restore.robot

................................................... * Settings * Documentation This suite will verifiy the power restore policy rest Interfaces ... Details of valid interfaces can be found here... ... https://github.com/openbmc/docs/blob/master/rest-api.md

Resource ../lib/rest_client.robot Resource ../lib/pdu/pdu.robot Resource ../lib/utils.robot

Library SSHLibrary

[Documentation] Data Driven Tests <----- This needs to be removed

_test cases_

Set the power restore policy Policy ExpectedSystemState NextSystemState

                               LEAVE_OFF              HOST_POWERED_OFF          HOST_POWERED_OFF
                               LEAVE_OFF              HOST_POWERED_ON           HOST_POWERED_OFF
                               ALWAYS_POWER_ON        HOST_POWERED_OFF          HOST_POWERED_ON
                               ALWAYS_POWER_ON        HOST_POWERED_ON           HOST_POWERED_ON
                               RESTORE_LAST_STATE     HOST_POWERED_ON           HOST_POWERED_ON
                               RESTORE_LAST_STATE     HOST_POWERED_OFF          HOST_POWERED_OFF

[Documentation]   This test case sets the pilicy as given under the policy attribute.
...               ExpectedSystemState:-is the state where system should be before running the test case
...               NextSystemState:-is After Power cycle system should reach to this state
...               if the system is not at the Expected System State,This test case brings the system
...               in the Expected state then do the power cycle.

[Template]    setRestorePolicy
[Tags]        reboot_tests                             <------------  Applies to all test case but --exclude would make it to scan this suite tag and left with no test to run.. which will throw error but I see even this code is executed in spite of exclude in the log

_keywords_

mkumatag commented 8 years ago

@ratagupt , @rahulmah can you please have a look?

gkeishin commented 8 years ago

More info on this... From tox.ini the code is run with

python -m robot.run --exclude reboot_tests tests

So basically the robot.run is asked to exclude the test cases which have a tags "reboot_tests".. Once it parses the suite.. It finds no test cases without this tag and that would throw error..

ratagupt commented 8 years ago

Hi george,

This is expected..As the reboot tests takes long to execute so we excluded those tests in normal run. If you want to execute then you can create one more section in tox.ini to tell run all the test cases.

You can remove the exclude option and run all the tests or you can include the tests with the --include option..

gkeishin commented 8 years ago

Closing this here... due to migration of repo to new.. https://github.com/openbmc/openbmc-test-automation/issues/8