diff options
author | asteroide <thomas.duval@orange.com> | 2017-07-06 15:35:12 +0200 |
---|---|---|
committer | asteroide <thomas.duval@orange.com> | 2017-07-06 15:35:12 +0200 |
commit | 19dd4e461d1239754bd1a82e30f2a770c99a7f90 (patch) | |
tree | 28c57a5802c805dbbe10e760dff159e499fc9622 /moonv4/tests/11_user_scalability/scenario/session_100.py | |
parent | 53a64609bd5b3f02a3bdf7d85030db8f2028cada (diff) |
Add test files for the evaluation
Change-Id: Ieceeef68ce701b913aaccd900218fbee896f48df
Diffstat (limited to 'moonv4/tests/11_user_scalability/scenario/session_100.py')
-rw-r--r-- | moonv4/tests/11_user_scalability/scenario/session_100.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/moonv4/tests/11_user_scalability/scenario/session_100.py b/moonv4/tests/11_user_scalability/scenario/session_100.py new file mode 100644 index 00000000..fa4e29d5 --- /dev/null +++ b/moonv4/tests/11_user_scalability/scenario/session_100.py @@ -0,0 +1,69 @@ +import random + +pdp_name = "pdp1" +policy_name = "Session policy example" +model_name = "Session" +policy_genre = "session" + +SUBJECT_NUMBER = 100 +OBJECT_NUMBER = 100 +ROLE_NUMBER = 50 + +subjects = {} +for _id in range(SUBJECT_NUMBER): + subjects["user{}".format(_id)] = "" +objects = {"admin": "", } +for _id in range(ROLE_NUMBER): + objects["role{}".format(_id)] = "" +actions = {"activate": "", "deactivate": ""} + +subject_categories = {"subjectid": "", } +object_categories = {"role": "", } +action_categories = {"session-action": "", } + +subject_data = {"subjectid": {}} +for _id in range(SUBJECT_NUMBER): + subject_data["subjectid"]["user{}".format(_id)] = "" + +object_data = {"role": { + "admin": "", + "*": "" +}} +for _id in range(ROLE_NUMBER): + object_data["role"]["role{}".format(_id)] = "" +action_data = {"session-action": {"activate": "", "deactivate": "", "*": ""}} + +subject_assignments = {} +for _id in range(SUBJECT_NUMBER): + subject_assignments["user{}".format(_id)] = ({"subjectid": "user{}".format(_id)}, ) +object_assignments = {"admin": ({"role": "admin"}, {"role": "*"})} +for _id in range(ROLE_NUMBER): + _role = "role{}".format(_id) + object_assignments[_role] = ({"role": _role}, {"role": "*"}) +action_assignments = {"activate": ({"session-action": "activate"}, {"session-action": "*"}, ), + "deactivate": ({"session-action": "deactivate"}, {"session-action": "*"}, ) + } + +meta_rule = { + "session": {"id": "", "value": ("subjectid", "role", "session-action")}, +} + +rules = { + "session": [] +} + +for _id in range(SUBJECT_NUMBER): + _subject = "user{}".format(_id) + _object = "role{}".format(random.choice(range(ROLE_NUMBER))) + rules["session"].append({ + "rule": (_subject, _object, "*"), + "instructions": ( + { + "update": { + "operation": "add", + "target": "rbac:role:admin" # add the role admin to the current user + } + }, + {"chain": {"name": "rbac"}} # chain with the meta_rule named rbac + ) + }) |