X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Fcompute%2Fmemload.py;h=93d10c0b5e937ec7fe74f88ba770b3e4930572f7;hb=99abbb424007da2e01762f3c040a39c0157cbe1f;hp=35528d4efae5dad22e7549a2afbc566b7920dee3;hpb=f07176fddfce0e919cc791092cdd968fdf661346;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/compute/memload.py b/yardstick/benchmark/scenarios/compute/memload.py index 35528d4ef..93d10c0b5 100644 --- a/yardstick/benchmark/scenarios/compute/memload.py +++ b/yardstick/benchmark/scenarios/compute/memload.py @@ -49,14 +49,8 @@ class MEMLoad(base.Scenario): def setup(self): """Scenario setup.""" host = self.context_cfg['host'] - user = host.get('user', 'ubuntu') - ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT) - ip = host.get('ip', None) - key_filename = host.get('key_filename', '~/.ssh/id_rsa') - - LOG.info("user:%s, host:%s", user, ip) - self.client = ssh.SSH(user, ip, key_filename=key_filename, - port=ssh_port) + + self.client = ssh.SSH.from_node(host, defaults={"user": "ubuntu"}) self.client.wait(timeout=600) self.setup_done = True @@ -74,10 +68,10 @@ class MEMLoad(base.Scenario): fields = [] free = {} ite = 0 - average = {'total': 0, 'used': 0, 'free': 0, 'cached': 0, 'shared': 0, - 'buffers': 0} - maximum = {'total': 0, 'used': 0, 'free': 0, 'cached': 0, 'shared': 0, - 'buffers': 0} + average = {'total': 0, 'used': 0, 'free': 0, 'buff/cache': 0, + 'shared': 0} + maximum = {'total': 0, 'used': 0, 'free': 0, 'buff/cache': 0, + 'shared': 0} for row in result.split('\n'): line = row.split() @@ -111,7 +105,7 @@ class MEMLoad(base.Scenario): interval = options.get("interval", 1) count = options.get("count", 1) - cmd = "free -s %s -c %s" % (interval, count) + cmd = "free -c '%s' -s '%s'" % (count, interval) result = self._execute_command(cmd) filtrated_result = self._filtrate_result(result)