aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2015-07-27 10:39:24 +0000
committerQiLiang <liangqi1@huawei.com>2015-09-06 18:22:15 +0800
commitc00f0f4fdab37db3bf084c879ac6186054726916 (patch)
tree99f914a9ba70a87c97a25c812e21b1d59ea7b64e
parent3c3917962ec72fb8ee7cb39bbf126be90c1033d3 (diff)
Support to config external network by shell env
Example invocation: $ export EXTERNAL_NETWORK=net04_ext $ yardstick task start samples/ping.yaml The default external network is "net04_ext" external_net should not be possible set in yaml anymore. JIRA: YARDSTICK-54 Change-Id: I8c7b2850801f312c6878e9a363b06cdc8ade09bf Signed-off-by: QiLiang <liangqi1@huawei.com>
-rw-r--r--samples/fio-template.yaml1
-rw-r--r--samples/fio.yaml1
-rw-r--r--samples/iperf3.yaml1
-rw-r--r--samples/lmbench.yaml1
-rw-r--r--samples/perf.yaml1
-rw-r--r--samples/ping-ext-ip.yaml1
-rw-r--r--samples/ping-ext-stimuli.yaml1
-rwxr-xr-xsamples/ping-iteration.yaml1
-rw-r--r--samples/ping-multiple-context.yaml2
-rw-r--r--samples/ping-option-list.yaml1
-rw-r--r--samples/ping-parallel.yaml1
-rw-r--r--samples/ping-serial.yaml1
-rw-r--r--samples/ping-template.yaml1
-rw-r--r--samples/ping.yaml1
-rw-r--r--samples/pktgen.yaml1
-rwxr-xr-xyardstick/cmd/commands/task.py4
16 files changed, 4 insertions, 16 deletions
diff --git a/samples/fio-template.yaml b/samples/fio-template.yaml
index 940446b56..395e4c417 100644
--- a/samples/fio-template.yaml
+++ b/samples/fio-template.yaml
@@ -36,5 +36,4 @@ context:
networks:
test:
cidr: "10.0.1.0/24"
- external_network: "net04_ext"
diff --git a/samples/fio.yaml b/samples/fio.yaml
index be8222766..44444c7cc 100644
--- a/samples/fio.yaml
+++ b/samples/fio.yaml
@@ -73,4 +73,3 @@ context:
networks:
test:
cidr: "10.0.1.0/24"
- external_network: "net04_ext"
diff --git a/samples/iperf3.yaml b/samples/iperf3.yaml
index b3a7a9f3b..8de44678c 100644
--- a/samples/iperf3.yaml
+++ b/samples/iperf3.yaml
@@ -40,5 +40,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/lmbench.yaml b/samples/lmbench.yaml
index c7526c04c..256d8c67e 100644
--- a/samples/lmbench.yaml
+++ b/samples/lmbench.yaml
@@ -41,6 +41,5 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/perf.yaml b/samples/perf.yaml
index e7ba2d0e7..b6ce2a226 100644
--- a/samples/perf.yaml
+++ b/samples/perf.yaml
@@ -40,4 +40,3 @@ context:
networks:
test:
cidr: "10.0.1.0/24"
- external_network: "net04_ext"
diff --git a/samples/ping-ext-ip.yaml b/samples/ping-ext-ip.yaml
index f2923f65f..d36c29544 100644
--- a/samples/ping-ext-ip.yaml
+++ b/samples/ping-ext-ip.yaml
@@ -32,5 +32,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-ext-stimuli.yaml b/samples/ping-ext-stimuli.yaml
index cfe791567..451f0105f 100644
--- a/samples/ping-ext-stimuli.yaml
+++ b/samples/ping-ext-stimuli.yaml
@@ -45,5 +45,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-iteration.yaml b/samples/ping-iteration.yaml
index 810530c82..a5e90941b 100755
--- a/samples/ping-iteration.yaml
+++ b/samples/ping-iteration.yaml
@@ -41,5 +41,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-multiple-context.yaml b/samples/ping-multiple-context.yaml
index c529fccb8..1c27e1bf1 100644
--- a/samples/ping-multiple-context.yaml
+++ b/samples/ping-multiple-context.yaml
@@ -36,7 +36,6 @@ contexts:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
-
name: demo2
image: cirros-0.3.3
@@ -52,5 +51,4 @@ contexts:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-option-list.yaml b/samples/ping-option-list.yaml
index 1fa95e6c2..30d133eb8 100644
--- a/samples/ping-option-list.yaml
+++ b/samples/ping-option-list.yaml
@@ -39,6 +39,5 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-parallel.yaml b/samples/ping-parallel.yaml
index f3f698993..00d261383 100644
--- a/samples/ping-parallel.yaml
+++ b/samples/ping-parallel.yaml
@@ -53,5 +53,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-serial.yaml b/samples/ping-serial.yaml
index ff281ee82..37ea715a2 100644
--- a/samples/ping-serial.yaml
+++ b/samples/ping-serial.yaml
@@ -45,5 +45,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping-template.yaml b/samples/ping-template.yaml
index 3f10218ab..cde6ddd7c 100644
--- a/samples/ping-template.yaml
+++ b/samples/ping-template.yaml
@@ -45,5 +45,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/ping.yaml b/samples/ping.yaml
index f8b6a3167..845d10dcc 100644
--- a/samples/ping.yaml
+++ b/samples/ping.yaml
@@ -41,5 +41,4 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/samples/pktgen.yaml b/samples/pktgen.yaml
index 609730842..11d62795e 100644
--- a/samples/pktgen.yaml
+++ b/samples/pktgen.yaml
@@ -47,6 +47,5 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
- external_network: "net04_ext"
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index f49a258a1..6e117edd0 100755
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -135,6 +135,10 @@ class TaskParser(object):
context_cfgs = cfg["contexts"]
for cfg_attrs in context_cfgs:
+ # config external_network based on env var
+ for _, attrs in cfg_attrs["networks"].items():
+ attrs["external_network"] = os.environ.get('EXTERNAL_NETWORK',
+ 'net04_ext')
context = Context()
context.init(cfg_attrs)