From 00bfa61e3a3cd0fef6038ba297b92f6bc3f6b6c7 Mon Sep 17 00:00:00 2001 From: asteroide Date: Wed, 26 Jul 2017 08:55:58 +0200 Subject: Delete test data from repository. Change-Id: Ie3da4f813a50df34b64e2d2a7d26e737720c98a6 --- moonv4/tests/12_tenant_scalability/exec.sh | 44 ----------- .../scenario/10/rbac_10_tenant_01.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_02.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_03.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_04.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_05.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_06.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_07.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_08.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_09.py | 89 ---------------------- .../scenario/10/rbac_10_tenant_10.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_01.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_02.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_03.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_04.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_05.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_06.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_07.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_08.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_09.py | 89 ---------------------- .../scenario/100/rbac_100_tenant_10.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_01.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_02.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_03.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_04.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_05.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_06.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_07.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_08.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_09.py | 89 ---------------------- .../scenario/50/rbac_50_tenant_10.py | 89 ---------------------- 31 files changed, 2714 deletions(-) delete mode 100644 moonv4/tests/12_tenant_scalability/exec.sh delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_01.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_02.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_03.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_04.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_05.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_06.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_07.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_08.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_09.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_10.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_01.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_02.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_03.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_04.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_05.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_06.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_07.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_08.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_09.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_10.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_01.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_02.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_03.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_04.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_05.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_06.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_07.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_08.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_09.py delete mode 100644 moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_10.py (limited to 'moonv4/tests/12_tenant_scalability') diff --git a/moonv4/tests/12_tenant_scalability/exec.sh b/moonv4/tests/12_tenant_scalability/exec.sh deleted file mode 100644 index 4f907625..00000000 --- a/moonv4/tests/12_tenant_scalability/exec.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -HOST=varuna -PORT=38001 - -TEST_SCRIPT="${MOON_HOME}/moon_interface/tests/apitests/set_authz.py" -POPULATE_SCRIPT=${MOON_HOME}/moon_interface/tests/apitests/populate_default_values.py - -if [ -n "$HOST" ]; then - RESULT_DIR=${MOON_HOME}/tests/12_tenant_scalability/${HOST}/50 - ARGS="--host=${HOST} --host-authz=${HOST} --limit=100 -t"; -else - RESULT_DIR=${MOON_HOME}/tests/12_tenant_scalability/localhost/50 - ARGS="--limit=100 --host-authz=localhost -t"; -fi -CPT="01 02 03 04 05 06 07 08 09 10" - -mkdir -p ${RESULT_DIR} 2>/dev/null -mv ${RESULT_DIR}/docker_stats.rst ${RESULT_DIR}/docker_stats.rst.bak 2>/dev/null - -for SC_INDEX in 01 02 03 04 05 06 07 08 09 10; -#for SC_INDEX in 01; -do - SC=scenario/50/rbac_50_tenant_${SC_INDEX}.py - let PORT++ - echo "Testing ${SC} on port ${PORT}" - FILE=${SC##*/} - FILE=${FILE%.py} - echo "Testing ${FILE}" >> ${RESULT_DIR}/docker_stats.rst - echo "===========================" >> ${RESULT_DIR}/docker_stats.rst - echo "" >> ${RESULT_DIR}/docker_stats.rst - python3 ${POPULATE_SCRIPT} ${SC} - for cpt in ${CPT}; - do - python3 ${TEST_SCRIPT} ${ARGS} --port-authz=${PORT} --pdp pdp${SC_INDEX} --request-per-second ${cpt} --write="${RESULT_DIR}/data_${FILE}_$cpt.json" ${SC} - done - if [ -n "$HOST" ]; then - ssh varuna docker stats --no-stream --format \"table {{.Name}},{{.CPUPerc}},{{.MemUsage}},{{.PIDs}}\" >> ${RESULT_DIR}/docker_stats.rst; - else - docker stats --no-stream --format "table {{.Name}},{{.CPUPerc}},{{.MemUsage}},{{.PIDs}}" >> ${RESULT_DIR}/docker_stats.rst; - fi - echo "" >> ${RESULT_DIR}/docker_stats.rst -done - diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_01.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_01.py deleted file mode 100644 index b591b532..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_01.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp01" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_02.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_02.py deleted file mode 100644 index 4ca48d25..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_02.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp02" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_03.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_03.py deleted file mode 100644 index eb424e79..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_03.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp03" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_04.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_04.py deleted file mode 100644 index 5fb860f5..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_04.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp04" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_05.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_05.py deleted file mode 100644 index 09947491..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_05.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp05" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_06.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_06.py deleted file mode 100644 index a3f66c4f..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_06.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp06" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_07.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_07.py deleted file mode 100644 index 14d75d57..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_07.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp07" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_08.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_08.py deleted file mode 100644 index a658bb0c..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_08.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp08" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_09.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_09.py deleted file mode 100644 index 96c3f61a..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_09.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp09" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_10.py b/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_10.py deleted file mode 100644 index bebdee23..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/10/rbac_10_tenant_10.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp10" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 10 -OBJECT_NUMBER = 10 -ROLE_NUMBER = 5 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_01.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_01.py deleted file mode 100644 index 4282d4d0..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_01.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp01" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_02.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_02.py deleted file mode 100644 index e110dd5c..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_02.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp02" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_03.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_03.py deleted file mode 100644 index dc2195e1..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_03.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp03" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_04.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_04.py deleted file mode 100644 index 6e3e86ce..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_04.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp04" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_05.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_05.py deleted file mode 100644 index 266e3bc0..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_05.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp05" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_06.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_06.py deleted file mode 100644 index b1227932..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_06.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp06" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_07.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_07.py deleted file mode 100644 index 794331b6..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_07.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp07" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_08.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_08.py deleted file mode 100644 index 5eab408c..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_08.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp08" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_09.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_09.py deleted file mode 100644 index 2721c092..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_09.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp09" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_10.py b/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_10.py deleted file mode 100644 index bcad20f7..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/100/rbac_100_tenant_10.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp10" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 100 -OBJECT_NUMBER = 100 -ROLE_NUMBER = 20 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_01.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_01.py deleted file mode 100644 index 9917a970..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_01.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp01" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_02.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_02.py deleted file mode 100644 index 9b040abd..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_02.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp02" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_03.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_03.py deleted file mode 100644 index 4d15a6ee..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_03.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp03" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_04.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_04.py deleted file mode 100644 index b5fba2f0..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_04.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp04" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_05.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_05.py deleted file mode 100644 index f0f21cfe..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_05.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp05" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_06.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_06.py deleted file mode 100644 index 7ab5ecc0..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_06.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp06" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_07.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_07.py deleted file mode 100644 index 53dcb5fc..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_07.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp07" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_08.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_08.py deleted file mode 100644 index 4d70e179..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_08.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp08" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_09.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_09.py deleted file mode 100644 index 5ece9e9d..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_09.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp09" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) diff --git a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_10.py b/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_10.py deleted file mode 100644 index 9914e565..00000000 --- a/moonv4/tests/12_tenant_scalability/scenario/50/rbac_50_tenant_10.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp10" -policy_name = "RBAC policy example" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 50 -OBJECT_NUMBER = 50 -ROLE_NUMBER = 10 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) -- cgit 1.2.3-korg