Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add IOMMU to grub to support OVS/SRIOV SA contexts"
[yardstick.git]
/
yardstick
/
benchmark
/
scenarios
/
storage
/
storagecapacity.py
diff --git
a/yardstick/benchmark/scenarios/storage/storagecapacity.py
b/yardstick/benchmark/scenarios/storage/storagecapacity.py
index
49e3a03
..
b6c403f
100644
(file)
--- a/
yardstick/benchmark/scenarios/storage/storagecapacity.py
+++ b/
yardstick/benchmark/scenarios/storage/storagecapacity.py
@@
-6,9
+6,13
@@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import pkg_resources
+from __future__ import absolute_import
+
import logging
import logging
-import json
+
+import pkg_resources
+from oslo_serialization import jsonutils
+from six.moves import range
import yardstick.ssh as ssh
from yardstick.benchmark.scenarios import base
import yardstick.ssh as ssh
from yardstick.benchmark.scenarios import base
@@
-53,17
+57,14
@@
class StorageCapacity(base.Scenario):
host = self.context_cfg['host']
if host is None:
raise RuntimeError('No right node.Please check the configuration')
host = self.context_cfg['host']
if host is None:
raise RuntimeError('No right node.Please check the configuration')
- host_user = host.get('user', 'ubuntu')
- host_ip = host.get('ip', None)
- host_pwd = host.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 = ssh.SSH.from_node(host, defaults={
+ "user": "ubuntu", "password": "root"
+ })
self.client.wait(timeout=600)
# copy script to host
self.client.wait(timeout=600)
# copy script to host
- self.client.run("cat > ~/storagecapacity.sh",
- stdin=open(self.target_script, 'rb'))
+ self.client._put_file_shell(self.target_script, '~/storagecapacity.sh')
self.setup_done = True
self.setup_done = True
@@
-107,7
+108,7
@@
class StorageCapacity(base.Scenario):
for i in range(len(device_name_arr)):
r[device_name_arr[i]] = {"min_util": min_util_arr[i],
"max_util": max_util_arr[i],
for i in range(len(device_name_arr)):
r[device_name_arr[i]] = {"min_util": min_util_arr[i],
"max_util": max_util_arr[i],
- "avg_util": avg_util_arr[i]
/
count}
+ "avg_util": avg_util_arr[i]
/
count}
return r
def run(self, result):
return r
def run(self, result):
@@
-130,4
+131,4
@@
class StorageCapacity(base.Scenario):
if status:
raise RuntimeError(stderr)
if status:
raise RuntimeError(stderr)
- result.update(json.loads(stdout))
+ result.update(json
utils
.loads(stdout))