diff options
-rw-r--r-- | dashboard/Yardstick-TC072-1469780190435 | 1378 | ||||
-rw-r--r-- | docs/userguide/opnfv_yardstick_tc051.rst | 117 | ||||
-rw-r--r-- | docs/userguide/opnfv_yardstick_tc073.rst | 81 | ||||
-rw-r--r-- | samples/storperf.yaml | 31 | ||||
-rwxr-xr-x | tests/ci/prepare_env.sh | 25 | ||||
-rw-r--r-- | tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml | 90 | ||||
-rwxr-xr-x | tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml | 37 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/storage/test_storperf.py | 214 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/storage/storperf.py | 208 | ||||
-rw-r--r-- | yardstick/resources/scripts/install/storperf.bash (renamed from yardstick/resources/script/install/storperf.bash) | 0 | ||||
-rw-r--r-- | yardstick/resources/scripts/remove/storperf.bash (renamed from yardstick/resources/script/remove/storperf.bash) | 0 |
11 files changed, 2181 insertions, 0 deletions
diff --git a/dashboard/Yardstick-TC072-1469780190435 b/dashboard/Yardstick-TC072-1469780190435 new file mode 100644 index 000000000..7fc2d9342 --- /dev/null +++ b/dashboard/Yardstick-TC072-1469780190435 @@ -0,0 +1,1378 @@ +{ + "id": 34, + "title": "Yardstick-TC072", + "originalTitle": "Yardstick-TC072", + "tags": [ + "yardstick-tc" + ], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [ + { + "collapse": false, + "editable": true, + "height": "25px", + "panels": [ + { + "content": "<h5 style=\"font-family:Verdana\"> <a style=\"color:#31A7D3\"><center>OPNFV_Yardstick_TC072 - Network Latency, Throughput, Packet Loss and Network Utilization</center> </a></h5>\n<center>\n<p>Visualisation of network latency (RTT - round trip time), packet throughput and Network interface utilization when doing variations to the amount of UDP flows between two VM instances running on different physical blades.\nFor more information see <a style=\"color:#31A7D3\"; href=\"http://artifacts.opnfv.org/yardstick/brahmaputra/docs/userguide/opnfv_yardstick_tc072.html\">TC072</a></p>\n</center>", + "editable": true, + "error": false, + "height": "", + "id": 10, + "isNew": true, + "links": [], + "mode": "html", + "span": 12, + "style": {}, + "title": "", + "type": "text" + } + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 8, + "isNew": true, + "leftYAxisLabel": "Packet throughput", + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT mean(\"packets_per_second\") FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"pod_name\", \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "packets_per_second" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "14d", + "timeShift": null, + "title": "Throughput mean trend", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "pps", + "pps" + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": 0, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 9, + "isNew": true, + "leftYAxisLabel": "RTT", + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc071", + "query": "SELECT mean(\"rtt.poseidon\") FROM \"opnfv_yardstick_tc071\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"pod_name\", \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rtt.poseidon" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "14d", + "timeShift": null, + "title": "RTT mean trend", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "ms", + "ms" + ] + } + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)", + "thresholdLine": false + }, + "height": "", + "id": 2, + "isNew": true, + "leftYAxisLabel": "No. flows", + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "rightYAxisLabel": "Packet throughput", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario - flows", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT \"flows\" FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\", \"pod_name\", \"task_id\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "flows" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + }, + { + "alias": "$tag_pod_name - $tag_deploy_scenario - pps", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT \"packets_per_second\" FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\", \"pod_name\", \"task_id\"", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "packets_per_second" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "No. flows & packet throughput - pktgen", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "pps" + ] + } + ], + "showTitle": false, + "title": "Mpstat/cpuload graph" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 7, + "isNew": true, + "leftYAxisLabel": "Packet throughput", + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "scenarios" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT \"packets_per_second\" FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"scenarios\", \"task_id\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "packets_per_second" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Packet throughput - pktgen", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "pps", + "short" + ] + } + ], + "title": "Pktgen table" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "decimals": 0, + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "isNew": true, + "leftYAxisLabel": "RTT", + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "rightYAxisLabel": "", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc071", + "query": "SELECT \"rtt.poseidon\" FROM \"opnfv_yardstick_tc071\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\", \"task_id\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rtt.poseidon" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "14d", + "timeShift": null, + "title": "Round-trip time - ping", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "transparent": false, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "ms", + "ms" + ] + } + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "100%", + "id": 5, + "isNew": true, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "span": 12, + "styles": [ + { + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "none" + } + ], + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "hide": true, + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT \"packets_per_second\" FROM \"opnfv_yardstick_tc037\" WHERE $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\"", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "packets_per_second" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + }, + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT \"errors\", \"packets_sent\", \"packets_received\" FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\"", + "refId": "B", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "errors" + ], + "type": "field" + } + ], + [ + { + "params": [ + "packets_sent" + ], + "type": "field" + } + ], + [ + { + "params": [ + "packets_received" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "title": "No. packets & errors - pktgen", + "transform": "table", + "type": "table" + } + ], + "title": "Pktgen/flows graph" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "100%", + "id": 4, + "isNew": true, + "links": [], + "minSpan": null, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": true + }, + "span": 12, + "styles": [ + { + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc037", + "query": "SELECT mean(\"rtt\") FROM \"opnfv_yardstick_tc037\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\"", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "rtt" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "14d", + "title": "RTT mean - ping", + "transform": "table", + "type": "table" + } + ], + "showTitle": false, + "title": "Ping/rtt graph" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 2, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": 0, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)", + "thresholdLine": false + }, + "id": 3, + "isNew": true, + "leftYAxisLabel": "Packet Per Second", + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "percentage": false, + "pointradius": 1, + "points": true, + "renderer": "flot", + "rightYAxisLabel": "", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_pod_name - $tag_deploy_scenario - eth0 - Total number of packets received per second", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc072", + "query": "SELECT \"network_utilization_average.eth0.rxpck/s\" FROM \"opnfv_yardstick_tc072\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\", \"task_id\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "network_utilization_average.eth0.rxpck/s" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + }, + { + "alias": "$tag_pod_name - $tag_deploy_scenario - eth0 - Total number of packets transmitted per second", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "task_id" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc072", + "query": "SELECT \"network_utilization_average.eth0.txpck/s\" FROM \"opnfv_yardstick_tc072\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"pod_name\", \"deploy_scenario\", \"task_id\"", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "network_utilization_average.eth0.txpck/s" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ], + "hide": false + } + ], + "timeFrom": "14d", + "timeShift": null, + "title": "Network Utilization - sar (system activity reporter)", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "pps", + "mbytes" + ] + } + ], + "title": "Ping table" + } + ], + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allFormat": "regex values", + "current": { + "tags": [], + "text": "ericsson-pod2 + huawei-pod1 + huawei-pod2 + intel-pod6 + lf-pod2 + zte-pod1", + "value": [ + "ericsson\\-pod2", + "huawei\\-pod1", + "huawei\\-pod2", + "intel\\-pod6", + "lf\\-pod2", + "zte\\-pod1" + ] + }, + "datasource": "yardstick-vtc", + "includeAll": true, + "label": "", + "multi": true, + "multiFormat": "regex values", + "name": "POD", + "options": [ + { + "selected": false, + "text": "All", + "value": "(elxg482ls42|ericsson\\-pod1|ericsson\\-pod2|huawei\\-pod1|huawei\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod5|intel\\-pod6|lf\\-pod1|lf\\-pod2|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown|zte\\-pod1)" + }, + { + "selected": false, + "text": "elxg482ls42", + "value": "elxg482ls42" + }, + { + "selected": false, + "text": "ericsson-pod1", + "value": "ericsson\\-pod1" + }, + { + "selected": true, + "text": "ericsson-pod2", + "value": "ericsson\\-pod2" + }, + { + "selected": true, + "text": "huawei-pod1", + "value": "huawei\\-pod1" + }, + { + "selected": true, + "text": "huawei-pod2", + "value": "huawei\\-pod2" + }, + { + "selected": false, + "text": "huawei-us-deploy-bare-1", + "value": "huawei\\-us\\-deploy\\-bare\\-1" + }, + { + "selected": false, + "text": "intel-pod5", + "value": "intel\\-pod5" + }, + { + "selected": true, + "text": "intel-pod6", + "value": "intel\\-pod6" + }, + { + "selected": false, + "text": "lf-pod1", + "value": "lf\\-pod1" + }, + { + "selected": true, + "text": "lf-pod2", + "value": "lf\\-pod2" + }, + { + "selected": false, + "text": "opnfv-jump-1", + "value": "opnfv\\-jump\\-1" + }, + { + "selected": false, + "text": "opnfv-jump-2", + "value": "opnfv\\-jump\\-2" + }, + { + "selected": false, + "text": "orange-fr-pod2", + "value": "orange\\-fr\\-pod2" + }, + { + "selected": false, + "text": "unknown", + "value": "unknown" + }, + { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + ], + "query": "SHOW TAG VALUES WITH KEY = \"pod_name\" ", + "refresh": false, + "type": "query" + }, + { + "allFormat": "regex values", + "current": { + "tags": [], + "text": "All", + "value": "(os\\-no_sdn\\-ovs\\-ha|os\\-nosdn\\-kvm\\-ha|os\\-nosdn\\-nofeature\\-ha|os\\-nosdn\\-nofeature\\-noha|os\\-nosdn\\-ovs\\-ha|os\\-ocl\\-nofeature\\-ha|os\\-odl_l2\\-bgpvpn\\-ha|os\\-odl_l2\\-nofeature\\-ha|os\\-odl_l2\\-nofeature\\-noha|os\\-odl_l2\\-sfc\\-ha|os\\-odl_l3\\-nofeature\\-ha|os\\-onos\\-nofeature\\-ha|os\\-onos\\-sfc\\-ha|os\\-ovs\\-nofeature\\-ha|unknown)" + }, + "datasource": "yardstick-vtc", + "includeAll": true, + "multi": true, + "multiFormat": "regex values", + "name": "SCENARIO", + "options": [ + { + "selected": true, + "text": "All", + "value": "(os\\-no_sdn\\-ovs\\-ha|os\\-nosdn\\-kvm\\-ha|os\\-nosdn\\-nofeature\\-ha|os\\-nosdn\\-nofeature\\-noha|os\\-nosdn\\-ovs\\-ha|os\\-ocl\\-nofeature\\-ha|os\\-odl_l2\\-bgpvpn\\-ha|os\\-odl_l2\\-nofeature\\-ha|os\\-odl_l2\\-nofeature\\-noha|os\\-odl_l2\\-sfc\\-ha|os\\-odl_l3\\-nofeature\\-ha|os\\-onos\\-nofeature\\-ha|os\\-onos\\-sfc\\-ha|os\\-ovs\\-nofeature\\-ha|unknown)" + }, + { + "selected": false, + "text": "os-no_sdn-ovs-ha", + "value": "os\\-no_sdn\\-ovs\\-ha" + }, + { + "selected": false, + "text": "os-nosdn-kvm-ha", + "value": "os\\-nosdn\\-kvm\\-ha" + }, + { + "selected": false, + "text": "os-nosdn-nofeature-ha", + "value": "os\\-nosdn\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "os-nosdn-nofeature-noha", + "value": "os\\-nosdn\\-nofeature\\-noha" + }, + { + "selected": false, + "text": "os-nosdn-ovs-ha", + "value": "os\\-nosdn\\-ovs\\-ha" + }, + { + "selected": false, + "text": "os-ocl-nofeature-ha", + "value": "os\\-ocl\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "os-odl_l2-bgpvpn-ha", + "value": "os\\-odl_l2\\-bgpvpn\\-ha" + }, + { + "selected": false, + "text": "os-odl_l2-nofeature-ha", + "value": "os\\-odl_l2\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "os-odl_l2-nofeature-noha", + "value": "os\\-odl_l2\\-nofeature\\-noha" + }, + { + "selected": false, + "text": "os-odl_l2-sfc-ha", + "value": "os\\-odl_l2\\-sfc\\-ha" + }, + { + "selected": false, + "text": "os-odl_l3-nofeature-ha", + "value": "os\\-odl_l3\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "os-onos-nofeature-ha", + "value": "os\\-onos\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "os-onos-sfc-ha", + "value": "os\\-onos\\-sfc\\-ha" + }, + { + "selected": false, + "text": "os-ovs-nofeature-ha", + "value": "os\\-ovs\\-nofeature\\-ha" + }, + { + "selected": false, + "text": "unknown", + "value": "unknown" + } + ], + "query": "SHOW TAG VALUES WITH KEY = \"deploy_scenario\" ", + "refresh": false, + "type": "query" + } + ] + }, + "annotations": { + "list": [] + }, + "refresh": false, + "schemaVersion": 8, + "version": 5, + "links": [] +} diff --git a/docs/userguide/opnfv_yardstick_tc051.rst b/docs/userguide/opnfv_yardstick_tc051.rst new file mode 100644 index 000000000..3402ccd92 --- /dev/null +++ b/docs/userguide/opnfv_yardstick_tc051.rst @@ -0,0 +1,117 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Yin Kanglin and others. +.. 14_ykl@tongji.edu.cn + +************************************* +Yardstick Test Case Description TC051 +************************************* + ++-----------------------------------------------------------------------------+ +|OpenStack Controller Node CPU Overload High Availability | +| | ++--------------+--------------------------------------------------------------+ +|test case id | OPNFV_YARDSTICK_TC051: OpenStack Controller Node CPU | +| | Overload High Availability | ++--------------+--------------------------------------------------------------+ +|test purpose | This test case will verify the high availability of control | +| | node. When the CPU usage of a specified controller node is | +| | stressed to 100%, which breaks down the Openstack services | +| | on this node. These Openstack service should able to be | +| | accessed by other controller nodes, and the services on | +| | failed controller node should be isolated. | ++--------------+--------------------------------------------------------------+ +|test method | This test case stresses the CPU uasge of a specified control | +| | node to 100%, then checks whether all services provided by | +| | the environment are OK with some monitor tools. | ++--------------+--------------------------------------------------------------+ +|attackers | In this test case, an attacker called "stress-cpu" is | +| | needed. This attacker includes two parameters: | +| | 1) fault_type: which is used for finding the attacker's | +| | scripts. It should be always set to "stress-cpu" in | +| | this test case. | +| | 2) host: which is the name of a control node being attacked. | +| | e.g. | +| | -fault_type: "stress-cpu" | +| | -host: node1 | ++--------------+--------------------------------------------------------------+ +|monitors | In this test case, the monitor named "openstack-cmd" is | +| | needed. The monitor needs needs two parameters: | +| | 1) monitor_type: which is used for finding the monitor class | +| | and related scritps. It should be always set to | +| | "openstack-cmd" for this monitor. | +| | 2) command_name: which is the command name used for request | +| | | +| | There are four instance of the "openstack-cmd" monitor: | +| | monitor1: | +| | -monitor_type: "openstack-cmd" | +| | -command_name: "nova image-list" | +| | monitor2: | +| | -monitor_type: "openstack-cmd" | +| | -command_name: "neutron router-list" | +| | monitor3: | +| | -monitor_type: "openstack-cmd" | +| | -command_name: "heat stack-list" | +| | monitor4: | +| | -monitor_type: "openstack-cmd" | +| | -command_name: "cinder list" | ++--------------+--------------------------------------------------------------+ +|metrics | In this test case, there is one metric: | +| | 1)service_outage_time: which indicates the maximum outage | +| | time (seconds) of the specified Openstack command request. | ++--------------+--------------------------------------------------------------+ +|test tool | Developed by the project. Please see folder: | +| | "yardstick/benchmark/scenarios/availability/ha_tools" | +| | | ++--------------+--------------------------------------------------------------+ +|references | ETSI NFV REL001 | +| | | ++--------------+--------------------------------------------------------------+ +|configuration | This test case needs two configuration files: | +| | 1) test case file: opnfv_yardstick_tc051.yaml | +| | -Attackers: see above "attackers" discription | +| | -waiting_time: which is the time (seconds) from the process | +| | being killed to stoping monitors the monitors | +| | -Monitors: see above "monitors" discription | +| | -SLA: see above "metrics" discription | +| | | +| | 2)POD file: pod.yaml | +| | The POD configuration should record on pod.yaml first. | +| | the "host" item in this test case will use the node name in | +| | the pod.yaml. | +| | | ++--------------+--------------------------------------------------------------+ +|test sequence | description and expected result | +| | | ++--------------+--------------------------------------------------------------+ +|step 1 | start monitors: | +| | each monitor will run with independently process | +| | | +| | Result: The monitor info will be collected. | +| | | ++--------------+--------------------------------------------------------------+ +|step 2 | do attacker: connect the host through SSH, and then execute | +| | the stress cpu script on the host. | +| | | +| | Result: The CPU usage of the host will be stressed to 100%. | +| | | ++--------------+--------------------------------------------------------------+ +|step 3 | stop monitors after a period of time specified by | +| | "waiting_time" | +| | | +| | Result: The monitor info will be aggregated. | +| | | ++--------------+--------------------------------------------------------------+ +|step 4 | verify the SLA | +| | | +| | Result: The test case is passed or not. | +| | | ++--------------+--------------------------------------------------------------+ +|post-action | It is the action when the test cases exist. It kills the | +| | process that stresses the CPU usage. | ++--------------+--------------------------------------------------------------+ +|test verdict | Fails only if SLA is not passed, or if there is a test case | +| | execution problem. | +| | | ++--------------+--------------------------------------------------------------+ diff --git a/docs/userguide/opnfv_yardstick_tc073.rst b/docs/userguide/opnfv_yardstick_tc073.rst new file mode 100644 index 000000000..a6499eabb --- /dev/null +++ b/docs/userguide/opnfv_yardstick_tc073.rst @@ -0,0 +1,81 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Huawei Technologies Co.,Ltd and others. + +************************************* +Yardstick Test Case Description TC073 +************************************* + +.. _netperf: http://www.netperf.org/netperf/training/Netperf.html + ++-----------------------------------------------------------------------------+ +|Throughput per NFVI node test | +| | ++--------------+--------------------------------------------------------------+ +|test case id | OPNFV_YARDSTICK_TC073_Network latency and throughput between | +| | nodes | +| | | ++--------------+--------------------------------------------------------------+ +|metric | Network latency and throughput | +| | | ++--------------+--------------------------------------------------------------+ +|test purpose | To evaluate the IaaS network performance with regards to | +| | flows and throughput, such as if and how different amounts | +| | of packet sizes and flows matter for the throughput between | +| | nodes in one pod. | +| | | ++--------------+--------------------------------------------------------------+ +|configuration | file: opnfv_yardstick_tc073.yaml | +| | | +| | Packet size: default 1024 bytes. | +| | | +| | Test length: default 20 seconds. | +| | | +| | The client and server are distributed on different nodes. | +| | | +| | For SLA max_mean_latency is set to 100. | +| | | ++--------------+--------------------------------------------------------------+ +|test tool | netperf | +| | Netperf is a software application that provides network | +| | bandwidth testing between two hosts on a network. It | +| | supports Unix domain sockets, TCP, SCTP, DLPI and UDP via | +| | BSD Sockets. Netperf provides a number of predefined tests | +| | e.g. to measure bulk (unidirectional) data transfer or | +| | request response performance. | +| | (netperf is not always part of a Linux distribution, hence | +| | it needs to be installed.) | +| | | ++--------------+--------------------------------------------------------------+ +|references | netperf Man pages | +| | ETSI-NFV-TST001 | +| | | ++--------------+--------------------------------------------------------------+ +|applicability | Test can be configured with different packet sizes and | +| | test duration. Default values exist. | +| | | +| | SLA (optional): max_mean_latency | +| | | ++--------------+--------------------------------------------------------------+ +|pre-test | The POD can be reached by external ip and logged on via ssh | +|conditions | | ++--------------+--------------------------------------------------------------+ +|test sequence | description and expected result | +| | | ++--------------+--------------------------------------------------------------+ +|step 1 | Install netperf tool on each specified node, one is as the | +| | server, and the other as the client. | +| | | ++--------------+--------------------------------------------------------------+ +|step 2 | Log on to the client node and use the netperf command to | +| | execute the network performance test | +| | | ++--------------+--------------------------------------------------------------+ +|step 3 | The throughput results stored. | +| | | ++--------------+--------------------------------------------------------------+ +|test verdict | Fails only if SLA is not passed, or if there is a test case | +| | execution problem. | +| | | ++--------------+--------------------------------------------------------------+ diff --git a/samples/storperf.yaml b/samples/storperf.yaml new file mode 100644 index 000000000..815ef0d97 --- /dev/null +++ b/samples/storperf.yaml @@ -0,0 +1,31 @@ +--- +# Sample StorPerf benchmark task config file +# StorPerf is a tool to measure block and object storage performance in an NFVI + +schema: "yardstick:task:0.1" + +scenarios: +- + type: StorPerf + options: + agent_count: 1 + agent_image: "Ubuntu 14.04" + public_network: "ext-net" + volume_size: 2 + # target: + # deadline: + # nossd: + # nowarm: + block_sizes: "4096" + queue_depths: "4" + workload: "ws" + StorPerf_ip: "192.168.23.2" + query_interval: 10 + timeout: 600 + + runner: + type: Iteration + iterations: 1 + +context: + type: Dummy diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh index 723a04aa1..35118b12c 100755 --- a/tests/ci/prepare_env.sh +++ b/tests/ci/prepare_env.sh @@ -55,3 +55,28 @@ export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME # Prepare a admin-rc file for StorPerf integration $YARDSTICK_REPO_DIR/tests/ci/prepare_storperf_admin-rc.sh + +# Fetching id_rsa file from jump_server..." +verify_connectivity() { + local ip=$1 + echo "Verifying connectivity to $ip..." + for i in $(seq 0 10); do + if ping -c 1 -W 1 $ip > /dev/null; then + echo "$ip is reachable!" + return 0 + fi + sleep 1 + done + error "Can not talk to $ip." +} + +ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +if [ "$INSTALLER_TYPE" == "fuel" ]; then + #ip_fuel="10.20.0.2" + verify_connectivity $INSTALLER_IP + echo "Fetching id_rsa file from jump_server $INSTALLER_IP..." + sshpass -p r00tme scp 2>/dev/null $ssh_options \ + root@${INSTALLER_IP}:~/.ssh/id_rsa /root/.ssh/id_rsa &> /dev/null +fi + diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml new file mode 100644 index 000000000..8e2e0c789 --- /dev/null +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml @@ -0,0 +1,90 @@ +--- +# Test case for TC051 :OpenStack Controller Node CPU Overload High Availability +# This test case is written by new scenario-based HA testing framework + +schema: "yardstick:task:0.1" +scenarios: + - + type: "GeneralHA" + options: + attackers: + - + fault_type: "general-attacker" + host: node1 + key: "stress-cpu" + attack_key: "stress-cpu" + + monitors: + - + monitor_type: "openstack-cmd" + key: "nova-image-list" + command_name: "nova image-list" + monitor_time: 10 + sla: + max_outage_time: 5 + + - + monitor_type: "openstack-cmd" + key: "neutron-router-list" + command_name: "neutron router-list" + monitor_time: 10 + sla: + max_outage_time: 5 + + - + monitor_type: "openstack-cmd" + key: "heat-stack-list" + command_name: "heat stack-list" + monitor_time: 10 + sla: + max_outage_time: 5 + + - + monitor_type: "openstack-cmd" + key: "cinder-list" + command_name: "cinder list" + monitor_time: 10 + sla: + max_outage_time: 5 + + + steps: + - + actionKey: "stress-cpu" + actionType: "attacker" + index: 1 + + - + actionKey: "nova-image-list" + actionType: "monitor" + index: 2 + + - + actionKey: "neutron-router-list" + actionType: "monitor" + index: 3 + + - + actionKey: "heat-stack-list" + actionType: "monitor" + index: 4 + + - + actionKey: "cinder-list" + actionType: "monitor" + index: 5 + + + nodes: + node1: node1.LF + runner: + type: Duration + duration: 1 + sla: + outage_time: 5 + action: monitor + +context: + type: Node + name: LF + file: etc/yardstick/nodes/fuel_virtual/pod.yaml diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml new file mode 100755 index 000000000..fd95b8c9d --- /dev/null +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml @@ -0,0 +1,37 @@ +--- +# Yardstick TC073 config file +# measure network latency and throughput using netperf +# There are two sample scenarios: bulk test and request/response test +# In bulk test, UDP_STREAM and TCP_STREAM can be used +# send_msg_size and recv_msg_size are options of bulk test +# In req/rsp test, TCP_RR TCP_CRR UDP_RR can be used +# req_rsp_size is option of req/rsp test + +schema: "yardstick:task:0.1" +{% set host = host or "node1.LF" %} +{% set target = target or "node2.LF" %} +{% set pod_info = pod_info or "etc/yardstick/nodes/compass_sclab_physical/pod.yaml" %} +scenarios: +- + type: NetperfNode + options: + testname: 'UDP_STREAM' + send_msg_size: 1024 + duration: 20 + + host: {{host}} + target: {{target}} + + runner: + type: Iteration + iterations: 1 + interval: 1 + sla: + mean_latency: 100 + action: monitor + +context: + type: Node + name: LF + file: {{pod_info}} + diff --git a/tests/unit/benchmark/scenarios/storage/test_storperf.py b/tests/unit/benchmark/scenarios/storage/test_storperf.py new file mode 100644 index 000000000..d87ed733c --- /dev/null +++ b/tests/unit/benchmark/scenarios/storage/test_storperf.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python + +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Unittest for yardstick.benchmark.scenarios.storage.storperf.StorPerf + +import mock +import unittest +import requests +import json + +from yardstick.benchmark.scenarios.storage import storperf + + +def mocked_requests_config_post(*args, **kwargs): + class MockResponseConfigPost: + def __init__(self, json_data, status_code): + self.content = json_data + self.status_code = status_code + + return MockResponseConfigPost('{"stack_id": "dac27db1-3502-4300-b301-91c64e6a1622","stack_created": "false"}', 200) + + +def mocked_requests_config_get(*args, **kwargs): + class MockResponseConfigGet: + def __init__(self, json_data, status_code): + self.content = json_data + self.status_code = status_code + + return MockResponseConfigGet('{"stack_id": "dac27db1-3502-4300-b301-91c64e6a1622","stack_created": "true"}', 200) + + +def mocked_requests_job_get(*args, **kwargs): + class MockResponseJobGet: + def __init__(self, json_data, status_code): + self.content = json_data + self.status_code = status_code + + return MockResponseJobGet('{"_ssd_preconditioning.queue-depth.8.block-size.16384.duration": 6}', 200) + + +def mocked_requests_job_post(*args, **kwargs): + class MockResponseJobPost: + def __init__(self, json_data, status_code): + self.content = json_data + self.status_code = status_code + + return MockResponseJobPost('{"job_id": \ + "d46bfb8c-36f4-4a40-813b-c4b4a437f728"}', 200) + + +def mocked_requests_job_delete(*args, **kwargs): + class MockResponseJobDelete: + def __init__(self, json_data, status_code): + self.content = json_data + self.status_code = status_code + + return MockResponseJobDelete('{}', 200) + + +def mocked_requests_delete(*args, **kwargs): + class MockResponseDelete: + def __init__(self, json_data, status_code): + self.json_data = json_data + self.status_code = status_code + + return MockResponseDelete('{}', 200) + + +def mocked_requests_delete_failed(*args, **kwargs): + class MockResponseDeleteFailed: + def __init__(self, json_data, status_code): + self.json_data = json_data + self.status_code = status_code + + if args[0] == "http://172.16.0.137:5000/api/v1.0/configurations": + return MockResponseDeleteFailed('{"message": "Teardown failed"}', 400) + + return MockResponseDeleteFailed('{}', 404) + + +class StorPerfTestCase(unittest.TestCase): + + def setUp(self): + self.ctx = { + 'host': { + 'ip': '172.16.0.137', + 'user': 'cirros', + 'key_filename': "mykey.key" + } + } + + self.result = {} + + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.post', + side_effect=mocked_requests_config_post) + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.get', + side_effect=mocked_requests_config_get) + def test_successful_setup(self, mock_post, mock_get): + options = { + "agent_count": 8, + "public_network": 'ext-net', + "volume_size": 10, + "block_sizes": 4096, + "queue_depths": 4, + "workload": "rs", + "StorPerf_ip": "192.168.23.2", + "query_interval": 10, + "timeout": 60 + } + + args = { + "options": options + } + + s = storperf.StorPerf(args, self.ctx) + + s.setup() + + self.assertTrue(s.setup_done) + + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.post', + side_effect=mocked_requests_job_post) + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.get', + side_effect=mocked_requests_job_get) + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.delete', + side_effect=mocked_requests_job_delete) + def test_successful_run(self, mock_post, mock_get, mock_delete): + options = { + "agent_count": 8, + "public_network": 'ext-net', + "volume_size": 10, + "block_sizes": 4096, + "queue_depths": 4, + "workload": "rs", + "StorPerf_ip": "192.168.23.2", + "query_interval": 10, + "timeout": 60 + } + + args = { + "options": options + } + + s = storperf.StorPerf(args, self.ctx) + s.setup_done = True + + sample_output = '{"_ssd_preconditioning.queue-depth.8.block-size.16384.duration": 6}' + + expected_result = json.loads(sample_output) + + s.run(self.result) + + self.assertEqual(self.result, expected_result) + + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.delete', side_effect=mocked_requests_delete) + def test_successful_teardown(self, mock_delete): + options = { + "agent_count": 8, + "public_network": 'ext-net', + "volume_size": 10, + "block_sizes": 4096, + "queue_depths": 4, + "workload": "rs", + "StorPerf_ip": "192.168.23.2", + "query_interval": 10, + "timeout": 60 + } + + args = { + "options": options + } + + s = storperf.StorPerf(args, self.ctx) + + s.teardown() + + self.assertFalse(s.setup_done) + + @mock.patch('yardstick.benchmark.scenarios.storage.storperf.requests.delete', side_effect=mocked_requests_delete_failed) + def test_failed_teardown(self, mock_delete): + options = { + "agent_count": 8, + "public_network": 'ext-net', + "volume_size": 10, + "block_sizes": 4096, + "queue_depths": 4, + "workload": "rs", + "StorPerf_ip": "192.168.23.2", + "query_interval": 10, + "timeout": 60 + } + + args = { + "options": options + } + + s = storperf.StorPerf(args, self.ctx) + + self.assertRaises(AssertionError, s.teardown(), self.result) + + +def main(): + unittest.main() + +if __name__ == '__main__': + main() diff --git a/yardstick/benchmark/scenarios/storage/storperf.py b/yardstick/benchmark/scenarios/storage/storperf.py new file mode 100644 index 000000000..d39c23aa2 --- /dev/null +++ b/yardstick/benchmark/scenarios/storage/storperf.py @@ -0,0 +1,208 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import logging +import json +import requests +import time + +from yardstick.benchmark.scenarios import base + +LOG = logging.getLogger(__name__) + + +class StorPerf(base.Scenario): + """Execute StorPerf benchmark. + Once the StorPerf container has been started and the ReST API exposed, + you can interact directly with it using the ReST API. StorPerf comes with a + Swagger interface that is accessible through the exposed port at: + http://StorPerf:5000/swagger/index.html + + Command line options: + target = [device or path] (Optional): + The path to either an attached storage device (/dev/vdb, etc) or a + directory path (/opt/storperf) that will be used to execute the performance + test. In the case of a device, the entire device will be used. + If not specified, the current directory will be used. + + workload = [workload module] (Optional): + If not specified, the default is to run all workloads. + The workload types are: + rs: 100% Read, sequential data + ws: 100% Write, sequential data + rr: 100% Read, random access + wr: 100% Write, random access + rw: 70% Read / 30% write, random access + + nossd (Optional): + Do not perform SSD style preconditioning. + + nowarm (Optional): + Do not perform a warmup prior to measurements. + + report = [job_id] (Optional): + Query the status of the supplied job_id and report on metrics. + If a workload is supplied, will report on only that subset. + + """ + __scenario_type__ = "StorPerf" + + def __init__(self, scenario_cfg, context_cfg): + """Scenario construction.""" + self.scenario_cfg = scenario_cfg + self.context_cfg = context_cfg + self.options = self.scenario_cfg["options"] + + self.target = self.options.get("StorPerf_ip", None) + self.query_interval = self.options.get("query_interval", 10) + # Maximum allowed job time + self.timeout = self.options.get('timeout', 3600) + + self.setup_done = False + self.job_completed = False + + def _query_setup_state(self): + """Query the stack status.""" + LOG.info("Querying the stack state...") + setup_query = requests.get('http://%s:5000/api/v1.0/configurations' + % self.target) + + setup_query_content = json.loads(setup_query.content) + if setup_query_content["stack_created"]: + self.setup_done = True + LOG.debug("stack_created: %s" + % setup_query_content["stack_created"]) + + def setup(self): + """Set the configuration.""" + env_args = {} + env_args_payload_list = ["agent_count", "public_network", + "agent_image", "volume_size"] + + for env_argument in env_args_payload_list: + if env_argument in self.options: + env_args[env_argument] = self.options[env_argument] + + LOG.info("Creating a stack on node %s with parameters %s" % + (self.target, env_args)) + setup_res = requests.post('http://%s:5000/api/v1.0/configurations' + % self.target, json=env_args) + + setup_res_content = json.loads(setup_res.content) + + if setup_res.status_code == 400: + raise RuntimeError("Failed to create a stack, error message:", + setup_res_content["message"]) + elif setup_res.status_code == 200: + LOG.info("stack_id: %s" % setup_res_content["stack_id"]) + + while not self.setup_done: + self._query_setup_state() + time.sleep(self.query_interval) + + # TODO: Support Storperf job status. + + # def _query_job_state(self, job_id): + # """Query the status of the supplied job_id and report on metrics""" + # LOG.info("Fetching report for %s..." % job_id) + # report_res = requests.get('http://%s:5000/api/v1.0/jobs?id=%s' % + # (self.target, job_id)) + + # report_res_content = json.loads(report_res.content) + + # if report_res.status_code == 400: + # raise RuntimeError("Failed to fetch report, error message:", + # report_res_content["message"]) + # else: + # job_status = report_res_content["status"] + + # LOG.debug("Job is: %s..." % job_status) + # if job_status == "completed": + # self.job_completed = True + + # TODO: Support using StorPerf ReST API to read Job ETA. + + # if job_status == "completed": + # self.job_completed = True + # ETA = 0 + # elif job_status == "running": + # ETA = report_res_content['time'] + # + # return ETA + + def run(self, result): + """Execute StorPerf benchmark""" + if not self.setup_done: + self.setup() + + job_args = {} + job_args_payload_list = ["block_sizes", "queue_depths", "deadline", + "target", "nossd", "nowarm", "workload"] + + for job_argument in job_args_payload_list: + if job_argument in self.options: + job_args[job_argument] = self.options[job_argument] + + LOG.info("Starting a job with parameters %s" % job_args) + job_res = requests.post('http://%s:5000/api/v1.0/jobs' % self.target, + json=job_args) + + job_res_content = json.loads(job_res.content) + + if job_res.status_code == 400: + raise RuntimeError("Failed to start a job, error message:", + job_res_content["message"]) + elif job_res.status_code == 200: + job_id = job_res_content["job_id"] + LOG.info("Started job id: %s..." % job_id) + + time.sleep(self.timeout) + terminate_res = requests.delete('http://%s:5000/api/v1.0/jobs' % + self.target) + + if terminate_res.status_code == 400: + terminate_res_content = json.loads(terminate_res.content) + raise RuntimeError("Failed to start a job, error message:", + terminate_res_content["message"]) + + # TODO: Support Storperf job status. + + # while not self.job_completed: + # self._query_job_state(job_id) + # time.sleep(self.query_interval) + + # TODO: Support using ETA to polls for completion. + # Read ETA, next poll in 1/2 ETA time slot. + # If ETA is greater than the maximum allowed job time, + # then terminate job immediately. + + # while not self.job_completed: + # esti_time = self._query_state(job_id) + # if esti_time > self.timeout: + # terminate_res = requests.delete('http://%s:5000/api/v1.0 + # /jobs' % self.target) + # else: + # time.sleep(int(est_time)/2) + + result_res = requests.get('http://%s:5000/api/v1.0/jobs?id=%s' % + (self.target, job_id)) + result_res_content = json.loads(result_res.content) + + result.update(result_res_content) + + def teardown(self): + """Deletes the agent configuration and the stack""" + teardown_res = requests.delete('http://%s:5000/api/v1.0/\ + configurations' % self.target) + + if teardown_res.status_code == 400: + teardown_res_content = json.loads(teardown_res.content) + raise RuntimeError("Failed to reset environment, error message:", + teardown_res_content['message']) + + self.setup_done = False diff --git a/yardstick/resources/script/install/storperf.bash b/yardstick/resources/scripts/install/storperf.bash index 9bbec7206..9bbec7206 100644 --- a/yardstick/resources/script/install/storperf.bash +++ b/yardstick/resources/scripts/install/storperf.bash diff --git a/yardstick/resources/script/remove/storperf.bash b/yardstick/resources/scripts/remove/storperf.bash index a8eb51c89..a8eb51c89 100644 --- a/yardstick/resources/script/remove/storperf.bash +++ b/yardstick/resources/scripts/remove/storperf.bash |