diff options
-rw-r--r-- | dashboard/Yardstick-TC002-1456495853488 | 297 | ||||
-rw-r--r-- | dashboard/Yardstick-TC005-1456495868837 | 252 | ||||
-rw-r--r-- | dashboard/Yardstick-TC010-1456495940503 | 252 | ||||
-rw-r--r-- | dashboard/Yardstick-TC011-1456495954966 | 251 | ||||
-rw-r--r-- | dashboard/Yardstick-TC012-1456495966540 | 14 | ||||
-rw-r--r-- | dashboard/Yardstick-TC014-1456496016450 | 240 | ||||
-rw-r--r-- | dashboard/Yardstick-TC037-1456496078470 | 14 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/availability/test_baseoperation.py | 82 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/availability/test_operation_general.py | 67 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/operation/__init__.py | 0 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/operation/baseoperation.py | 81 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/operation/operation_general.py | 77 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/operation_conf.yaml | 16 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/networking/ping.py | 14 |
14 files changed, 1626 insertions, 31 deletions
diff --git a/dashboard/Yardstick-TC002-1456495853488 b/dashboard/Yardstick-TC002-1456495853488 index eb8c27d43..8bf10f445 100644 --- a/dashboard/Yardstick-TC002-1456495853488 +++ b/dashboard/Yardstick-TC002-1456495853488 @@ -1038,6 +1038,121 @@ "type": "table", "repeatIteration": 1456495841616, "repeatPanelId": 2 + }, + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "90%", + "height": "", + "id": 18, + "isNew": true, + "links": [], + "minSpan": 2, + "pageSize": 100, + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": false + }, + "span": 2, + "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": "deploy_scenario", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "ms" + } + ], + "targets": [ + { + "alias": "", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc002", + "query": "SELECT mean(\"rtt\") FROM \"opnfv_yardstick_tc002\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\"", + "rawQuery": false, + "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": "24h", + "title": "$POD", + "transform": "table", + "transparent": false, + "type": "table", + "repeatIteration": 1456495841616, + "repeatPanelId": 2 } ], "showTitle": false, @@ -2053,6 +2168,174 @@ ], "repeatIteration": 1456495841616, "repeatPanelId": 3 + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 1, + "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)" + }, + "height": "", + "id": 19, + "interval": "", + "isNew": true, + "leftYAxisLabel": "<RTT>", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "minSpan": 2, + "nullPointMode": "connected", + "percentage": false, + "pointradius": 1, + "points": true, + "renderer": "flot", + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "seriesOverrides": [ + { + "alias": "os-odl_l2-nofeature-ha", + "color": "#7EB26D" + }, + { + "alias": "os-nosdn-nofeature-ha", + "color": "#E24D42" + }, + { + "alias": "os-onos-nofeature-ha", + "color": "#6ED0E0" + }, + { + "alias": "os-nosdn-ovs-ha", + "color": "#EAB839" + }, + { + "alias": "os-odl_l3-nofeature-ha", + "color": "#E5A8E2" + }, + { + "alias": "os-odl_l2-bgpvpn-ha", + "color": "#E0752D" + }, + { + "alias": "os-odl_l2-sfc-ha", + "color": "#508642" + } + ], + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "opnfv_yardstick_tc002", + "query": "SELECT mean(\"rtt\") FROM \"opnfv_yardstick_tc002\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"deploy_scenario\", \"pod_name\" fill(null)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "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", + "timeShift": null, + "title": "$POD", + "tooltip": { + "shared": true, + "value_type": "individual" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "ms", + "short" + ], + "repeatIteration": 1456495841616, + "repeatPanelId": 3 } ], "showTitle": false, @@ -2095,14 +2378,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -2116,7 +2400,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -2154,6 +2438,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -2241,4 +2530,4 @@ "schemaVersion": 8, "version": 113, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC005-1456495868837 b/dashboard/Yardstick-TC005-1456495868837 index c9719860e..e5b29d3dd 100644 --- a/dashboard/Yardstick-TC005-1456495868837 +++ b/dashboard/Yardstick-TC005-1456495868837 @@ -837,6 +837,113 @@ "type": "table", "repeatIteration": 1456495861692, "repeatPanelId": 5 + }, + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "100%", + "id": 20, + "isNew": true, + "links": [], + "minSpan": 2, + "pageSize": null, + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "span": 2, + "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": "deploy_scenario", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc005", + "query": "SELECT \"read_iops\" FROM \"opnfv_yardstick_tc005\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "read_iops" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "24h", + "title": "$POD", + "transform": "timeseries_to_rows", + "type": "table", + "repeatIteration": 1456495861692, + "repeatPanelId": 5 } ], "title": "New row" @@ -1629,6 +1736,137 @@ ], "repeatIteration": 1456495861692, "repeatPanelId": 7 + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "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": 21, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "minSpan": 2, + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "seriesOverrides": [], + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "opnfv_yardstick_tc005", + "query": "SELECT mean(\"read_bw\") FROM \"opnfv_yardstick_tc005\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"deploy_scenario\", \"pod_name\" fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "read_bw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "10d", + "timeShift": null, + "title": "$POD", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "repeatIteration": 1456495861692, + "repeatPanelId": 7 } ], "title": "New row" @@ -1669,14 +1907,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -1688,7 +1927,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -1726,6 +1965,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -1808,4 +2052,4 @@ "schemaVersion": 8, "version": 9, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC010-1456495940503 b/dashboard/Yardstick-TC010-1456495940503 index 9edc972d6..72cb70495 100644 --- a/dashboard/Yardstick-TC010-1456495940503 +++ b/dashboard/Yardstick-TC010-1456495940503 @@ -838,6 +838,113 @@ "type": "table", "repeatIteration": 1456495934825, "repeatPanelId": 5 + }, + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "100%", + "id": 20, + "isNew": true, + "links": [], + "minSpan": 2, + "pageSize": null, + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "span": 2, + "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": "deploy_scenario", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc010", + "query": "SELECT \"latencies0.latency\" FROM \"opnfv_yardstick_tc010\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "latencies0.latency" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "24h", + "title": "$POD", + "transform": "timeseries_to_rows", + "type": "table", + "repeatIteration": 1456495934825, + "repeatPanelId": 5 } ], "title": "New row" @@ -1630,6 +1737,137 @@ ], "repeatIteration": 1456495934825, "repeatPanelId": 7 + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "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": 21, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "minSpan": 2, + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "seriesOverrides": [], + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "opnfv_yardstick_tc010", + "query": "SELECT mean(\"latencies0.latency\") FROM \"opnfv_yardstick_tc010\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"deploy_scenario\", \"pod_name\" fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "latencies0.latency" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "10d", + "timeShift": null, + "title": "$POD", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "repeatIteration": 1456495934825, + "repeatPanelId": 7 } ], "title": "New row" @@ -1670,14 +1908,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -1689,7 +1928,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -1727,6 +1966,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -1809,4 +2053,4 @@ "schemaVersion": 8, "version": 4, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC011-1456495954966 b/dashboard/Yardstick-TC011-1456495954966 index 248135534..db8f48ce8 100644 --- a/dashboard/Yardstick-TC011-1456495954966 +++ b/dashboard/Yardstick-TC011-1456495954966 @@ -837,6 +837,113 @@ "type": "table", "repeatIteration": 1456495947533, "repeatPanelId": 5 + }, + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "100%", + "id": 20, + "isNew": true, + "links": [], + "minSpan": 2, + "pageSize": null, + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "span": 2, + "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": "deploy_scenario", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 4, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc011", + "query": "SELECT \"end.sum.jitter_ms\" FROM \"opnfv_yardstick_tc011\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "end.sum.jitter_ms" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "24h", + "title": "$POD", + "transform": "timeseries_to_rows", + "type": "table", + "repeatIteration": 1456495947533, + "repeatPanelId": 5 } ], "title": "New row" @@ -1623,6 +1730,136 @@ ], "repeatIteration": 1456495947533, "repeatPanelId": 7 + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "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": 21, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "minSpan": 2, + "nullPointMode": "connected", + "percentage": false, + "pointradius": 3, + "points": true, + "renderer": "flot", + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "seriesOverrides": [], + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "24h" + ], + "type": "time" + }, + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "opnfv_yardstick_tc011", + "query": "SELECT mean(\"end.sum.jitter_ms\") FROM \"opnfv_yardstick_tc011\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY time(24h), \"deploy_scenario\", \"pod_name\" fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "end.sum.jitter_ms" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "10d", + "timeShift": null, + "title": "$POD", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "repeatIteration": 1456495947533, + "repeatPanelId": 7 } ], "title": "New row" @@ -1663,14 +1900,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -1682,7 +1920,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -1720,6 +1958,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -1803,4 +2046,4 @@ "schemaVersion": 8, "version": 11, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC012-1456495966540 b/dashboard/Yardstick-TC012-1456495966540 index fde466f15..0cab51702 100644 --- a/dashboard/Yardstick-TC012-1456495966540 +++ b/dashboard/Yardstick-TC012-1456495966540 @@ -365,14 +365,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -384,7 +385,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -422,6 +423,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -503,4 +509,4 @@ "schemaVersion": 8, "version": 29, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC014-1456496016450 b/dashboard/Yardstick-TC014-1456496016450 index e0a284505..a06ddb603 100644 --- a/dashboard/Yardstick-TC014-1456496016450 +++ b/dashboard/Yardstick-TC014-1456496016450 @@ -841,6 +841,113 @@ "type": "table", "repeatIteration": 1456496008517, "repeatPanelId": 6 + }, + { + "columns": [], + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fontSize": "90%", + "id": 24, + "isNew": true, + "links": [], + "minSpan": 2, + "pageSize": null, + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "span": 2, + "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": "deploy_scenario", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc014", + "query": "SELECT \"parallel_score\" FROM \"opnfv_yardstick_tc014\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "parallel_score" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "24h", + "title": "$POD", + "transform": "timeseries_to_rows", + "type": "table", + "repeatIteration": 1456496008517, + "repeatPanelId": 6 } ], "title": "New row" @@ -1573,6 +1680,127 @@ ], "repeatIteration": 1456496008517, "repeatPanelId": 5 + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "yardstick-vtc", + "editable": true, + "error": false, + "fill": 1, + "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": 25, + "isNew": true, + "leftYAxisLabel": "score", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "minSpan": 2, + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": true, + "renderer": "flot", + "repeat": null, + "scopedVars": { + "POD": { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + } + }, + "seriesOverrides": [ + { + "alias": "os-odl_l2-bgpvpn-ha", + "color": "#7EB26D" + } + ], + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_deploy_scenario", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "deploy_scenario" + ], + "type": "tag" + }, + { + "params": [ + "pod_name" + ], + "type": "tag" + } + ], + "measurement": "opnfv_yardstick_tc014", + "query": "SELECT \"single_score\" FROM \"opnfv_yardstick_tc014\" WHERE \"pod_name\" =~ /$POD$/ AND \"deploy_scenario\" =~ /$SCENARIO$/ AND $timeFilter GROUP BY \"deploy_scenario\", \"pod_name\"", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "single_score" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "pod_name", + "operator": "=~", + "value": "/$POD$/" + }, + { + "condition": "AND", + "key": "deploy_scenario", + "operator": "=~", + "value": "/$SCENARIO$/" + } + ] + } + ], + "timeFrom": "10d", + "timeShift": null, + "title": "$POD", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "repeatIteration": 1456496008517, + "repeatPanelId": 5 } ], "title": "New row" @@ -1734,14 +1962,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -1791,6 +2020,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -1874,4 +2108,4 @@ "schemaVersion": 8, "version": 13, "links": [] -}
\ No newline at end of file +} diff --git a/dashboard/Yardstick-TC037-1456496078470 b/dashboard/Yardstick-TC037-1456496078470 index dae167d88..6072c327b 100644 --- a/dashboard/Yardstick-TC037-1456496078470 +++ b/dashboard/Yardstick-TC037-1456496078470 @@ -1113,14 +1113,15 @@ "allFormat": "regex values", "current": { "tags": [], - "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2", + "text": "ericsson-pod2 + huawei-us-deploy-bare-1 + intel-pod6 + opnfv-jump-1 + opnfv-jump-2 + orange-fr-pod2 + zte-pod1", "value": [ "ericsson\\-pod2", "huawei\\-us\\-deploy\\-bare\\-1", "intel\\-pod6", "opnfv\\-jump\\-1", "opnfv\\-jump\\-2", - "orange\\-fr\\-pod2" + "orange\\-fr\\-pod2", + "zte\\-pod1" ] }, "datasource": "yardstick-vtc", @@ -1133,7 +1134,7 @@ { "selected": false, "text": "All", - "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|unknown)" + "value": "(elxg482ls42|ericsson\\-pod2|huawei\\-us\\-deploy\\-bare\\-1|intel\\-pod6|opnfv\\-jump\\-1|opnfv\\-jump\\-2|orange\\-fr\\-pod2|zte\\-pod1|unknown)" }, { "selected": false, @@ -1171,6 +1172,11 @@ "value": "orange\\-fr\\-pod2" }, { + "selected": true, + "text": "zte-pod1", + "value": "zte\\-pod1" + }, + { "selected": false, "text": "unknown", "value": "unknown" @@ -1252,4 +1258,4 @@ "schemaVersion": 8, "version": 85, "links": [] -}
\ No newline at end of file +} diff --git a/tests/unit/benchmark/scenarios/availability/test_baseoperation.py b/tests/unit/benchmark/scenarios/availability/test_baseoperation.py new file mode 100644 index 000000000..8c341913f --- /dev/null +++ b/tests/unit/benchmark/scenarios/availability/test_baseoperation.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python + +############################################################################## +# Copyright (c) 2016 Huan Li and others +# lihuansse@tongji.edu.cn +# 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.availability.operation.baseoperation + +import mock +import unittest + +from yardstick.benchmark.scenarios.availability.operation import baseoperation + +@mock.patch('yardstick.benchmark.scenarios.availability.operation.baseoperation.BaseOperation') +class OperationMgrTestCase(unittest.TestCase): + + def setUp(self): + config = { + 'operation_type': 'general-operation', + 'key' : 'service_status' + } + + self.operation_configs = [] + self.operation_configs.append(config) + + def test_all_successful(self, mock_operation): + mgr_ins = baseoperation.OperationMgr() + mgr_ins.init_operations(self.operation_configs, None) + operation_ins = mgr_ins["service_status"] + mgr_ins.rollback() + + def test_getitem_fail(self, mock_operation): + mgr_ins = baseoperation.OperationMgr() + mgr_ins.init_operations(self.operation_configs, None) + with self.assertRaises(KeyError): + operation_ins = mgr_ins["operation-not-exist"] + + +class TestOperation(baseoperation.BaseOperation): + __operation__type__ = "test-operation" + + def setup(self): + pass + + def run(self): + pass + + def rollback(self): + pass + + +class BaseOperationTestCase(unittest.TestCase): + + def setUp(self): + self.config = { + 'operation_type': 'general-operation', + 'key' : 'service_status' + } + + def test_all_successful(self): + base_ins = baseoperation.BaseOperation(self.config, None) + base_ins.setup() + base_ins.run() + base_ins.rollback() + + def test_get_script_fullpath(self): + base_ins = baseoperation.BaseOperation(self.config, None) + base_ins.get_script_fullpath("ha_tools/test.bash"); + + def test_get_operation_cls_successful(self): + base_ins = baseoperation.BaseOperation(self.config, None) + operation_ins = base_ins.get_operation_cls("test-operation") + + def test_get_operation_cls_fail(self): + base_ins = baseoperation.BaseOperation(self.config, None) + with self.assertRaises(RuntimeError): + operation_ins = base_ins.get_operation_cls("operation-not-exist") diff --git a/tests/unit/benchmark/scenarios/availability/test_operation_general.py b/tests/unit/benchmark/scenarios/availability/test_operation_general.py new file mode 100644 index 000000000..6713733a8 --- /dev/null +++ b/tests/unit/benchmark/scenarios/availability/test_operation_general.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +############################################################################## +# Copyright (c) 2016 Huan Li and others +# lihuansse@tongji.edu.cn +# 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.availability.operation +# .operation_general + +import mock +import unittest +from yardstick.benchmark.scenarios.availability.operation import operation_general + +@mock.patch('yardstick.benchmark.scenarios.availability.operation.' + 'operation_general.ssh') +@mock.patch('yardstick.benchmark.scenarios.availability.operation.' + 'operation_general.open') +class GeneralOperaionTestCase(unittest.TestCase): + + def setUp(self): + host = { + "ip": "10.20.0.5", + "user": "root", + "key_filename": "/root/.ssh/id_rsa" + } + self.context = {"node1": host} + self.operation_cfg = { + 'operation_type': 'general-operation', + 'action_parameter': {'ins_cup': 2}, + 'rollback_parameter': {'ins_id': 'id123456'}, + 'key': 'nova-create-instance', + 'host': 'node1', + } + self.operation_cfg_noparam = { + 'operation_type': 'general-operation', + 'key': 'nova-create-instance', + 'host': 'node1', + } + + def test__operation_successful(self, mock_open, mock_ssh): + ins = operation_general.GeneralOperaion(self.operation_cfg, + self.context); + mock_ssh.SSH().execute.return_value = (0, "success", '') + ins.setup() + ins.run() + ins.rollback() + + def test__operation_successful_noparam(self, mock_open, mock_ssh): + ins = operation_general.GeneralOperaion(self.operation_cfg_noparam, + self.context); + mock_ssh.SSH().execute.return_value = (0, "success", '') + ins.setup() + ins.run() + ins.rollback() + + def test__operation_fail(self, mock_open, mock_ssh): + ins = operation_general.GeneralOperaion(self.operation_cfg, + self.context); + mock_ssh.SSH().execute.return_value = (1, "failed", '') + ins.setup() + ins.run() + ins.rollback() diff --git a/yardstick/benchmark/scenarios/availability/operation/__init__.py b/yardstick/benchmark/scenarios/availability/operation/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/benchmark/scenarios/availability/operation/__init__.py diff --git a/yardstick/benchmark/scenarios/availability/operation/baseoperation.py b/yardstick/benchmark/scenarios/availability/operation/baseoperation.py new file mode 100644 index 000000000..e776e87ae --- /dev/null +++ b/yardstick/benchmark/scenarios/availability/operation/baseoperation.py @@ -0,0 +1,81 @@ +############################################################################## +# Copyright (c) 2016 Juan Qiu and others +# juan_ qiu@tongji.edu.cn +# 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 pkg_resources +import yaml +import logging +import os + +import yardstick.common.utils as utils + +LOG = logging.getLogger(__name__) + +operation_conf_path = pkg_resources.resource_filename( + "yardstick.benchmark.scenarios.availability", + "operation_conf.yaml") + + +class OperationMgr(object): + + def __init__(self): + self._operation_list = [] + + def init_operations(self, operation_cfgs, context): + LOG.debug("operationMgr confg: %s" % operation_cfgs) + for cfg in operation_cfgs: + operation_type = cfg['operation_type'] + operation_cls = BaseOperation.get_operation_cls(operation_type) + operation_ins = operation_cls(cfg, context) + operation_ins.key = cfg['key'] + operation_ins.setup() + self._operation_list.append(operation_ins) + + def __getitem__(self, item): + for obj in self._operation_list: + if(obj.key == item): + return obj + raise KeyError("No such operation instance of key - %s" % item) + + def rollback(self): + for _instance in self._operation_list: + _instance.rollback() + + +class BaseOperation(object): + + operation_cfgs = {} + + def __init__(self, config, context): + if not BaseOperation.operation_cfgs: + with open(operation_conf_path) as stream: + BaseOperation.operation_cfgs = yaml.load(stream) + self.key = '' + self._config = config + self._context = context + + @staticmethod + def get_operation_cls(type): + '''return operation instance of specified type''' + operation_type = type + for operation_cls in utils.itersubclasses(BaseOperation): + if operation_type == operation_cls.__operation__type__: + return operation_cls + raise RuntimeError("No such runner_type %s" % operation_type) + + def get_script_fullpath(self, path): + base_path = os.path.dirname(operation_conf_path) + return os.path.join(base_path, path) + + def setup(self): + pass + + def run(self): + pass + + def rollback(self): + pass diff --git a/yardstick/benchmark/scenarios/availability/operation/operation_general.py b/yardstick/benchmark/scenarios/availability/operation/operation_general.py new file mode 100644 index 000000000..d41371629 --- /dev/null +++ b/yardstick/benchmark/scenarios/availability/operation/operation_general.py @@ -0,0 +1,77 @@ +############################################################################## +# Copyright (c) 2016 Juan Qiu and others +# juan_ qiu@tongji.edu.cn +# 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 +from baseoperation import BaseOperation +import yardstick.ssh as ssh +from yardstick.benchmark.scenarios.availability.util import buildshellparams + +LOG = logging.getLogger(__name__) + + +class GeneralOperaion(BaseOperation): + + __operation__type__ = "general-operation" + + def setup(self): + LOG.debug("config:%s context:%s" % (self._config, self._context)) + host = self._context.get(self._config['host'], None) + ip = host.get("ip", None) + user = host.get("user", "root") + key_filename = host.get("key_filename", "~/.ssh/id_rsa") + + self.connection = ssh.SSH(user, ip, key_filename=key_filename) + self.connection.wait(timeout=600) + LOG.debug("ssh host success!") + + self.key = self._config['key'] + + if "action_parameter" in self._config: + actionParameter = self._config['action_parameter'] + str = buildshellparams(actionParameter) + l = list(item for item in actionParameter.values()) + self.action_param = str.format(*l) + + if "rollback_parameter" in self._config: + rollbackParameter = self._config['rollback_parameter'] + str = buildshellparams(rollbackParameter) + l = list(item for item in rollbackParameter.values()) + self.rollback_param = str.format(*l) + + self.operation_cfgs = BaseOperation.operation_cfgs.get(self.key) + self.action_script = self.get_script_fullpath( + self.operation_cfgs['action_script']) + self.rollback_script = self.get_script_fullpath( + self.operation_cfgs['rollback_script']) + + def run(self): + if "action_parameter" in self._config: + exit_status, stdout, stderr = self.connection.execute( + self.action_param, + stdin=open(self.action_script, "r")) + else: + exit_status, stdout, stderr = self.connection.execute( + "/bin/sh -s ", + stdin=open(self.action_script, "r")) + + if exit_status == 0: + LOG.debug("success,the operation's output is: {0}".format(stdout)) + else: + LOG.error( + "the operation's error, stdout:%s, stderr:%s" % + (stdout, stderr)) + + def rollback(self): + if "rollback_parameter" in self._config: + exit_status, stdout, stderr = self.connection.execute( + self.rollback_param, + stdin=open(self.rollback_script, "r")) + else: + exit_status, stdout, stderr = self.connection.execute( + "/bin/sh -s ", + stdin=open(self.rollback_script, "r")) diff --git a/yardstick/benchmark/scenarios/availability/operation_conf.yaml b/yardstick/benchmark/scenarios/availability/operation_conf.yaml new file mode 100644 index 000000000..78c996d05 --- /dev/null +++ b/yardstick/benchmark/scenarios/availability/operation_conf.yaml @@ -0,0 +1,16 @@ +--- +# sample config file for ha test +# +schema: "yardstick:task:0.1" + +nova-create-instance: + action_script: ha_tools/nova/create_instance_from_image.bash + rollback_script: ha_tools/nova/delete_instance.bash + +swift_upload_file: + action_script: ha_tools/swift/upload.bash + rollback_script: ha_tools/swift/delete.bash + +swift_download_file: + action_script: ha_tools/swift/download.bash + rollback_script: ha_tools/file/remove_file.bash
\ No newline at end of file diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py index 3af354850..08755a08b 100644 --- a/yardstick/benchmark/scenarios/networking/ping.py +++ b/yardstick/benchmark/scenarios/networking/ping.py @@ -41,11 +41,17 @@ class Ping(base.Scenario): user = host.get('user', 'ubuntu') ip = host.get('ip', None) key_filename = host.get('key_filename', '/root/.ssh/id_rsa') - password = host.get('password', 'root') + password = host.get('password', None) + + if password is not None: + LOG.info("Log in via pw, user:%s, host:%s, pw:%s", + user, ip, password) + self.connection = ssh.SSH(user, ip, password=password) + else: + LOG.info("Log in via key, user:%s, host:%s, key_filename:%s", + user, ip, key_filename) + self.connection = ssh.SSH(user, ip, key_filename=key_filename) - LOG.info("user:%s, host:%s, key_filename:%s", user, ip, key_filename) - self.connection = ssh.SSH(user, ip, key_filename=key_filename, - password=password) self.connection.wait() def run(self, result): |