发起问题

Karz 的档案 - activity

2020-03-16 04:33:46 -0500 问了问题 How to store the output of Yardstick command in Python variable?

I have written the below script to store the output of yardstick command into a variable(output) and display the value of variable.

The script is executing fine and the results are displayed in the console. After executing the script, I want to store the below details into a variable.But the below log details are not stored into output variable. Please help me to solve this issue?

Note: I am able to get the output of unix command into the output variable. Who, ls -ltr etc., Operating system: Ubuntu Programming language: Python Yardstick command to execute the opnfv test case. Code:

> from time import sleep import sys
> import os import subprocess import
> pexpect import time
> script_exec_cmd="yardstick -d task
> start
> /home/test_cases/opnfv_yardstick_tc002.yaml"
> output =
> subprocess.check_output(script_exec_cmd,
> shell=True) sleep(100) print
> '********************************'
> print "output === >>" + output print
> '****************************'

Information from console is mentioned below

2020-03-16 12:22:11,895 [DEBUG] yardstick.benchmark.runners.duration duration.py:124 queue.qsize() = 1

2020-03-16 12:22:11,895 [DEBUG] yardstick.benchmark.runners.duration duration.py:125 output_queue.qsize() = 0

2020-03-16 12:22:11,919 [DEBUG] yardstick.benchmark.runners.base base.py:282 result_queue size 1

2020-03-16 12:22:11,919 [INFO] yardstick.benchmark.core.task task.py:285 Runner ended

2020-03-16 12:22:11,920 [INFO] yardstick.benchmark.core.task task.py:129 Testcase: "opnfv_yardstick_tc002" SUCCESS!!!

2020-03-16 12:22:11,920 [INFO] yardstick.benchmark.contexts.heat heat.py:472 Undeploying context 'demo-b1a42587' START

2020-03-16 12:22:53,560 [INFO] yardstick.benchmark.contexts.heat heat.py:475 Undeploying context 'demo-b1a42587' DONE

2020-03-16 12:22:53,560 [INFO] yardstick.benchmark.core.task task.py:148 Task /home/ test_cases/opnfv_yardstick_tc002.yaml finished in 242 secs

2020-03-16 12:22:53,565 [INFO] yardstick.benchmark.core.task task.py:169 Report can be found in '/tmp/report.html'

2020-03-16 12:22:53,566 [INFO] yardstick.benchmark.core.task task.py:157 Total finished in 242 secs

2020-03-16 12:22:53,566 [INFO] yardstick.benchmark.core.task task.py:160 To generate report, execute command "yardstick report generate b1a42587-2285-4bb4-9805-e1e6bcebcc11 <yaml_name>"

2020-03-16 12:22:53,566 [INFO] yardstick.benchmark.core.task task.py:161 Task ALL DONE, exiting

2020-03-16 12:22:53,566 [INFO] yardstick.cmd.commands.task task.py:61 Task SUCCESS

2020-03-16 12:22:53,567 [DEBUG] yardstick.benchmark.runners.base base.py:147 Terminating all runners

********** output === >> Writing /home/yardstick/resources/files/yardstick_key-demo-b1a42587 ...


2019-12-16 01:11:27 -0500 获得奖牌  热门的问题 (source)
2019-12-15 05:54:43 -0500 获得奖牌  受欢迎的问题 (source)
2019-12-10 15:57:11 -0500 问了问题 influx db issue

Hi All, Whenever we execute the yardstick test case via the below command, we get an error in influx DB, but the test case is executing successfully. Please let me know if this connection issue can be resolved?

Yardstick command: yardstick -d task start opnfv_yardstick_testcase01.YAML

Message: 2019-12-09 18:09:49,530 [ERROR] yardstick.dispatcher.influxdb influxdb.py:80 Failed to record result data: HTTPConnectionPool(host='127.X.X.1', port=8086): Max retries exceeded with url: /write?db=yardstick (Caused by NewConnectionError('<requests.packages.urllib3.connection.httpconnection object="" at="" 0x7f1ffd2f8cd0="">: Failed to establish a new connection: [Errno 111] Connection refused',))

Traceback (most recent call last): File "/home/opnfv/repos/yardstick/yardstick/dispatcher/influxdb.py", line 78, in upload_one_record timeout=self.timeout) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 112, in post return request('post', url, data=data, json=json, *kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, *kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 518, in request resp = self.send(prep, *send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 639, in send r = adapter.send(request, *kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 502, in send raise ConnectionError(e, request=request)

ConnectionError: HTTPConnectionPool(host='127.X.X.1', port=8086): Max retries exceeded with url: /write?db=yardstick (Caused by NewConnectionError('<requests.packages.urllib3.connection.httpconnection object="" at="" 0x7f1ffd2f8cd0="">: Failed to establish a new connection: [Errno 111] Connection refused',))

2019-12-09 18:09:59,851 [DEBUG] yardstick.benchmark.runners.duration duration.py:105 runner=5947 seq=5 END 2019-12-09 18:09:59,852 [INFO] yardstick.benchmark.runners.duration duration.py:111 Worker END 2019-12-09 18:09:59,852 [DEBUG] yardstick.benchmark.runners.duration duration.py:124 queue.qsize() = 1 2019-12-09 18:09:59,853 [DEBUG] yardstick.benchmark.runners.duration duration.py:125 output_queue.qsize() = 0 2019-12-09 18:09:59,896 [DEBUG] yardstick.benchmark.runners.base base.py:282 result_queue size 1 2019-12-09 18:09:59,897 [DEBUG] yardstick.dispatcher.influxdb influxdb.py:72 Test result line format : opnfv_yardstick_tc002,deploy_scenario=unknown,installer=unknown,pod_name=unknown,task_id=74898d7e-adad-4ea5-a991-e5feba921b18,version=unknown rtt.ares=0.519 1575914999851600896 ...

2019-12-09 18:09:59,898 [ERROR] yardstick.dispatcher.influxdb influxdb.py:80 Failed to record result data: HTTPConnectionPool(host='127.X.X.1', port=8086): Max retries exceeded with url: /write?db=yardstick (Caused by NewConnectionError('<requests.packages.urllib3.connection.httpconnection object="" at="" 0x7f1ffd2f8d10="">: Failed to establish a new connection: [Errno 111] Connection refused',)) ..

ConnectionError: HTTPConnectionPool(host='127.X.X.1', port=8086): Max retries exceeded with url: /write?db=yardstick (Caused by NewConnectionError('<requests.packages.urllib3.connection.httpconnection object="" at="" 0x7f1ffd2f8d10="">: Failed to establish a new connection: [Errno 111] Connection refused',))

2019-12-09 18:09:59,899 [INFO] yardstick.benchmark.core.task task.py:285 Runner ended .. 2019-12-09 18:10:41,784 [INFO] yardstick.benchmark.core.task task.py:148 Task /home/opnfv/repos/yardstick ... (more)

2019-12-10 15:57:11 -0500 问了问题 Failed to create stack

I Installed openstack in ubutu and created a VM and installed storperf. After the configuration, when we try to execute the opnfv_yardstick_tc074, we get the below error message. I searched in google but not getting the exact reason to solve the issue.

Yardstick command : yardstick -d task start opnfv_yardstick_tc074.yaml

[ERROR] yardstick.benchmark.scenarios.storage.storperf storperf.py:108 Failed to create stack. 400: { "message": "Auth plugin requires parameters which were not given: auth_url"

Detailed log info:

root@180179bdd061:/home/opnfv/repos/yardstick/tests/opnfv/test_cases# yardstick -d task start opnfv_yardstick_tc074.yaml
No handlers could be found for logger "yardstick.common.utils"
/usr/local/lib/python2.7/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.restful is deprecated, use flask_restful instead.
  .format(x=modname), ExtDeprecationWarning
2019-12-10 17:38:17,827 [INFO] yardstick.cmd.commands.task task.py:52 Task START
2019-12-10 17:38:17,827 [DEBUG] yardstick.benchmark.core.task task.py:77 Output configuration is: {'DEFAULT': {'debug': '..
..
2019-12-10 17:38:17,828 [INFO] yardstick.benchmark.core.task task.py:547 Parsing task config: opnfv_yardstick_tc074.yaml
2019-12-10 17:38:17,846 [DEBUG] yardstick.benchmark.core.task task.py:536 Input task is:

---
schema: "yardstick:task:0.1"
description: >
    Test case for TC074 StorPerf benchmark task config file;
    StorPerf is a tool to measure block and object storage performance in an NFVI.
scenarios:

  type: StorPerf
  options:
    auth_url: http://10.106.XX.XX:5000/v3
    agent_count: 1
    agent_image: "Ubuntu-16.04"
    agent_flavor: "storperf"
    public_network: provider
    volume_size: 4
    block_sizes: 4096
    queue_depths: 4
    StorPerf_ip: 192.XXX.XX.XX
    query_interval: 10
    timeout: 300
    workload:
    workloads:
    steady_state_samples: 10
    volume_count: 1
    volume_type:
    availability_zone: nova
    subnet_CIDR: 172.XX.X.X/XX
    stack_name: StorperfAgentGroup
  runner:
    type: Iteration
    iterations: 1
context:
  type: Dummy
  name: Dummy
2019-12-10 17:38:17,851 [DEBUG] yardstick.benchmark.core.task task.py:378 Got a KeyError in config_context_target({})
2019-12-10 17:38:17,851 [DEBUG] yardstick.benchmark.core.task task.py:378 Got a KeyError in 
config_context_target({'task_id': '0fe9c2a3-7722-4701-bef6-613f275c3c33', u'runner': {u'type': u'Iteration', 'output_config': {'DEFAULT': {'debug': 'False', 'dispatcher': ['influxdb']}, 'nsb': {'trex_client_lib': '/opt/nsb_bin/trex_client/stl', 'bin_path': '/opt/nsb_bin', 'trex_path': '/opt/nsb_bin/trex/scripts', 'jre_path_i386': '/usr/lib/jvm/java-8-openjdk-i386/jre', 'debug': 'False', 'dispatcher': 'influxdb'}, 'dispatcher_influxdb': {}, 'dispatcher_http': {'debug': 'False', 'dispatcher': 'influxdb', 'timeout': '5', 'target': 'http://127.0.0.1:8000/results'}, 'dispatcher_file': {'debug': 'False', 'backup_count': '0', 'max_bytes': '0', 'dispatcher': 'influxdb', 'file_path': '/tmp/yardstick.out'}}, u'iterations': 1}, 'tc': 'opnfv_yardstick_tc074', u'type': u'StorPerf', u'options': {u'subnet_CIDR': u'172.16 XX.XX /16', u'volume_count': 1, u'agent_flavor': u'storperf', u'availability_zone': u'nova', u'stack_name': u'StorperfAgentGroup', u'block_sizes': 4096, u'steady_state_samples': 10, u'timeout': 300, u'volume_type': None, u'agent_count': 1, u'volume_size': 4, u'StorPerf_ip': u'192.168.0.57', u'workload': None, u'auth_url': u'http://10.106.XX.XX:5000/v3', u'public_network': u'provider', u'queue_depths': 4, u'workloads': None, u'query_interval': 10, u'agent_image': u'Ubuntu-16.04'}, 'task_path': ''})
2019-12-10 17:38:17,853 [INFO] yardstick.benchmark.core.task task.py:405 Starting runner of type 'Iteration'
2019-12-10 17:38 ...
(more)
2019-12-07 02:32:07 -0500 获得奖牌  受欢迎的问题 (source)
2019-12-01 03:23:06 -0500 评论问题 How to test StorPerf in Devstack?

Thanks for your response.

2019-11-30 15:13:05 -0500 问了问题 How to test StorPerf in Devstack?

I have installed a Devstack in the ubuntu 18.04 rocky version. Ref: https://docs.openstack.org/devstack/latest/ (https://docs.openstack.org/devstack/l...)

When I want to test Storperf(Storage Performance) manually and see the result. what are all the step by step procedure that I have to follow?

I have gone through the below link but not sure how to configure and test Storperf. https://wiki.opnfv.org/display/storperf/Storperf (https://wiki.opnfv.org/display/storpe...)