__scenario_type__ = "QemuMigrate"
TARGET_SCRIPT = "qemu_migrate_benchmark.bash"
- WORKSPACE = "/root/workspace"
+ WORKSPACE = "/root/workspace/"
REBOOT_CMD_PATTERN = r";\s*reboot\b"
def __init__(self, scenario_cfg, context_cfg):
def _put_files(self, client):
setup_options = self.scenario_cfg["setup_options"]
+ rpm_dir = setup_options["rpm_dir"]
script_dir = setup_options["script_dir"]
+ image_dir = setup_options["image_dir"]
+ LOG.debug("Send RPMs from %s to workspace %s",
+ rpm_dir, self.WORKSPACE)
+ client.put(rpm_dir, self.WORKSPACE, recursive=True)
LOG.debug("Send scripts from %s to workspace %s",
script_dir, self.WORKSPACE)
client.put(script_dir, self.WORKSPACE, recursive=True)
+ LOG.debug("Send guest image from %s to workspace %s",
+ image_dir, self.WORKSPACE)
+ client.put(image_dir, self.WORKSPACE, recursive=True)
def _run_setup_cmd(self, client, cmd):
LOG.debug("Run cmd: %s", cmd)
- status, stdout, stderr = client.execute(cmd)
+ status, _, stderr = client.execute(cmd)
if status:
if re.search(self.REBOOT_CMD_PATTERN, cmd):
LOG.debug("Error on reboot")
self.target_script = pkg_resources.resource_filename(
"yardstick.benchmark.scenarios.compute",
QemuMigrate.TARGET_SCRIPT)
- self.host.put_file(self.target_script, "~/qemu_migrate_benchmark.sh")
+ self.host._put_file_shell(
+ self.target_script, "~/qemu_migrate_benchmark.sh")
self.setup_done = True
cmd_args = " %s %s %s %s %s %s" %\
(smp, qmp_sock_src, qmp_sock_dst, incoming_ip,
migrate_to_port, max_down_time)
- cmd = "bash migrate_benchmark.sh %s" % (cmd_args)
+ cmd = "bash qemu_migrate_benchmark.sh %s" % (cmd_args)
LOG.debug("Executing command: %s", cmd)
status, stdout, stderr = self.host.execute(cmd)
if status:
if timevalue > sla_time:
sla_error += "%s timevalue %d > sla:max_%s(%d); " % \
(t, timevalue, t, sla_time)
- assert sla_error == "", sla_error
+ self.verify_SLA(sla_error == "", sla_error)
def _test(): # pragma: no cover
"qmp_sock_dst": "/tmp/qmp-sock-dst",
"max_down_time": 0.10
}
+ sla = {
+ "max_totaltime": 10,
+ "max_downtime": 0.10,
+ "max_setuptime": 0.50,
+ }
args = {
- "options": options
+ "options": options,
+ "sla": sla
}
result = {}
+
migrate = QemuMigrate(args, ctx)
migrate.run(result)
print(result)