Add tests for subjects. 41/1641/1
authorasteroide <thomas.duval@orange.com>
Wed, 16 Sep 2015 13:55:12 +0000 (15:55 +0200)
committerasteroide <thomas.duval@orange.com>
Wed, 16 Sep 2015 13:55:12 +0000 (15:55 +0200)
Change-Id: Ic50fe0edea69d73569011005534f1bbea180635d

moonclient/moonclient/tests/tests_subjects.json [new file with mode: 0644]

diff --git a/moonclient/moonclient/tests/tests_subjects.json b/moonclient/moonclient/tests/tests_subjects.json
new file mode 100644 (file)
index 0000000..284d140
--- /dev/null
@@ -0,0 +1,208 @@
+{
+  "command_options": "-f value",
+  "tests_group": {
+    "authz": [
+      {
+        "name": "list tenant",
+        "command": "tenant list",
+        "result": "(?!alt_demo)",
+        "description": "Check if tenant alt_demo is used."
+      },
+      {
+        "name": "add tenant alt_demo",
+        "command": "tenant add alt_demo",
+        "result": "^$",
+        "description": "Add a new tenant",
+        "command_options": ""
+      },
+      {
+        "name": "check tenant alt_demo",
+        "command": "tenant list",
+        "result": "(?P<uuid>\\w+)\\s+alt_demo",
+        "description": "Check that tenant alt_demo has been correctly added"
+      },
+      {
+        "name": "create_intraextension_authz",
+        "command": "intraextension create --policy_model policy_authz authz_test",
+        "result": "IntraExtension created: (?P<uuid_authz>\\w+)",
+        "description": "Create an authz intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "list_intraextension_authz",
+        "command": "intraextension list",
+        "result": "$uuid_authz",
+        "description": "Check the existence of that authz intra extension"
+      },
+      {
+        "name": "set_tenant_authz",
+        "command": "tenant set --authz $uuid_authz alt_demo",
+        "result": "",
+        "description": "Connect the authz intra extension to the tenant alt_demo",
+        "command_options": ""
+      },
+      {
+        "name": "add_subject",
+        "command": "subject add alt_demo",
+        "result": "",
+        "description": "Connect the authz intra extension to the tenant demo",
+        "command_options": ""
+      },
+      {
+        "name": "list_subject",
+        "command": "subject list",
+        "result": "(?P<uuid_subject>\\w+)\\s+alt_demo",
+        "description": "Check that alt_demo subject was added."
+      },
+      {
+        "name": "delete_subject",
+        "command": "subject delete $uuid_subject",
+        "result": "^$",
+        "description": "Delete alt_demo subject.",
+        "command_options": ""
+      },
+      {
+        "name": "list_subject",
+        "command": "subject list",
+        "result": "(?!$uuid_subject)",
+        "description": "Check that alt_demo subject was deleted."
+      },
+      {
+        "name": "delete_authz_intra_extension",
+        "command": "intraextension delete $uuid_authz",
+        "result": "",
+        "description": "Delete the authz intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "delete_tenant",
+        "command": "tenant delete $uuid",
+        "result": "",
+        "description": "Delete the tenant alt_demo",
+        "command_options": ""
+      }
+    ],
+    "authz_and_admin": [
+      {
+        "name": "list tenant",
+        "command": "tenant list",
+        "result": "(?!alt_demo)",
+        "description": "Check if tenant alt_demo is used."
+      },
+      {
+        "name": "add tenant alt_demo",
+        "command": "tenant add alt_demo",
+        "result": "^$",
+        "description": "Add a new tenant",
+        "command_options": ""
+      },
+      {
+        "name": "check tenant alt_demo",
+        "command": "tenant list",
+        "result": "(?P<uuid>\\w+)\\s+alt_demo",
+        "description": "Check that tenant alt_demo has been correctly added"
+      },
+      {
+        "name": "create_intraextension_authz",
+        "command": "intraextension create --policy_model policy_authz authz_test",
+        "result": "IntraExtension created: (?P<uuid_authz>\\w+)",
+        "description": "Create an authz intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "list_intraextension_authz",
+        "command": "intraextension list",
+        "result": "$uuid_authz",
+        "description": "Check the existence of that authz intra extension"
+      },
+      {
+        "name": "create_intraextension_admin",
+        "command": "intraextension create --policy_model policy_admin admin_test",
+        "result": "IntraExtension created: (?P<uuid_admin>\\w+)",
+        "description": "Create an admin intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "list_intraextension_admin",
+        "command": "intraextension list",
+        "result": "$uuid_admin",
+        "description": "Check the existence of that admin intra extension"
+      },
+      {
+        "name": "set_tenant_authz",
+        "command": "tenant set --authz $uuid_authz alt_demo",
+        "result": "",
+        "description": "Connect the authz intra extension to the tenant demo",
+        "command_options": ""
+      },
+      {
+        "name": "set_tenant_admin",
+        "command": "tenant set --admin $uuid_admin alt_demo",
+        "result": "",
+        "description": "Connect the authz intra extension to the tenant alt_demo",
+        "command_options": ""
+      },
+      {
+        "name": "check tenant alt_demo and authz ie",
+        "command": "tenant list",
+        "result": "alt_demo $uuid_authz",
+        "description": "Check that authz intra extension has been correctly added to the tenant.",
+        "command_options": "-c name -c intra_authz_extension_id -f value"
+      },
+      {
+        "name": "check tenant alt_demo and admin ie",
+        "command": "tenant list",
+        "result": "$uuid_admin",
+        "description": "Check that admin intra extension has been correctly added to the tenant.",
+        "command_options": "-c intra_admin_extension_id -f value"
+      },
+      {
+        "name": "add_subject",
+        "command": "subject add alt_demo",
+        "result": "",
+        "description": "Connect the authz intra extension to the tenant alt_demo",
+        "command_options": ""
+      },
+      {
+        "name": "list_subject",
+        "command": "subject list",
+        "result": "(?P<uuid_subject>\\w+)\\s+alt_demo",
+        "description": "Check that alt_demo subject was added."
+      },
+      {
+        "name": "delete_subject",
+        "command": "subject delete $uuid_subject",
+        "result": "^$",
+        "description": "Delete alt_demo subject.",
+        "command_options": ""
+      },
+      {
+        "name": "list_subject",
+        "command": "subject list",
+        "result": "(?!$uuid_subject)",
+        "description": "Check that alt_demo subject was deleted."
+      },
+      {
+        "name": "delete_admin_intra_extension",
+        "command": "intraextension delete $uuid_admin",
+        "result": "",
+        "description": "Delete the admin intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "delete_authz_intra_extension",
+        "command": "intraextension delete $uuid_authz",
+        "result": "",
+        "description": "Delete the authz intra extension",
+        "command_options": ""
+      },
+      {
+        "name": "delete_tenant",
+        "command": "tenant delete $uuid",
+        "result": "",
+        "description": "Delete the tenant alt_demo",
+        "command_options": ""
+      }
+    ]
+  }
+}
\ No newline at end of file