From 045fa0359157b4adf833e1c7a2c84663f89611cb Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 12:17:26 +0000 Subject: [PATCH 1/6] utils/executor: fix task naming for backward compatibility The executor has got the capability to generate multiple tasks based on a single spec since this patch: 43a28826 libs/utils/executor: Allow "profile" rt-app wloads to specify a "tasks" param However, that implementation adds an additional numerical ID to all task names, event when just one has to be generated. This is overkilling, if just one task has to be generated, and it also breaks existing tests which expect the exact name specified in the wload specs. Let fix this by appending a numerical ID only for tasks which wload specs have specified a multiplicity. Moreover, let's better format the numerical ID by prefixing it with an "_". Signed-off-by: Patrick Bellasi --- libs/utils/executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/executor.py b/libs/utils/executor.py index bba847cc5..3d469c77f 100644 --- a/libs/utils/executor.py +++ b/libs/utils/executor.py @@ -451,7 +451,7 @@ class Executor(): num_tasks = task.get('tasks', 1) task_idxs = self._wload_task_idxs(wl_idx, num_tasks) for idx in task_idxs: - idx_name = str(idx) if len(task_idxs) > 0 else "" + idx_name = "_{}".format(idx) if len(task_idxs) > 1 else "" task_name_idx = conf['prefix'] + task_name + idx_name params[task_name_idx] = task_ctor(**task['params']).get() -- GitLab From cb824ffc8974200583a815e6e5cc28fb7fbc6b2b Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 12:18:43 +0000 Subject: [PATCH 2/6] utils/test: fix documentation A wload configuration can still be specified using a JSON file, let's report that in the documentation. Signed-off-by: Patrick Bellasi --- libs/utils/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/test.py b/libs/utils/test.py index 3cc338352..76673b392 100644 --- a/libs/utils/test.py +++ b/libs/utils/test.py @@ -51,7 +51,7 @@ class LisaTest(unittest.TestCase): """Override this with a dictionary or JSON path to configure the TestEnv""" experiments_conf = None - """Override this with a dictionary to configure the Executor""" + """Override this with a dictionary or JSON path to configure the Executor""" @classmethod def _init(cls, *args, **kwargs): -- GitLab From ef8ab219eff42cd7cc817f7a60fd62bbd9ec184b Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 12:23:13 +0000 Subject: [PATCH 3/6] utils/test: alias test configuration and workloads Test configuration and workloads can be specified either using inline dicts or JSON files. Moreover, they can be part of the same main dictionary or separate ones. Finally, these information are tracked by different modules. This patch adds two convenience alias which allows a test to get an easy access to the set of configurations and workloads used to run the experiments. Signed-off-by: Patrick Bellasi --- libs/utils/test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/utils/test.py b/libs/utils/test.py index 76673b392..f170247d7 100644 --- a/libs/utils/test.py +++ b/libs/utils/test.py @@ -94,6 +94,10 @@ class LisaTest(unittest.TestCase): experiments_conf = cls._getExperimentsConf(test_env) cls.executor = Executor(test_env, experiments_conf) + # Alias tests and workloads configurations + cls.wloads = cls.executor._experiments_conf["wloads"] + cls.confs = cls.executor._experiments_conf["confs"] + # Alias executor objects to make less verbose tests code cls.te = cls.executor.te cls.target = cls.executor.target -- GitLab From f813dbb1b7d13fb4f84895cb5162cd06583c1c20 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 12:27:49 +0000 Subject: [PATCH 4/6] tests/stune/smoke_test_ramp: fix executor integration A recent refactoring of the executor class has broken this test in multiple ways: tests and experiments configuration have to be provided via two mandatory attributes and the corresponding dictionaries are now tracked by different internal modules. This patch fixes this test by using the new interfaces. Signed-off-by: Patrick Bellasi --- tests/stune/smoke_test_ramp.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/stune/smoke_test_ramp.py b/tests/stune/smoke_test_ramp.py index a439c1d63..346ffcae2 100644 --- a/tests/stune/smoke_test_ramp.py +++ b/tests/stune/smoke_test_ramp.py @@ -54,6 +54,8 @@ class STune(LisaTest): """ + test_conf = TESTS_CONF + experiments_conf = TESTS_CONF @classmethod def setUpClass(cls, *args, **kwargs): @@ -62,19 +64,19 @@ class STune(LisaTest): def test_boosted_utilization_signal(self): """Tasks in stune groups are boosted""" - for tc in self.conf["confs"]: - test_id = tc["tag"] + for tc in self.confs: + conf_id = tc["tag"] - wload_idx = self.conf["wloads"].keys()[0] + wload_id = self.wloads.keys()[0] run_dir = os.path.join(self.te.res_dir, - "rtapp:{}:{}".format(test_id, wload_idx), + "rtapp:{}:{}".format(conf_id, wload_id), "1") ftrace_events = ["sched_boost_task"] ftrace = trappy.FTrace(run_dir, scope="custom", events=ftrace_events) - first_task_params = self.conf["wloads"][wload_idx]["conf"]["params"] + first_task_params = self.wloads[wload_id]["conf"]["params"] first_task_name = first_task_params.keys()[0] rta_task_name = "task_{}".format(first_task_name) -- GitLab From 77d6c58d6d75ddfa4e9deafa9eff96dfdec32961 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 12:37:16 +0000 Subject: [PATCH 5/6] tests/sfreq/smoke_test: fix executor integration A recent refactoring of the executor class has broken this test since now tests and experiments configuration have to be provided via two mandatory attributes. This patch fixes this test by using the new interface. Signed-off-by: Patrick Bellasi --- tests/sfreq/smoke_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/sfreq/smoke_test.py b/tests/sfreq/smoke_test.py index a6cc83cce..72c3729be 100644 --- a/tests/sfreq/smoke_test.py +++ b/tests/sfreq/smoke_test.py @@ -26,6 +26,9 @@ TESTS_CONF = os.path.join(TESTS_DIRECTORY, "smoke_test.config") class SFreq(LisaTest): """Tests for SchedFreq framework""" + test_conf = TESTS_CONF + experiments_conf = TESTS_CONF + @classmethod def setUpClass(cls, *args, **kwargs): super(SFreq, cls)._init(TESTS_CONF, *args, **kwargs) -- GitLab From 1355be12ed8716af2a8f8ba33cc52bc414ce4126 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 14 Feb 2017 13:53:45 +0000 Subject: [PATCH 6/6] tests/eas/rfc: fix executor integration A recent refactoring of the executor class has broken this test since now tests and experiments configuration have to be provided via two mandatory attributes. This patch fixes this test by using the new interface. Signed-off-by: Patrick Bellasi --- tests/eas/rfc.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/eas/rfc.py b/tests/eas/rfc.py index 84d99a0f7..7207a8745 100644 --- a/tests/eas/rfc.py +++ b/tests/eas/rfc.py @@ -26,16 +26,15 @@ TESTS_CONF = os.path.join(TESTS_DIRECTORY, "rfc.config") class RFC(LisaTest): """Tests for the Energy-Aware Scheduler""" + test_conf = TESTS_CONF + experiments_conf = TESTS_CONF + @classmethod def setUpClass(cls, *args, **kwargs): super(RFC, cls)._init(TESTS_CONF, args, kwargs) - def test_energy_regression(self): - """Check that there is not regression on energy""" - # TODO - - def test_performance_regression(self): - """Check that there is not regression on performance""" - # TODO + def test_run(self): + """A dummy test just to run configured workloads""" + pass # vim :set tabstop=4 shiftwidth=4 expandtab -- GitLab