Skip to content
Snippets Groups Projects
Commit 220b586e authored by jgatt's avatar jgatt
Browse files

Merge branch 'multibehavior' of gitlab.irit.fr:sepia-pub/mael/batmen into multibehavior

# Conflicts:
#	test/test_multi_behavior.py
parents e166eb22 43dd4b7c
No related branches found
No related tags found
1 merge request!16Merge request multibehavior
Pipeline #5832 passed
...@@ -4,13 +4,12 @@ import json ...@@ -4,13 +4,12 @@ import json
Workload = namedtuple('Workload', ['name', 'filename']) Workload = namedtuple('Workload', ['name', 'filename'])
Platform = namedtuple('Platform', ['name', 'filename']) Platform = namedtuple('Platform', ['name', 'filename'])
two_machine_platform = Platform(name='two_machine_platform', filename='test/platforms/multicore/2machines.xml') two_machine_platform = Platform(name='two_machine_platform', filename='test/platforms/multicore/2machines.xml')
def make_monolithic_file(user_name, input_json, probability_name, seed=None, red_windows=None, yellow_windows=None): def make_monolithic_file(user_name, input_json, probability_name, seed=None, red_windows=None, yellow_windows=None):
""" create a user_description where every user with names in user_name and workload in input_json do only the behavior """Utility function to create a user_description file with the given user_names, input_jsons, probability_name etc."""
given in probability_name with the provided seed and red_windows and yellow_windows """
assert len(user_name) == len(input_json), "The three lists should be of the same size" assert len(user_name) == len(input_json), "The three lists should be of the same size"
schedconf_file = 'test-instances/user_description_file.json' schedconf_file = 'test-instances/user_description_file.json'
error_file = { error_file = {
...@@ -35,9 +34,8 @@ def make_monolithic_file(user_name, input_json, probability_name, seed=None, red ...@@ -35,9 +34,8 @@ def make_monolithic_file(user_name, input_json, probability_name, seed=None, red
with open(schedconf_file, 'w+') as error_description_file: with open(schedconf_file, 'w+') as error_description_file:
json.dump(error_file, error_description_file) json.dump(error_file, error_description_file)
def monolithics_test(proba_names,names,input_json,seed=None,red_windows=None,yellow_windows=None) :
def monolithics_test(proba_names, names, input_json, seed=None, red_windows=None, yellow_windows=None): """Utility function to launch the test with given parameters and compare the output to their dm_user_replay class equivalent"""
""" test a monolithic behavior on red_windows or yellow_windows and compare to their user_replay class equivalent"""
schedconf_file = 'test-instances/user_description_file.json' schedconf_file = 'test-instances/user_description_file.json'
for proba_name in proba_names: for proba_name in proba_names:
behavior_name = proba_name.split("_")[-1] behavior_name = proba_name.split("_")[-1]
...@@ -54,7 +52,6 @@ def monolithics_test(proba_names, names, input_json, seed=None, red_windows=None ...@@ -54,7 +52,6 @@ def monolithics_test(proba_names, names, input_json, seed=None, red_windows=None
expected_log = open(f"test/expected_log/replay_user_rigid-2machines_jobs.csv").readlines() expected_log = open(f"test/expected_log/replay_user_rigid-2machines_jobs.csv").readlines()
assert content_job == expected_log assert content_job == expected_log
def test_dm_user_multi_behavior(platform_multiC): def test_dm_user_multi_behavior(platform_multiC):
""" test dm_user_multi_behavior class and check that writing [200000,300000] as an unique interval """ test dm_user_multi_behavior class and check that writing [200000,300000] as an unique interval
or a sorted list of disjoint interval has the same effect. Allowing us to check that the windows union operation is or a sorted list of disjoint interval has the same effect. Allowing us to check that the windows union operation is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment