aboutsummaryrefslogtreecommitdiffstats
path: root/functest/energy/energy.py
AgeCommit message (Collapse)AuthorFilesLines
2018-02-16Get properly env vars or their default valuesCédric Ollivier1-7/+9
It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-12Decrease log level in Energy messagesCédric Ollivier1-13/+17
Energy could be safely disabled if one env var is missing. No error message should be printed in console [1]. It could be enhanced in a second step to print the reasons (missing or incorrect env vars) instead of the full stack. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/766/console Change-Id: I9c405edae16d186f02c632113de1317c89703991 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Unlink Energy from functest utils and constantsCédric Ollivier1-13/+8
It requires an update of releng jobs which have to export ENERGY_RECORDER_API_URL = http://energy.opnfv.fr/resources Change-Id: Iecd5d49b4d4c961c9dc51e43e54df1fcd4027266 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-12Add python3 support in energyCédric Ollivier1-3/+3
It also converts Exception to str when expected. All energy modules are also listed in files rated 10/10 by pylint. Change-Id: Id382d60eb35f50c98b15423f9559a920ce5dac62 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-09-28Fix connection error due to invalid lib version usage.Benoit HERARD1-5/+9
Connection timeouts on "requests" objects was developped with requests 2.18 but target runtime is 2.12. Advanced timeout management of 2.18 is not available in 2.12. Change-Id: Ie6d81b91d4bcc0d73cffd007d9e46cdb19e47597 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-09-27Add log details on SDK first connection.Benoit HERARD1-9/+10
On first call to energy recording API, if API is unreachable, SDK don't do anything anymore. This change add logs on error for this first connection. Change-Id: I88892c769d6208c6ddf5d714d438ab584826844e Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-08-24Merge "Obtain pod_name by CONST instead of get function"Morgan Richomme1-1/+2
2017-08-17Obtain pod_name by CONST instead of get functionLinda Wang1-1/+2
JIRA: FUNCTEST-763 Change-Id: Id334745a1eac8b933d77f9cb36a506a02366d760 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-08-16Use separate timeouts for connection and reading.Benoit HERARD1-5/+6
Use a short timeout for connection timeout to avoid to slow down testcase when remote recording API is not available and use a longer one to read data from API on successfull connections. Change-Id: I743c02f890059bf55b47cb4240d52fe0741f7cae Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-08-09Improved error handling when Energy recorder API is unavailable.Benoit HERARD1-90/+128
Log verbosity is reduced when API is discovered unavailable. Avoid next calls to API if unavailable at config loading. Change-Id: I68d169396335ae3891e4b808062058945fc2eca1 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-07-11Add decorators in testcases for energy recording.Benoit HERARD1-11/+20
Test cases are: - rally (sanity and full) - refstack - cloudify_ims - vping_ssh It also fix a bug on "energy_recording" decorator of energy module. Change-Id: I625c214552ad1b89eaf7e196e706d7c69b37da33 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-07-01Energy monitoring SDK update.Benoit HERARD1-9/+87
add get_current scenario in EnergyRecorder class enable_recording decorator change: If a recording session was existing at startup, restart it at the end, else stop recording Change-Id: I91524824acb60275e0329452b7d7df2346d7884f Signed-off-by: Benoit HERARD <benoit.herard@orange.com>
2017-05-09Add Energy recording supportBenoit HERARD1-0/+203
It adds helpers to send notifications to Energy recording API and related unit tests. It requires a dedicated section in functest config file to set connectivity parameters to Energy recording API. It is using shared API Recording at http://161.105.253.100:8888 Change-Id: Idcb74d1bf7341ccce7cc1c3926f22338ce24f714 Signed-off-by: Benoit HERARD <benoit.herard@orange.com>