aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dashboard/Yardstick-Main-14564957955156
-rw-r--r--dashboard/Yardstick-TC002-1456495853488297
-rw-r--r--dashboard/Yardstick-TC005-1456495868837252
-rw-r--r--dashboard/Yardstick-TC010-1456495940503252
-rw-r--r--dashboard/Yardstick-TC011-1456495954966251
-rw-r--r--dashboard/Yardstick-TC012-145649596654014
-rw-r--r--dashboard/Yardstick-TC014-1456496016450240
-rw-r--r--dashboard/Yardstick-TC037-145649607847014
-rw-r--r--docs/userguide/opnfv_yardstick_tc045.rst139
-rw-r--r--plugin/sample_config.yaml12
-rw-r--r--samples/ping-multiple-vm.yaml42
-rw-r--r--samples/plugintest.yaml22
-rw-r--r--samples/sfc.yaml (renamed from tests/sfc/sfc_TC02.yaml)28
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc004.yaml85
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml87
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml43
-rw-r--r--tests/opnfv/test_suites/fuel_test_suite.yaml12
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_basemonitor.py6
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_baseoperation.py82
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_general.py73
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_operation_general.py67
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_plugintest.py60
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_ping.py4
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_sfc.py18
-rw-r--r--tests/unit/cmd/commands/test_plugin.py83
-rw-r--r--yardstick/benchmark/contexts/model.py2
-rw-r--r--yardstick/benchmark/scenarios/availability/monitor/basemonitor.py14
-rw-r--r--yardstick/benchmark/scenarios/availability/monitor/monitor_general.py70
-rw-r--r--yardstick/benchmark/scenarios/availability/monitor_conf.yaml11
-rw-r--r--yardstick/benchmark/scenarios/availability/operation/__init__.py0
-rw-r--r--yardstick/benchmark/scenarios/availability/operation/baseoperation.py81
-rw-r--r--yardstick/benchmark/scenarios/availability/operation/operation_general.py77
-rw-r--r--yardstick/benchmark/scenarios/availability/operation_conf.yaml16
-rw-r--r--yardstick/benchmark/scenarios/compute/plugintest.py54
-rw-r--r--yardstick/benchmark/scenarios/networking/ping.py55
-rw-r--r--yardstick/benchmark/scenarios/networking/sfc.py122
-rwxr-xr-xyardstick/benchmark/scenarios/networking/sfc_change_classi.bash7
-rw-r--r--yardstick/benchmark/scenarios/networking/sfc_openstack.py117
-rwxr-xr-xyardstick/benchmark/scenarios/networking/sfc_pre_setup.bash7
-rwxr-xr-xyardstick/benchmark/scenarios/networking/sfc_server.bash6
-rwxr-xr-xyardstick/benchmark/scenarios/networking/sfc_tacker.bash30
-rwxr-xr-xyardstick/benchmark/scenarios/networking/sfc_teardown.bash13
-rw-r--r--yardstick/cmd/cli.py4
-rw-r--r--yardstick/cmd/commands/plugin.py156
-rw-r--r--yardstick/cmd/commands/task.py14
-rw-r--r--yardstick/orchestrator/heat.py12
-rw-r--r--yardstick/resources/script/install/sample.bash18
-rw-r--r--yardstick/resources/script/remove/sample.bash16
49 files changed, 2984 insertions, 111 deletions
diff --git a/dashboard/Yardstick-Main-1456495795515 b/dashboard/Yardstick-Main-1456495795515
index 04a9f5e65..d8cac5aa9 100644
--- a/dashboard/Yardstick-Main-1456495795515
+++ b/dashboard/Yardstick-Main-1456495795515
@@ -186,6 +186,10 @@
{
"alias": "orange-fr-pod2 - os-nosdn-nofeature-ha - latency",
"yaxis": 2
+ },
+ {
+ "alias": "zte-pod1 - os-odl_l2-nofeature-ha - latency",
+ "yaxis": 2
}
],
"span": 8,
@@ -472,4 +476,4 @@
"schemaVersion": 8,
"version": 124,
"links": []
-} \ No newline at end of file
+}
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/docs/userguide/opnfv_yardstick_tc045.rst b/docs/userguide/opnfv_yardstick_tc045.rst
new file mode 100644
index 000000000..0b0993c34
--- /dev/null
+++ b/docs/userguide/opnfv_yardstick_tc045.rst
@@ -0,0 +1,139 @@
+.. 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 TC045
+*************************************
+
++-----------------------------------------------------------------------------+
+|Control Node Openstack Service High Availability - Neutron Server |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC045: Control node Openstack service down - |
+| | neutron server |
++--------------+--------------------------------------------------------------+
+|test purpose | This test case will verify the high availability of the |
+| | network service provided by OpenStack (neutro-server) on |
+| | control node. |
+| | |
++--------------+--------------------------------------------------------------+
+|test method | This test case kills the processes of neutron-server service |
+| | on a selected control node, then checks whether the request |
+| | of the related Openstack command is OK and the killed |
+| | processes are recovered. |
+| | |
++--------------+--------------------------------------------------------------+
+|attackers | In this test case, an attacker called "kill-process" is |
+| | needed. This attacker includes three parameters: |
+| | 1) fault_type: which is used for finding the attacker's |
+| | scripts. It should be always set to "kill-process" in this |
+| | test case. |
+| | 2) process_name: which is the process name of the specified |
+| | OpenStack service. If there are multiple processes use the |
+| | same name on the host, all of them are killed by this |
+| | attacker. |
+| | In this case. This parameter should always set to "neutron- |
+| | server". |
+| | 3) host: which is the name of a control node being attacked. |
+| | |
+| | e.g. |
+| | -fault_type: "kill-process" |
+| | -process_name: "neutron-server" |
+| | -host: node1 |
+| | |
++--------------+--------------------------------------------------------------+
+|monitors | In this test case, two kinds of monitor are needed: |
+| | 1. the "openstack-cmd" monitor constantly request a specific |
+| | Openstack command, which 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. |
+| | In this case, the command name should be neutron related |
+| | commands. |
+| | |
+| | 2. the "process" monitor check whether a process is running |
+| | on a specific node, which needs three parameters: |
+| | 1) monitor_type: which used for finding the monitor class and|
+| | related scritps. It should be always set to "process" |
+| | for this monitor. |
+| | 2) process_name: which is the process name for monitor |
+| | 3) host: which is the name of the node runing the process |
+| | |
+| | e.g. |
+| | monitor1: |
+| | -monitor_type: "openstack-cmd" |
+| | -command_name: "neutron agent-list" |
+| | monitor2: |
+| | -monitor_type: "process" |
+| | -process_name: "neutron-server" |
+| | -host: node1 |
+| | |
++--------------+--------------------------------------------------------------+
+|metrics | In this test case, there are two metrics: |
+| | 1)service_outage_time: which indicates the maximum outage |
+| | time (seconds) of the specified Openstack command request. |
+| | 2)process_recover_time: which indicates the maximun time |
+| | (seconds) from the process being killed to recovered |
+| | |
++--------------+--------------------------------------------------------------+
+|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_tc045.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 kill process script with param value specified by |
+| | "process_name" |
+| | |
+| | Result: Process will be killed. |
+| | |
++--------------+--------------------------------------------------------------+
+|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 will check the|
+| | status of the specified process on the host, and restart the |
+| | process if it is not running for next test cases |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | Fails only if SLA is not passed, or if there is a test case |
+| | execution problem. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/plugin/sample_config.yaml b/plugin/sample_config.yaml
new file mode 100644
index 000000000..39d04e3af
--- /dev/null
+++ b/plugin/sample_config.yaml
@@ -0,0 +1,12 @@
+---
+# Sample plugin configration file
+
+schema: "yardstick:plugin:0.1"
+
+plugins:
+ name: sample
+
+deployment:
+ ip: 10.1.0.50
+ user: root
+ password: root
diff --git a/samples/ping-multiple-vm.yaml b/samples/ping-multiple-vm.yaml
new file mode 100644
index 000000000..4055af14b
--- /dev/null
+++ b/samples/ping-multiple-vm.yaml
@@ -0,0 +1,42 @@
+---
+# Sample benchmark task config file measure network latency using ping
+# between mutiple virtual machines
+
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: Ping
+ options:
+ packetsize: 200
+ host: athena.demo
+ # key 'targets' for multiple targets
+ targets:
+ - ares.demo
+ - kratos.demo
+
+ runner:
+ type: Duration
+ duration: 60
+ interval: 1
+
+ sla:
+ max_rtt: 10
+ action: monitor
+
+context:
+ name: demo
+ image: cirros-0.3.3
+ flavor: m1.tiny
+ user: cirros
+
+ servers:
+ athena:
+ floating_ip: true
+ ares:
+ kratos:
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/samples/plugintest.yaml b/samples/plugintest.yaml
new file mode 100644
index 000000000..dc3b29d63
--- /dev/null
+++ b/samples/plugintest.yaml
@@ -0,0 +1,22 @@
+---
+# Sample benchmark task config file
+# Used for testing sample plugin
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: PluginTest
+ options:
+
+ nodes:
+ host1: node1.LF
+
+ runner:
+ type: Iteration
+ iterations: 1
+
+context:
+ type: Node
+ name: LF
+ file: /root/yardstick/etc/yardstick/nodes/compass_sclab_virtual/pod.yaml
diff --git a/tests/sfc/sfc_TC02.yaml b/samples/sfc.yaml
index 85e6eeb52..07c59cbc2 100644
--- a/tests/sfc/sfc_TC02.yaml
+++ b/samples/sfc.yaml
@@ -6,8 +6,8 @@ scenarios:
-
type: sfc
- host: http_client.sfc
- target: http_server.sfc
+ host: http_client.sfc_test1
+ target: http_server.sfc_test2
runner:
type: Iteration
@@ -16,21 +16,35 @@ scenarios:
contexts:
-
- name: sfc
+ name: sfc_test1
+ user: root
placement_groups:
pgrp1:
policy: "availability"
servers:
http_client:
- flavor: m1.tiny
- image: cirros-0.3.3
+ flavor: m1.small
+ image: sfc
floating_ip: true
placement: "pgrp1"
+ networks:
+ sfc-net_mgmt:
+ cidr: '11.0.0.0/24'
+
+-
+
+ name: sfc_test2
+ user: root
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+ servers:
http_server:
- flavor: sfc_custom
+ flavor: m1.small
image: sfc
floating_ip: true
placement: "pgrp1"
networks:
- net_mgmt:
+ sfc-net_mgmt:
cidr: '11.0.0.0/24'
+
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc004.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc004.yaml
new file mode 100644
index 000000000..2d10e4073
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc004.yaml
@@ -0,0 +1,85 @@
+---
+# Yardstick TC004 config file
+# Measure cache hit/miss ratio and usage, network throughput and latency.
+# Different amounts of flows are tested with, from 2 up to 1001000.
+# All tests are run 2 times each. First 2 times with the least
+# amount of ports, then 2 times with the next amount of ports,
+# and so on until all packet sizes have been run with.
+#
+# During the measurements cache hit/miss ration, cache usage statistics and
+# network latency are recorded/measured using cachestat and ping, respectively.
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: demeter.yardstick
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: poseidon.yardstick
+-
+ type: Ping
+ run_in_background: true
+
+ options:
+ packetsize: 100
+
+ host: demeter.yardstick
+ target: poseidon.yardstick
+
+ sla:
+ max_rtt: 10
+ action: monitor
+{% for num_ports in [1, 10, 50, 100, 300, 500, 750, 1000] %}
+-
+ type: Pktgen
+ options:
+ packetsize: 64
+ number_of_ports: {{num_ports}}
+ duration: 20
+
+ host: demeter.yardstick
+ target: poseidon.yardstick
+
+ runner:
+ type: Iteration
+ iterations: 2
+ interval: 1
+
+ sla:
+ max_ppm: 1000
+ action: monitor
+{% endfor %}
+
+context:
+ name: yardstick
+ image: yardstick-trusty-server
+ flavor: yardstick-flavor
+ user: ubuntu
+
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
+ servers:
+ demeter:
+ floating_ip: true
+ placement: "pgrp1"
+ poseidon:
+ floating_ip: true
+ placement: "pgrp1"
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
index b45e41ebf..6f2952f97 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
@@ -9,8 +9,8 @@ scenarios:
type: Ping
options:
packetsize: 100
- host: node1.LF
- target: node2.LF
+ host: node4.LF
+ target: node5.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml
new file mode 100644
index 000000000..d7406832d
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml
@@ -0,0 +1,87 @@
+---
+# Yardstick TC044 config file
+# Measure memory usage statistics, network throughput, latency and packet loss.
+# Different amounts of flows are tested with, from 2 up to 1001000.
+# All tests are run 2 times each. First 2 times with the least
+# amount of ports, then 2 times with the next amount of ports,
+# and so on until all packet sizes have been run with.
+#
+# During the measurements memory usage statistics and network latency are
+# recorded/measured using sar and ping, respectively.
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: MEMORYload
+ run_in_background: true
+
+ options:
+ interval: 1
+ count: 1
+
+ host: demeter.yardstick-TC044
+-
+ type: MEMORYload
+ run_in_background: true
+
+ options:
+ interval: 1
+ count: 1
+
+ host: poseidon.yardstick-TC044
+-
+ type: Ping
+ run_in_background: true
+
+ options:
+ packetsize: 100
+
+ host: demeter.yardstick-TC044
+ target: poseidon.yardstick-TC044
+
+ sla:
+ max_rtt: 10
+ action: monitor
+{% for num_ports in [1, 10, 50, 100, 300, 500, 750, 1000] %}
+-
+ type: Pktgen
+ options:
+ packetsize: 64
+ number_of_ports: {{num_ports}}
+ duration: 20
+
+ host: demeter.yardstick-TC044
+ target: poseidon.yardstick-TC044
+
+ runner:
+ type: Iteration
+ iterations: 2
+ interval: 1
+
+ sla:
+ max_ppm: 1000
+ action: monitor
+{% endfor %}
+
+context:
+ name: yardstick-TC044
+ image: yardstick-trusty-server
+ flavor: yardstick-flavor
+ user: ubuntu
+
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
+ servers:
+ demeter:
+ floating_ip: true
+ placement: "pgrp1"
+ poseidon:
+ floating_ip: true
+ placement: "pgrp1"
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
new file mode 100644
index 000000000..812d53dd8
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
@@ -0,0 +1,43 @@
+---
+# Test case for TC045 :Control node Openstack service down - neutron server
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: ServiceHA
+ options:
+ attackers:
+ - fault_type: "kill-process"
+ process_name: "neutron-server"
+ host: node1
+
+ monitors:
+ - monitor_type: "openstack-cmd"
+ command_name: "neutron agent-list"
+ monitor_time: 10
+ sla:
+ max_outage_time: 5
+ - monitor_type: "process"
+ process_name: "neutron-server"
+ host: node1
+ monitor_time: 10
+ sla:
+ max_recover_time: 5
+
+ nodes:
+ node1: node1.LF
+
+ runner:
+ type: Duration
+ duration: 1
+ sla:
+ outage_time: 5
+ action: monitor
+
+
+context:
+ type: Node
+ name: LF
+ file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+
diff --git a/tests/opnfv/test_suites/fuel_test_suite.yaml b/tests/opnfv/test_suites/fuel_test_suite.yaml
new file mode 100644
index 000000000..016bf0953
--- /dev/null
+++ b/tests/opnfv/test_suites/fuel_test_suite.yaml
@@ -0,0 +1,12 @@
+---
+# Fuel integration test task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "fuel_test_suite"
+test_cases_dir: "samples/"
+test_cases:
+-
+ file_name: ping.yaml
+-
+ file_name: iperf3.yaml
diff --git a/tests/unit/benchmark/scenarios/availability/test_basemonitor.py b/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
index 13295273b..140841075 100644
--- a/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
+++ b/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
@@ -23,6 +23,7 @@ class MonitorMgrTestCase(unittest.TestCase):
def setUp(self):
config = {
'monitor_type': 'openstack-api',
+ 'key' : 'service_status'
}
self.monitor_configs = []
@@ -36,6 +37,11 @@ class MonitorMgrTestCase(unittest.TestCase):
ret = instance.verify_SLA()
+ def test_MonitorMgr_getitem(self, mock_monitor):
+ monitorMgr = basemonitor.MonitorMgr()
+ monitorMgr.init_monitors(self.monitor_configs, None)
+ monitorIns = monitorMgr['service_status']
+
class BaseMonitorTestCase(unittest.TestCase):
class MonitorSimple(basemonitor.BaseMonitor):
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_monitor_general.py b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
new file mode 100644
index 000000000..85487a574
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
@@ -0,0 +1,73 @@
+#!/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.monitor
+# .monitor_general
+
+import mock
+import unittest
+from yardstick.benchmark.scenarios.availability.monitor import monitor_general
+
+
+@mock.patch('yardstick.benchmark.scenarios.availability.monitor.'
+ 'monitor_general.ssh')
+@mock.patch('yardstick.benchmark.scenarios.availability.monitor.'
+ 'monitor_general.open')
+class GeneralMonitorServiceTestCase(unittest.TestCase):
+ def setUp(self):
+ host = {
+ "ip": "10.20.0.5",
+ "user": "root",
+ "key_filename": "/root/.ssh/id_rsa"
+ }
+ self.context = {"node1": host}
+ self.monitor_cfg = {
+ 'monitor_type': 'general-monitor',
+ 'key': 'service_status',
+ 'host': 'node1',
+ 'monitor_time': 3,
+ 'parameter': {'serviceName': 'haproxy'},
+ 'sla': {'max_recover_time': 1}
+ }
+ self.monitor_cfg_noparam = {
+ 'monitor_type': 'general-monitor',
+ 'key': 'service_status',
+ 'host': 'node1',
+ 'monitor_time': 3,
+ 'sla': {'max_recover_time': 1}
+ }
+
+ def test__monitor_general_all_successful(self, mock_open, mock_ssh):
+ ins = monitor_general.GeneralMonitor(self.monitor_cfg, self.context)
+
+ ins.setup()
+ mock_ssh.SSH().execute.return_value = (0, "running", '')
+ ins.monitor_func()
+ ins._result = {'outage_time' : 0}
+ ins.verify_SLA()
+
+ def test__monitor_general_all_successful_noparam(self, mock_open, mock_ssh):
+ ins = monitor_general.GeneralMonitor(self.monitor_cfg_noparam, self.context)
+
+ ins.setup()
+ mock_ssh.SSH().execute.return_value = (0, "running", '')
+ ins.monitor_func()
+ ins._result = {'outage_time' : 0}
+ ins.verify_SLA()
+
+ def test__monitor_general_failure(self, mock_open, mock_ssh):
+ ins = monitor_general.GeneralMonitor(self.monitor_cfg_noparam, self.context)
+
+ ins.setup()
+ mock_ssh.SSH().execute.return_value = (1, "error", 'error')
+ ins.monitor_func()
+ ins._result = {'outage_time' : 2}
+ ins.verify_SLA()
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/tests/unit/benchmark/scenarios/compute/test_plugintest.py b/tests/unit/benchmark/scenarios/compute/test_plugintest.py
new file mode 100644
index 000000000..94f52738c
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/compute/test_plugintest.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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.compute.plugintest.PluginTest
+
+import mock
+import json
+import unittest
+import os
+
+from yardstick.benchmark.scenarios.compute import plugintest
+
+
+@mock.patch('yardstick.benchmark.scenarios.compute.plugintest.ssh')
+class PluginTestTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.ctx = {
+ 'nodes': {
+ 'host1': {
+ 'ip': '172.16.0.137',
+ 'user': 'cirros',
+ 'key_filename': "mykey.key",
+ 'password': "root"
+ },
+ }
+ }
+
+ self.result = {}
+
+ def test_sample_successful_setup(self, mock_ssh):
+ s = plugintest.PluginTest({}, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+
+ s.setup()
+ self.assertIsNotNone(s.client)
+ self.assertTrue(s.setup_done)
+
+ def test_sample_successful(self, mock_ssh):
+ s = plugintest.PluginTest({}, self.ctx)
+
+ sample_output = '{"Test Output": "Hello world!"}'
+ mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ s.run(self.result)
+ expected_result = json.loads(sample_output)
+ self.assertEqual(self.result, expected_result)
+
+ def test_sample_unsuccessful_script_error(self, mock_ssh):
+ s = plugintest.PluginTest({}, self.ctx)
+
+ mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')
+ self.assertRaises(RuntimeError, s.run, self.result)
diff --git a/tests/unit/benchmark/scenarios/networking/test_ping.py b/tests/unit/benchmark/scenarios/networking/test_ping.py
index 3a897d0f8..600974510 100644
--- a/tests/unit/benchmark/scenarios/networking/test_ping.py
+++ b/tests/unit/benchmark/scenarios/networking/test_ping.py
@@ -43,7 +43,7 @@ class PingTestCase(unittest.TestCase):
mock_ssh.SSH().execute.return_value = (0, '100', '')
p.run(result)
- self.assertEqual(result, {'rtt': 100.0})
+ self.assertEqual(result, {'rtt': {'10.229.17.105': 100.0}})
@mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh')
def test_ping_successful_sla(self, mock_ssh):
@@ -58,7 +58,7 @@ class PingTestCase(unittest.TestCase):
mock_ssh.SSH().execute.return_value = (0, '100', '')
p.run(result)
- self.assertEqual(result, {'rtt': 100.0})
+ self.assertEqual(result, {'rtt': {'10.229.17.105': 100.0}})
@mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh')
def test_ping_unsuccessful_sla(self, mock_ssh):
diff --git a/tests/unit/benchmark/scenarios/networking/test_sfc.py b/tests/unit/benchmark/scenarios/networking/test_sfc.py
index adce0824a..2d7990e59 100644
--- a/tests/unit/benchmark/scenarios/networking/test_sfc.py
+++ b/tests/unit/benchmark/scenarios/networking/test_sfc.py
@@ -26,26 +26,32 @@ class SfcTestCase(unittest.TestCase):
# Used in Sfc.setup()
context_cfg['target'] = dict()
context_cfg['target']['user'] = 'root'
- context_cfg['target']['password'] = 'octopus'
- context_cfg['target']['ip'] = None
+ context_cfg['target']['password'] = 'opnfv'
+ context_cfg['target']['ip'] = '127.0.0.1'
# Used in Sfc.run()
context_cfg['host'] = dict()
- context_cfg['host']['user'] = 'cirros'
- context_cfg['host']['password'] = 'cubslose:)'
+ context_cfg['host']['user'] = 'root'
+ context_cfg['host']['password'] = 'opnfv'
context_cfg['host']['ip'] = None
context_cfg['target'] = dict()
- context_cfg['target']['ip'] = None
+ context_cfg['target']['ip'] = '127.0.0.1'
self.sfc = sfc.Sfc(scenario_cfg=scenario_cfg, context_cfg=context_cfg)
@mock.patch('yardstick.benchmark.scenarios.networking.sfc.ssh')
- def test_run_for_success(self, mock_ssh):
+ @mock.patch('yardstick.benchmark.scenarios.networking.sfc.sfc_openstack')
+ @mock.patch('yardstick.benchmark.scenarios.networking.sfc.subprocess')
+ def test_run_for_success(self, mock_subprocess, mock_openstack, mock_ssh):
# Mock a successfull SSH in Sfc.setup() and Sfc.run()
mock_ssh.SSH().execute.return_value = (0, '100', '')
+ mock_openstack.return_value = "127.0.0.1"
+ mock_subprocess.return_value = 'mocked!'
result = {}
+ self.sfc.setup()
self.sfc.run(result)
+ self.sfc.teardown()
def main():
diff --git a/tests/unit/cmd/commands/test_plugin.py b/tests/unit/cmd/commands/test_plugin.py
new file mode 100644
index 000000000..2e823fdae
--- /dev/null
+++ b/tests/unit/cmd/commands/test_plugin.py
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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.cmd.commands.plugin
+
+import mock
+import unittest
+
+from yardstick.cmd.commands import plugin
+
+
+class Arg(object):
+ def __init__(self):
+ self.input_file = ('plugin/sample_config.yaml',)
+
+
+@mock.patch('yardstick.cmd.commands.plugin.ssh')
+class pluginCommandsTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.result = {}
+
+ def test_do_install(self, mock_ssh):
+ p = plugin.PluginCommands()
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ input_file = Arg()
+ p.do_install(input_file)
+ expected_result = {}
+ self.assertEqual(self.result, expected_result)
+
+ def test_do_remove(self, mock_ssh):
+ p = plugin.PluginCommands()
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ input_file = Arg()
+ p.do_remove(input_file)
+ expected_result = {}
+ self.assertEqual(self.result, expected_result)
+
+ def test_install_setup_run(self, mock_ssh):
+ p = plugin.PluginCommands()
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ plugins = {
+ "name": "sample"
+ }
+ deployment = {
+ "ip": "10.1.0.50",
+ "user": "root",
+ "password": "root"
+ }
+ plugin_name = plugins.get("name")
+ p._install_setup(plugin_name, deployment)
+ self.assertIsNotNone(p.client)
+
+ p._run(plugin_name)
+ expected_result = {}
+ self.assertEqual(self.result, expected_result)
+
+ def test_remove_setup_run(self, mock_ssh):
+ p = plugin.PluginCommands()
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ plugins = {
+ "name": "sample"
+ }
+ deployment = {
+ "ip": "10.1.0.50",
+ "user": "root",
+ "password": "root"
+ }
+ plugin_name = plugins.get("name")
+ p._remove_setup(plugin_name, deployment)
+ self.assertIsNotNone(p.client)
+
+ p._run(plugin_name)
+ expected_result = {}
+ self.assertEqual(self.result, expected_result)
diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py
index 80abb9df3..2cf31f6ea 100644
--- a/yardstick/benchmark/contexts/model.py
+++ b/yardstick/benchmark/contexts/model.py
@@ -206,7 +206,7 @@ class Server(Object):
template.add_floating_ip_association(
self.floating_ip_assoc["stack_name"],
self.floating_ip["stack_name"],
- server_name)
+ port_name)
template.add_server(server_name, self.image, self.flavor,
ports=port_name_list,
diff --git a/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py b/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py
index 983c3a3ac..d26c99c75 100644
--- a/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py
+++ b/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py
@@ -12,6 +12,7 @@ import multiprocessing
import time
import os
import yardstick.common.utils as utils
+import yaml
LOG = logging.getLogger(__name__)
@@ -32,9 +33,16 @@ class MonitorMgr(object):
monitor_type = monitor_cfg["monitor_type"]
monitor_cls = BaseMonitor.get_monitor_cls(monitor_type)
monitor_ins = monitor_cls(monitor_cfg, context)
-
+ if "key" in monitor_cfg:
+ monitor_ins.key = monitor_cfg["key"]
self._monitor_list.append(monitor_ins)
+ def __getitem__(self, item):
+ for obj in self._monitor_list:
+ if obj.key == item:
+ return obj
+ raise KeyError("No such monitor instance of key - %s" % item)
+
def start_monitors(self):
for _monotor_instace in self._monitor_list:
_monotor_instace.start_monitor()
@@ -52,8 +60,12 @@ class MonitorMgr(object):
class BaseMonitor(multiprocessing.Process):
"""docstring for BaseMonitor"""
+ monitor_cfgs = {}
def __init__(self, config, context):
+ if not BaseMonitor.monitor_cfgs:
+ with open(monitor_conf_path) as stream:
+ BaseMonitor.monitor_cfgs = yaml.load(stream)
multiprocessing.Process.__init__(self)
self._config = config
self._context = context
diff --git a/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py b/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py
new file mode 100644
index 000000000..515514c29
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py
@@ -0,0 +1,70 @@
+##############################################################################
+# 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
+import yardstick.ssh as ssh
+
+import basemonitor as basemonitor
+from yardstick.benchmark.scenarios.availability.util import buildshellparams
+
+
+LOG = logging.getLogger(__name__)
+
+
+class GeneralMonitor(basemonitor.BaseMonitor):
+ """docstring for MonitorApi"""
+
+ __monitor_type__ = "general-monitor"
+
+ def setup(self):
+ host = self._context[self._config["host"]]
+ ip = host.get("ip", None)
+ user = host.get("user", "root")
+ key_filename = host.get("key_filename", "~/.ssh/id_rsa")
+ self.key = self._config["key"]
+ self.monitor_type = self._config["monitor_type"]
+
+ if "parameter" in self._config:
+ parameter = self._config['parameter']
+ str = buildshellparams(parameter)
+ l = list(item for item in parameter.values())
+ self.cmd_param = str.format(*l)
+
+ self.monitor_cfg = basemonitor.BaseMonitor.monitor_cfgs.get(self.key)
+ self.monitor_script = self.get_script_fullpath(
+ self.monitor_cfg['monitor_script'])
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection.wait(timeout=600)
+ LOG.debug("ssh host success!")
+
+ def monitor_func(self):
+ if "parameter" in self._config:
+ exit_status, stdout, stderr = self.connection.execute(
+ self.cmd_param,
+ stdin=open(self.monitor_script, "r"))
+ else:
+ exit_status, stdout, stderr = self.connection.execute(
+ "/bin/bash -s ",
+ stdin=open(self.monitor_script, "r"))
+
+ if exit_status:
+ return False
+ return True
+
+ def verify_SLA(self):
+ LOG.debug("the _result:%s" % self._result)
+ outage_time = self._result.get('outage_time', None)
+ max_outage_time = self._config["sla"]["max_recover_time"]
+ if outage_time is None:
+ LOG.error("There is no outage_time in monitor result.")
+ return False
+ if outage_time > max_outage_time:
+ LOG.error("SLA failure: %f > %f" % (outage_time, max_outage_time))
+ return False
+ else:
+ return True
diff --git a/yardstick/benchmark/scenarios/availability/monitor_conf.yaml b/yardstick/benchmark/scenarios/availability/monitor_conf.yaml
new file mode 100644
index 000000000..9efceed88
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/monitor_conf.yaml
@@ -0,0 +1,11 @@
+---
+# sample config file for ha test
+#
+schema: "yardstick:task:0.1"
+
+process_status:
+ monitor_script: ha_tools/check_process_python.bash
+nova_image_list:
+ monitor_script: ha_tools/nova_image_list.bash
+service_status:
+ monitor_script: ha_tools/check_service.bash
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/compute/plugintest.py b/yardstick/benchmark/scenarios/compute/plugintest.py
new file mode 100644
index 000000000..e41fb8399
--- /dev/null
+++ b/yardstick/benchmark/scenarios/compute/plugintest.py
@@ -0,0 +1,54 @@
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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 yardstick.ssh as ssh
+from yardstick.benchmark.scenarios import base
+
+LOG = logging.getLogger(__name__)
+
+
+class PluginTest(base.Scenario):
+ """Sample scenario file for testing sample plugin"""
+ __scenario_type__ = "PluginTest"
+
+ def __init__(self, scenario_cfg, context_cfg):
+ self.scenario_cfg = scenario_cfg
+ self.context_cfg = context_cfg
+ self.setup_done = False
+
+ def setup(self):
+ """scenario setup"""
+
+ nodes = self.context_cfg['nodes']
+ node = nodes.get('host1', None)
+ host_user = node.get('user', 'ubuntu')
+ host_ip = node.get('ip', None)
+ host_pwd = node.get('password', 'root')
+ LOG.debug("user:%s, host:%s", host_user, host_ip)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
+ self.client.wait(timeout=600)
+
+ self.setup_done = True
+
+ def run(self, result):
+ """execute the benchmark"""
+
+ if not self.setup_done:
+ self.setup()
+
+ cmd = "sudo bash test.sh"
+
+ LOG.debug("Executing command: %s", cmd)
+ status, stdout, stderr = self.client.execute(cmd)
+ if status:
+ raise RuntimeError(stderr)
+
+ result.update(json.loads(stdout))
diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py
index aa1a500cf..08755a08b 100644
--- a/yardstick/benchmark/scenarios/networking/ping.py
+++ b/yardstick/benchmark/scenarios/networking/ping.py
@@ -40,12 +40,18 @@ class Ping(base.Scenario):
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
ip = host.get('ip', None)
- key_filename = host.get('key_filename', '~/.ssh/id_rsa')
- password = host.get('password', 'root')
+ key_filename = host.get('key_filename', '/root/.ssh/id_rsa')
+ 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", user, ip)
- self.connection = ssh.SSH(user, ip, key_filename=key_filename,
- password=password)
self.connection.wait()
def run(self, result):
@@ -57,29 +63,32 @@ class Ping(base.Scenario):
else:
options = ""
- destination = self.context_cfg['target'].get("ipaddr", '127.0.0.1')
+ destination = self.context_cfg['target'].get('ipaddr', '127.0.0.1')
+ dest_list = [s.strip() for s in destination.split(',')]
- LOG.debug("ping '%s' '%s'", options, destination)
+ result["rtt"] = {}
+ rtt_result = result["rtt"]
- exit_status, stdout, stderr = self.connection.execute(
- "/bin/sh -s {0} {1}".format(destination, options),
- stdin=open(self.target_script, "r"))
+ for dest in dest_list:
+ LOG.debug("ping '%s' '%s'", options, dest)
+ exit_status, stdout, stderr = self.connection.execute(
+ "/bin/sh -s {0} {1}".format(dest, options),
+ stdin=open(self.target_script, "r"))
- if exit_status != 0:
- raise RuntimeError(stderr)
+ if exit_status != 0:
+ raise RuntimeError(stderr)
- if stdout:
- result["rtt"] = float(stdout)
-
- if "sla" in self.scenario_cfg:
- sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"])
- assert result["rtt"] <= sla_max_rtt, \
- "rtt %f > sla:max_rtt(%f); " % (result["rtt"], sla_max_rtt)
- else:
- LOG.error("ping '%s' '%s' timeout", options, destination)
+ if stdout:
+ rtt_result[dest] = float(stdout)
+ if "sla" in self.scenario_cfg:
+ sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"])
+ assert rtt_result[dest] <= sla_max_rtt, "rtt %f > sla:\
+ max_rtt(%f); " % (rtt_result[dest], sla_max_rtt)
+ else:
+ LOG.error("ping '%s' '%s' timeout", options, dest)
-def _test():
+def _test(): # pragma: no cover
'''internal test function'''
key_filename = pkg_resources.resource_filename("yardstick.resources",
"files/yardstick_key")
@@ -104,5 +113,5 @@ def _test():
p.run(result)
print result
-if __name__ == '__main__':
+if __name__ == '__main__': # pragma: no cover
_test()
diff --git a/yardstick/benchmark/scenarios/networking/sfc.py b/yardstick/benchmark/scenarios/networking/sfc.py
index dc032ee5c..a126bb52a 100644
--- a/yardstick/benchmark/scenarios/networking/sfc.py
+++ b/yardstick/benchmark/scenarios/networking/sfc.py
@@ -1,14 +1,14 @@
import pkg_resources
import logging
import subprocess
-
+import sfc_openstack
import yardstick.ssh as ssh
from yardstick.benchmark.scenarios import base
LOG = logging.getLogger(__name__)
-class Sfc(base.Scenario):
+class Sfc(base.Scenario): # pragma: no cover
''' SFC scenario class '''
__scenario_type__ = "sfc"
@@ -17,8 +17,9 @@ class Sfc(base.Scenario):
TACKER_SCRIPT = 'sfc_tacker.bash'
SERVER_SCRIPT = 'sfc_server.bash'
TEARDOWN_SCRIPT = "sfc_teardown.bash"
+ TACKER_CHANGECLASSI = "sfc_change_classi.bash"
- def __init__(self, scenario_cfg, context_cfg):
+ def __init__(self, scenario_cfg, context_cfg): # pragma: no cover
self.scenario_cfg = scenario_cfg
self.context_cfg = context_cfg
self.setup_done = False
@@ -40,7 +41,7 @@ class Sfc(base.Scenario):
target = self.context_cfg['target']
target_user = target.get('user', 'root')
- target_pwd = target.get('password', 'octopus')
+ target_pwd = target.get('password', 'opnfv')
target_ip = target.get('ip', None)
''' webserver start automatically during the vm boot '''
@@ -54,40 +55,133 @@ class Sfc(base.Scenario):
status, stdout, stderr = self.server.execute(cmd_server)
LOG.debug("Output server command: %s", status)
+ ips = sfc_openstack.get_an_IP()
+
+ target = self.context_cfg['target']
+ SF1_user = target.get('user', 'root')
+ SF1_pwd = target.get('password', 'opnfv')
+ SF1_ip = ips[0]
+
+ LOG.info("user:%s, host:%s", SF1_user, SF1_ip)
+ self.server = ssh.SSH(SF1_user, SF1_ip, password=SF1_pwd)
+ self.server.wait(timeout=600)
+ cmd_SF1 = ("nohup python vxlan_tool.py -i eth0 "
+ "-d forward -v off -b 80 &")
+ LOG.debug("Starting HTTP firewall in SF1")
+ status, stdout, stderr = self.server.execute(cmd_SF1)
+ result = self.server.execute("ps lax | grep python")
+ if "vxlan_tool.py" in result[1]: # pragma: no cover
+ LOG.debug("HTTP firewall started")
+
+ SF2_user = target.get('user', 'root')
+ SF2_pwd = target.get('password', 'opnfv')
+ SF2_ip = ips[1]
+
+ LOG.info("user:%s, host:%s", SF2_user, SF2_ip)
+ self.server = ssh.SSH(SF2_user, SF2_ip, password=SF2_pwd)
+ self.server.wait(timeout=600)
+ cmd_SF2 = ("nohup python vxlan_tool.py -i eth0 "
+ "-d forward -v off -b 22 &")
+ LOG.debug("Starting SSH firewall in SF2")
+ status, stdout, stderr = self.server.execute(cmd_SF2)
+
+ result = self.server.execute("ps lax | grep python")
+ if "vxlan_tool.py" in result[1]: # pragma: no cover
+ LOG.debug("SSH firewall started")
+
self.setup_done = True
def run(self, result):
''' Creating client and server VMs to perform the test'''
host = self.context_cfg['host']
- host_user = host.get('user', 'cirros')
- host_pwd = host.get('password', 'cubswin:)')
+ host_user = host.get('user', 'root')
+ host_pwd = host.get('password', 'opnfv')
host_ip = host.get('ip', None)
LOG.info("user:%s, host:%s", host_user, host_ip)
self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
self.client.wait(timeout=600)
- if not self.setup_done:
+ if not self.setup_done: # pragma: no cover
self.setup()
target = self.context_cfg['target']
target_ip = target.get('ip', None)
- cmd_client = "curl %s", target_ip
- LOG.debug("Executing command: %s", cmd_client)
+ cmd_client = "nc -w 5 -zv " + target_ip + " 22"
+ result = self.client.execute(cmd_client)
+
+ i = 0
+ if "timed out" in result[2]: # pragma: no cover
+ LOG.info('\033[92m' + "TEST 1 [PASSED] "
+ "==> SSH BLOCKED" + '\033[0m')
+ i = i + 1
+ else: # pragma: no cover
+ LOG.debug('\033[91m' + "TEST 1 [FAILED] "
+ "==> SSH NOT BLOCKED" + '\033[0m')
+ return
+
+ cmd_client = "nc -w 5 -zv " + target_ip + " 80"
+ LOG.info("Executing command: %s", cmd_client)
+ result = self.client.execute(cmd_client)
+ if "succeeded" in result[2]: # pragma: no cover
+ LOG.info('\033[92m' + "TEST 2 [PASSED] "
+ "==> HTTP WORKS" + '\033[0m')
+ i = i + 1
+ else: # pragma: no cover
+ LOG.debug('\033[91m' + "TEST 2 [FAILED] "
+ "==> HTTP BLOCKED" + '\033[0m')
+ return
+
+ self.tacker_classi = pkg_resources.resource_filename(
+ 'yardstick.benchmark.scenarios.networking',
+ Sfc.TACKER_CHANGECLASSI)
+
+ ''' calling Tacker to change the classifier '''
+ cmd_tacker = "%s" % (self.tacker_classi)
+ subprocess.call(cmd_tacker, shell=True)
+
+ cmd_client = "nc -w 5 -zv " + target_ip + " 80"
+ LOG.info("Executing command: %s", cmd_client)
result = self.client.execute(cmd_client)
- LOG.debug("Output client command: %s", result)
+ LOG.info("Output client command: %s", result)
+ if "timed out" in result[2]: # pragma: no cover
+ LOG.info('\033[92m' + "TEST 3 [WORKS] "
+ "==> HTTP BLOCKED" + '\033[0m')
+ i = i + 1
+ else: # pragma: no cover
+ LOG.debug('\033[91m' + "TEST 3 [FAILED] "
+ "==> HTTP NOT BLOCKED" + '\033[0m')
+ return
+
+ cmd_client = "nc -zv " + target_ip + " 22"
+ result = self.client.execute(cmd_client + " \r")
+ LOG.debug(result)
+
+ if "succeeded" in result[2]: # pragma: no cover
+ LOG.info('\033[92m' + "TEST 4 [WORKS] "
+ "==> SSH WORKS" + '\033[0m')
+ i = i + 1
+ else: # pragma: no cover
+ LOG.debug('\033[91m' + "TEST 4 [FAILED] "
+ "==> SSH BLOCKED" + '\033[0m')
+ return
+
+ if i == 4: # pragma: no cover
+ for x in range(0, 5):
+ LOG.info('\033[92m' + "SFC TEST WORKED"
+ " :) \n" + '\033[0m')
def teardown(self):
''' for scenario teardown remove tacker VNFs, chains and classifiers'''
self.teardown_script = pkg_resources.resource_filename(
- "yardstick.benchmark.scenarios.sfc",
+ "yardstick.benchmark.scenarios.networking",
Sfc.TEARDOWN_SCRIPT)
subprocess.call(self.teardown_script, shell=True)
self.teardown_done = True
-'''def _test():
+'''def _test(): # pragma: no cover
internal test function
logger = logging.getLogger("Sfc Yardstick")
@@ -95,11 +189,11 @@ class Sfc(base.Scenario):
result = {}
- sfc = Sfc()
+ sfc = Sfc(scenario_cfg, context_cfg)
sfc.setup()
sfc.run(result)
print result
sfc.teardown()
-if __name__ == '__main__':
+if __name__ == '__main__': # pragma: no cover
_test()'''
diff --git a/yardstick/benchmark/scenarios/networking/sfc_change_classi.bash b/yardstick/benchmark/scenarios/networking/sfc_change_classi.bash
new file mode 100755
index 000000000..70375ab3b
--- /dev/null
+++ b/yardstick/benchmark/scenarios/networking/sfc_change_classi.bash
@@ -0,0 +1,7 @@
+tacker sfc-classifier-delete red_http
+tacker sfc-classifier-delete red_ssh
+
+tacker sfc-classifier-create --name blue_http --chain blue --match source_port=0,dest_port=80,protocol=6
+tacker sfc-classifier-create --name blue_ssh --chain blue --match source_port=0,dest_port=22,protocol=6
+
+tacker sfc-classifier-list
diff --git a/yardstick/benchmark/scenarios/networking/sfc_openstack.py b/yardstick/benchmark/scenarios/networking/sfc_openstack.py
new file mode 100644
index 000000000..2a5fbde1c
--- /dev/null
+++ b/yardstick/benchmark/scenarios/networking/sfc_openstack.py
@@ -0,0 +1,117 @@
+import os
+from novaclient.v2 import client as novaclient
+from neutronclient.v2_0 import client as neutronclient
+
+
+def get_credentials(service): # pragma: no cover
+ """Returns a creds dictionary filled with the following keys:
+ * username
+ * password/api_key (depending on the service)
+ * tenant_name/project_id (depending on the service)
+ * auth_url
+ :param service: a string indicating the name of the service
+ requesting the credentials.
+ """
+ creds = {}
+ # Unfortunately, each of the OpenStack client will request slightly
+ # different entries in their credentials dict.
+ if service.lower() in ("nova", "cinder"):
+ password = "api_key"
+ tenant = "project_id"
+ else:
+ password = "password"
+ tenant = "tenant_name"
+
+ # The most common way to pass these info to the script is to do it through
+ # environment variables.
+ creds.update({
+ "username": os.environ.get('OS_USERNAME', "admin"),
+ password: os.environ.get("OS_PASSWORD", 'admin'),
+ "auth_url": os.environ.get("OS_AUTH_URL"),
+ tenant: os.environ.get("OS_TENANT_NAME", "admin"),
+ })
+ cacert = os.environ.get("OS_CACERT")
+ if cacert is not None:
+ # each openstack client uses differnt kwargs for this
+ creds.update({"cacert": cacert,
+ "ca_cert": cacert,
+ "https_ca_cert": cacert,
+ "https_cacert": cacert,
+ "ca_file": cacert})
+ creds.update({"insecure": "True", "https_insecure": "True"})
+ if not os.path.isfile(cacert):
+ print ("WARNING: The 'OS_CACERT' environment variable is " +
+ "set to %s but the file does not exist." % cacert)
+ return creds
+
+
+def get_instances(nova_client): # pragma: no cover
+ try:
+ instances = nova_client.servers.list(search_opts={'all_tenants': 1})
+ return instances
+ except Exception, e:
+ print "Error [get_instances(nova_client)]:", e
+ return None
+
+
+def get_SFs(nova_client): # pragma: no cover
+ try:
+ instances = get_instances(nova_client)
+ SFs = []
+ for instance in instances:
+ if "sfc_test" not in instance.name:
+ SFs.append(instance)
+ return SFs
+ except Exception, e:
+ print "Error [get_SFs(nova_client)]:", e
+ return None
+
+
+def get_external_net_id(neutron_client): # pragma: no cover
+ for network in neutron_client.list_networks()['networks']:
+ if network['router:external']:
+ return network['id']
+ return False
+
+
+def create_floating_ips(neutron_client): # pragma: no cover
+ extnet_id = get_external_net_id(neutron_client)
+ ips = []
+ props = {'floating_network_id': extnet_id}
+ try:
+ while (len(ips) < 2):
+ ip_json = neutron_client.create_floatingip({'floatingip': props})
+ fip_addr = ip_json['floatingip']['floating_ip_address']
+ ips.append(fip_addr)
+ except Exception, e:
+ print "Error [create_floating_ip(neutron_client)]:", e
+ return None
+ return ips
+
+
+def floatIPtoSFs(SFs, floatips): # pragma: no cover
+ try:
+ i = 0
+ for SF in SFs:
+ SF.add_floating_ip(floatips[i])
+ i = i + 1
+ return True
+ except Exception, e:
+ print ("Error [add_floating_ip(nova_client, '%s', '%s')]:" %
+ (SF, floatips[i]), e)
+ return False
+
+
+def get_an_IP(): # pragma: no cover
+
+ creds_nova = get_credentials("nova")
+ nova_client = novaclient.Client(version='2', **creds_nova)
+ creds_neutron = get_credentials("neutron")
+ neutron_client = neutronclient.Client(**creds_neutron)
+ SFs = get_SFs(nova_client)
+ floatips = create_floating_ips(neutron_client)
+ floatIPtoSFs(SFs, floatips)
+ return floatips
+
+if __name__ == '__main__': # pragma: no cover
+ get_an_IP()
diff --git a/yardstick/benchmark/scenarios/networking/sfc_pre_setup.bash b/yardstick/benchmark/scenarios/networking/sfc_pre_setup.bash
index fcc225504..36ad16d24 100755
--- a/yardstick/benchmark/scenarios/networking/sfc_pre_setup.bash
+++ b/yardstick/benchmark/scenarios/networking/sfc_pre_setup.bash
@@ -2,8 +2,9 @@
set -e
# download and create image
-wget https://www.dropbox.com/s/focu44sh52li7fz/sfc_cloud.qcow2
-glance image-create --name sfc --disk-format qcow2 --container-format bare --file sfc_cloud.qcow2
+#wget https://www.dropbox.com/s/focu44sh52li7fz/sfc_cloud.qcow2
+glance image-create --name sfc --disk-format qcow2 --container-format bare --file SF.qcow2
+
#create flavor
-nova flavor-create --is-public true sfc_custom 666 1000 5 2
+openstack flavor create custom --ram 1500 --disk 10 --public
diff --git a/yardstick/benchmark/scenarios/networking/sfc_server.bash b/yardstick/benchmark/scenarios/networking/sfc_server.bash
index e9b34e032..41ad92188 100755
--- a/yardstick/benchmark/scenarios/networking/sfc_server.bash
+++ b/yardstick/benchmark/scenarios/networking/sfc_server.bash
@@ -1,5 +1,7 @@
#!/bin/bash
set -e
-service iptables stop
-python -m SimpleHTTPServer 80
+#service iptables stop
+python -m SimpleHTTPServer 80 > /dev/null 2>&1 &
+touch index.html
+echo "WORKED" >> index.html
diff --git a/yardstick/benchmark/scenarios/networking/sfc_tacker.bash b/yardstick/benchmark/scenarios/networking/sfc_tacker.bash
index df1b4af2b..8b53eeb7c 100755
--- a/yardstick/benchmark/scenarios/networking/sfc_tacker.bash
+++ b/yardstick/benchmark/scenarios/networking/sfc_tacker.bash
@@ -1,19 +1,31 @@
#!/bin/bash
-set -e
-BASEDIR= `pwd`
+BASEDIR=`pwd`
#import VNF descriptor
-tacker vnfd-create --vnfd-file ${BASEDIR}/test-vnfd.yaml
+tacker vnfd-create --vnfd-file ${BASEDIR}/test-vnfd1.yaml
+tacker vnfd-create --vnfd-file ${BASEDIR}/test-vnfd2.yaml
#create instances of the imported VNF
-tacker vnf-create --name testVNF1 --vnfd-name test-vnfd
-tacker vnf-create --name testVNF2 --vnfd-name test-vnfd
+tacker vnf-create --name testVNF1 --vnfd-name test-vnfd1
+tacker vnf-create --name testVNF2 --vnfd-name test-vnfd2
+
+key=true
+while $key;do
+ sleep 3
+ active=`tacker vnf-list | grep -E 'PENDING|ERROR'`
+ echo -e "checking if SFs are up: $active"
+ if [ -z "$active" ]; then
+ key=false
+ fi
+done
#create service chain
-tacker sfc-create --name chainA --chain testVNF1
-tacker sfc-create --name chainB --chain testVNF2
+tacker sfc-create --name red --chain testVNF1
+tacker sfc-create --name blue --chain testVNF2
#create classifier
-tacker sfc-classifier-create --name myclassA --chain chainA --match dest_port=80,protocol=6
-tacker sfc-classifier-create --name myclassB --chain chainB --match dest_port=22,protocol=6
+tacker sfc-classifier-create --name red_http --chain red --match source_port=0,dest_port=80,protocol=6
+tacker sfc-classifier-create --name red_ssh --chain red --match source_port=0,dest_port=22,protocol=6
+tacker sfc-list
+tacker sfc-classifier-list
diff --git a/yardstick/benchmark/scenarios/networking/sfc_teardown.bash b/yardstick/benchmark/scenarios/networking/sfc_teardown.bash
index 4a3924037..d38be09ce 100755
--- a/yardstick/benchmark/scenarios/networking/sfc_teardown.bash
+++ b/yardstick/benchmark/scenarios/networking/sfc_teardown.bash
@@ -1,17 +1,18 @@
#!/bin/bash
-set -e
+#set -e
#delete classifier
-tacker sfc-classifier-create myclassA
-tacker sfc-classifier-create myclassB
+tacker sfc-classifier-delete red_http
+tacker sfc-classifier-delete red_ssh
#delete service chain
-tacker sfc-delete chainA
-tacker sfc-delete chainB
+tacker sfc-delete red
+tacker sfc-delete blue
#delete VNFs
tacker vnf-delete testVNF1
tacker vnf-delete testVNF2
#delete VNF descriptor
-tacker vnfd-delete test-vnfd
+tacker vnfd-delete test-vnfd1
+tacker vnfd-delete test-vnfd2
diff --git a/yardstick/cmd/cli.py b/yardstick/cmd/cli.py
index a7ba04f57..dd74836cb 100644
--- a/yardstick/cmd/cli.py
+++ b/yardstick/cmd/cli.py
@@ -23,6 +23,7 @@ from yardstick.cmd.commands import task
from yardstick.cmd.commands import runner
from yardstick.cmd.commands import scenario
from yardstick.cmd.commands import testcase
+from yardstick.cmd.commands import plugin
CONF = cfg.CONF
cli_opts = [
@@ -60,7 +61,8 @@ class YardstickCLI():
'task': task.TaskCommands,
'runner': runner.RunnerCommands,
'scenario': scenario.ScenarioCommands,
- 'testcase': testcase.TestcaseCommands
+ 'testcase': testcase.TestcaseCommands,
+ 'plugin': plugin.PluginCommands
}
def __init__(self):
diff --git a/yardstick/cmd/commands/plugin.py b/yardstick/cmd/commands/plugin.py
new file mode 100644
index 000000000..e65c818fa
--- /dev/null
+++ b/yardstick/cmd/commands/plugin.py
@@ -0,0 +1,156 @@
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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
+##############################################################################
+
+""" Handler for yardstick command 'plugin' """
+
+import sys
+import yaml
+import time
+import logging
+import pkg_resources
+import yardstick.ssh as ssh
+
+from yardstick.common.utils import cliargs
+from yardstick.common.task_template import TaskTemplate
+
+LOG = logging.getLogger(__name__)
+
+
+class PluginCommands(object):
+ '''Plugin commands.
+
+ Set of commands to manage plugins.
+ '''
+
+ @cliargs("input_file", type=str, help="path to plugin configuration file",
+ nargs=1)
+ def do_install(self, args):
+ '''Install a plugin.'''
+
+ total_start_time = time.time()
+ parser = PluginParser(args.input_file[0])
+
+ plugins, deployment = parser.parse_plugin()
+ plugin_name = plugins.get("name")
+ print("Installing plugin: %s" % plugin_name)
+
+ self._install_setup(plugin_name, deployment)
+
+ self._run(plugin_name)
+
+ total_end_time = time.time()
+ LOG.info("total finished in %d secs",
+ total_end_time - total_start_time)
+
+ print("Done, exiting")
+
+ def do_remove(self, args):
+ '''Remove a plugin.'''
+
+ total_start_time = time.time()
+ parser = PluginParser(args.input_file[0])
+
+ plugins, deployment = parser.parse_plugin()
+ plugin_name = plugins.get("name")
+ print("Remove plugin: %s" % plugin_name)
+
+ self._remove_setup(plugin_name, deployment)
+
+ self._run(plugin_name)
+
+ total_end_time = time.time()
+ LOG.info("total finished in %d secs",
+ total_end_time - total_start_time)
+
+ print("Done, exiting")
+
+ def _install_setup(self, plugin_name, deployment):
+ '''Deployment environment setup'''
+ target_script = plugin_name + ".bash"
+ self.script = pkg_resources.resource_filename(
+ 'yardstick.resources', 'script/install/' + target_script)
+
+ deployment_user = deployment.get("user")
+ deployment_ip = deployment.get("ip")
+
+ deployment_password = deployment.get("password")
+ LOG.debug("user:%s, host:%s", deployment_user, deployment_ip)
+ self.client = ssh.SSH(deployment_user, deployment_ip,
+ password=deployment_password)
+ self.client.wait(timeout=600)
+
+ # copy script to host
+ cmd = "cat > ~/%s.sh" % plugin_name
+ self.client.run(cmd, stdin=open(self.script, 'rb'))
+
+ def _remove_setup(self, plugin_name, deployment):
+ '''Deployment environment setup'''
+ target_script = plugin_name + ".bash"
+ self.script = pkg_resources.resource_filename(
+ 'yardstick.resources', 'script/remove/' + target_script)
+
+ deployment_user = deployment.get("user")
+ deployment_ip = deployment.get("ip")
+
+ deployment_password = deployment.get("password")
+ LOG.debug("user:%s, host:%s", deployment_user, deployment_ip)
+ self.client = ssh.SSH(deployment_user, deployment_ip,
+ password=deployment_password)
+ self.client.wait(timeout=600)
+
+ # copy script to host
+ cmd = "cat > ~/%s.sh" % plugin_name
+ self.client.run(cmd, stdin=open(self.script, 'rb'))
+
+ def _run(self, plugin_name):
+ '''Run installation script '''
+ cmd = "sudo bash %s" % plugin_name + ".sh"
+
+ LOG.debug("Executing command: %s", cmd)
+ status, stdout, stderr = self.client.execute(cmd)
+
+
+class PluginParser(object):
+ '''Parser for plugin configration files in yaml format'''
+ def __init__(self, path):
+ self.path = path
+
+ def parse_plugin(self):
+ '''parses the plugin file and return a plugins instance
+ and a deployment instance
+ '''
+
+ print "Parsing plugin config:", self.path
+
+ try:
+ kw = {}
+ with open(self.path) as f:
+ try:
+ input_plugin = f.read()
+ rendered_plugin = TaskTemplate.render(input_plugin, **kw)
+ except Exception as e:
+ print(("Failed to render template:\n%(plugin)s\n%(err)s\n")
+ % {"plugin": input_plugin, "err": e})
+ raise e
+ print(("Input plugin is:\n%s\n") % rendered_plugin)
+
+ cfg = yaml.load(rendered_plugin)
+ except IOError as ioerror:
+ sys.exit(ioerror)
+
+ self._check_schema(cfg["schema"], "plugin")
+
+ return cfg["plugins"], cfg["deployment"]
+
+ def _check_schema(self, cfg_schema, schema_type):
+ '''Check if configration file is using the correct schema type'''
+
+ if cfg_schema != "yardstick:" + schema_type + ":0.1":
+ sys.exit("error: file %s has unknown schema %s" % (self.path,
+ cfg_schema))
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 55898e1cb..2bc5abe29 100644
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -374,6 +374,20 @@ def run_one_scenario(scenario_cfg, output_file):
context_cfg["target"]["ipaddr"] = \
context_cfg["target"]["ip"]
+ if "targets" in scenario_cfg:
+ ip_list = []
+ for target in scenario_cfg["targets"]:
+ if is_ip_addr(target):
+ ip_list.append(target)
+ context_cfg['target'] = {}
+ else:
+ context_cfg['target'] = Context.get_server(target)
+ if _is_same_heat_context(scenario_cfg["host"], target):
+ ip_list.append(context_cfg["target"]["private_ip"])
+ else:
+ ip_list.append(context_cfg["target"]["ip"])
+ context_cfg['target']['ipaddr'] = ','.join(ip_list)
+
if "nodes" in scenario_cfg:
context_cfg["nodes"] = parse_nodes_with_context(scenario_cfg)
runner = base_runner.Runner.get(runner_cfg)
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index 294eebbca..f3a191503 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -297,18 +297,18 @@ class HeatTemplate(HeatObject):
'value': {'get_attr': [name, 'ip']}
}
- def add_floating_ip_association(self, name, floating_ip_name, server_name):
+ def add_floating_ip_association(self, name, floating_ip_name, port_name):
'''add to the template a Nova FloatingIP Association resource
'''
log.debug("adding Nova::FloatingIPAssociation '%s', server '%s', "
- "floating_ip '%s'", name, server_name, floating_ip_name)
+ "floating_ip '%s'", name, port_name, floating_ip_name)
self.resources[name] = {
- 'type': 'OS::Nova::FloatingIPAssociation',
- 'depends_on': [server_name],
+ 'type': 'OS::Neutron::FloatingIPAssociation',
+ 'depends_on': [port_name],
'properties': {
- 'floating_ip': {'get_resource': floating_ip_name},
- 'server_id': {'get_resource': server_name}
+ 'floatingip_id': {'get_resource': floating_ip_name},
+ 'port_id': {'get_resource': port_name}
}
}
diff --git a/yardstick/resources/script/install/sample.bash b/yardstick/resources/script/install/sample.bash
new file mode 100644
index 000000000..21eb14680
--- /dev/null
+++ b/yardstick/resources/script/install/sample.bash
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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
+##############################################################################
+
+# Sample plugin installation script
+
+set -e
+
+cat > test.sh <<EOF
+echo "{\"Test Output\": \"Hello world!\"}"
+EOF
diff --git a/yardstick/resources/script/remove/sample.bash b/yardstick/resources/script/remove/sample.bash
new file mode 100644
index 000000000..15618df2d
--- /dev/null
+++ b/yardstick/resources/script/remove/sample.bash
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# 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
+##############################################################################
+
+# Sample plugin remove script
+
+set -e
+
+rm test.sh