aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios')
-rwxr-xr-xyardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash2
-rw-r--r--yardstick/benchmark/scenarios/base.py14
-rw-r--r--yardstick/benchmark/scenarios/compute/qemu_migrate.py4
-rw-r--r--yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash20
4 files changed, 26 insertions, 14 deletions
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
index eec86e133..d34ce9338 100755
--- a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
@@ -26,7 +26,7 @@ elif [ "$process_name" = "haproxy" ]; then
kill -9 "${pid}"
done
else
- for pid in $(pgrep -f "/usr/.*/${process_name}");
+ for pid in $(pgrep -fa [^-_a-zA-Z0-9]${process_name} | grep -iv heartbeat | awk '{print $1}');
do
kill -9 "${pid}"
done
diff --git a/yardstick/benchmark/scenarios/base.py b/yardstick/benchmark/scenarios/base.py
index 3cb138dd8..7af85834c 100644
--- a/yardstick/benchmark/scenarios/base.py
+++ b/yardstick/benchmark/scenarios/base.py
@@ -64,6 +64,20 @@ class Scenario(object):
raise RuntimeError("No such scenario type %s" % scenario_type)
+ @classmethod
+ def get_scenario_type(cls):
+ """Return a string with the scenario type, if defined"""
+ return str(getattr(cls, '__scenario_type__', None))
+
+ @classmethod
+ def get_description(cls):
+ """Return a single line string with the class description
+
+ This function will retrieve the class docstring and return the first
+ line, or 'None' if it's empty.
+ """
+ return cls.__doc__.splitlines()[0] if cls.__doc__ else str(None)
+
def _push_to_outputs(self, keys, values):
return dict(zip(keys, values))
diff --git a/yardstick/benchmark/scenarios/compute/qemu_migrate.py b/yardstick/benchmark/scenarios/compute/qemu_migrate.py
index 286d8cdaf..2de1270ef 100644
--- a/yardstick/benchmark/scenarios/compute/qemu_migrate.py
+++ b/yardstick/benchmark/scenarios/compute/qemu_migrate.py
@@ -113,11 +113,11 @@ class QemuMigrate(base.Scenario):
if status:
raise RuntimeError(stderr)
- parsed_data = jsonutils.loads(stdout)
+ result.update(jsonutils.loads(stdout))
if "sla" in self.scenario_cfg:
sla_error = ""
- for t, timevalue in parsed_data.items():
+ for t, timevalue in result.items():
if 'max_%s' % t not in self.scenario_cfg['sla']:
continue
diff --git a/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash b/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash
index 757553e8b..d95e91425 100644
--- a/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash
+++ b/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash
@@ -21,13 +21,6 @@ max_down_time=$6
OUTPUT_FILE=/tmp/output-qemu.log
-echo "To check the parameters:"
-echo "SRC: $src"
-echo "DST: $dst"
-echo "DST_IP: $dst_ip"
-echo "MIGRATE_PORT: $migrate_to_port"
-echo "DOWN_TIME: $max_down_time"
-
do_migrate()
{
echo "Execution of Live Migration"
@@ -49,7 +42,8 @@ do_migrate()
done
echo "End of Live Migration"
-}
+
+} > /dev/null
output_qemu()
{
@@ -74,14 +68,18 @@ echo -e "{ \
\"setuptime\":\"$setuptime\" \
}"
}
+
# main entry
main()
{
- echo "Perform LiveMigration"
+ # Perform LiveMigration
do_migrate
- echo "LiveMigration Status"
+
+ # LiveMigration Status
output_qemu
- echo "LiveMigration JSON output "
+
+ # LiveMigration JSON output
output_json
}
+
main