aboutsummaryrefslogtreecommitdiffstats
path: root/moon_manager/tests/func_tests/features/model.feature
blob: 1f6399ab9c48921c55c4bd68fa8ac05fdff78361 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Feature: Model

  Background:
    Given the system has no rules
    And the system has no subject assignments
    And the system has no action assignments
    And the system has no object assignments
    And the system has no subject data
    And the system has no action data
    And the system has no object data
    And the system has no subject perimeter
    And the system has no object perimeter
    And the system has no action perimeter
    And the system has no pdps
    And the system has no policies
    And the system has no models
    And the system has no meta-rules
    And the system has no subject categories
    And the system has no action categories
    And the system has no object categories
    And the following meta data subject category exists
      | subjectmetadataname  | subjectmetadatadescription                                     |
      | Affiliation:         | This meta data has the categorical information about a subject |
      | Authorization-Level: | This meta data has the categorical information about an object |
      | Degree:              | This meta data has the categorical information about an object |
    And the following meta data object category exists
      | objectmetadataname | objectmetadatadescription                                      |
      | Clearance:         | This meta data has the categorical information about an object |
      | Type:              | This meta data has the categorical information about an object |
      | Class:             | This meta data has the categorical information about an object |
    And the following meta data action category exists
      | actionmetadataname | actionmetadatadescription                                      |
      | Action-Class:      | This meta data has the categorical information about an action |
      | Action-Priority:   | This meta data has the categorical information about an action |
      | Recommendation:    | This meta data has the categorical information about an action |
    And the following meta rule exists
      | metarulename | metaruledescription      | subjectmetadata                   | actionmetadata                 | objectmetadata   |
      | metarule1    | This is a basic metarule | Affiliation:                      | Action-Class:                  | Clearance:       |
      | metarule2    | This is a basic metarule | Authorization-Level:              | Action-Class:                  | Clearance:       |
      | metarule3    | This is a basic metarule | Affiliation:                      | Action-Priority:               | Clearance:       |
      | metarule4    | This is a basic metarule | Authorization-Level:              | Action-Priority:               | Clearance:       |
      | metarule5    | This is a basic metarule | Affiliation:                      | Action-Class:                  | Type:            |
      | metarule6    | This is a basic metarule | Authorization-Level:              | Action-Class:                  | Type:            |
      | metarule7    | This is a basic metarule | Affiliation:                      | Action-Priority:               | Type:            |
      | metarule8    | This is a basic metarule | Affiliation:,Authorization-Level: | Action-Class:,Action-Priority: | Clearance:,Type: |
      | metarule9    | This is a basic metarule |                                   | Action-Class:,Action-Priority: | Clearance:,Type: |
      | metarule10   | This is a basic metarule | Affiliation:,Authorization-Level: |                                | Clearance:,Type: |
      | metarule11   | This is a basic metarule | Affiliation:,Authorization-Level: | Action-Class:,Action-Priority: |                  |


  Scenario: Add model
    When the user sets to add the following model
      | modelname | modeldescription  | metarule                      |
      | A-model   | Thisisabasicmodel | metarule1,metarule2,metarule6 |
      | B-model   | Thisisabasicmodel | metarule3,metarule4,metarule5 |
    Then the following model should be existed in the system
      | modelname | modeldescription  | metarule                      |
      | A-model   | Thisisabasicmodel | metarule1,metarule2,metarule6 |
      | B-model   | Thisisabasicmodel | metarule3,metarule4,metarule5 |

  Scenario Outline: Add model validations
    When the user sets to add the following model
      | modelname   | modeldescription   | metarule   |
      | <modelname> | <modeldescription> | <metarule> |
    Then the system should reply the following
      | flag   |
      | <flag> |
    Examples:
      | modelname    | modeldescription                             | metarule                                                                | flag  |
      |              | This model is for creating policy prototype  | metarule8,metarule3                                                     | False |
      | generalmodel |                                              | metarule8                                                               | True  |
      | 1            | This model is for creating policy prototype% | metarule8                                                               | True  |
      | _%model%_    | This model is for creating policy prototype1 | metarule8                                                               | True  |
      | generalmodel | This model is for creating policy prototype  |                                                                         | True  |
      | generalmodel | This model is for creating policy prototype  | metarule9                                                               | True  |
      | generalmodel | This model is for creating policy prototype  | metarule10                                                              | True  |
      | generalmodel | This model is for creating policy prototype  | metarule11                                                              | True  |
      | generalmodel | This model is for creating policy prototype  | metarule20                                                              | False |
      | generalmodel | This model is for creating policy prototype  | metarule3,,metarule20                                                   | False |
      | generalmodel | This model is for creating policy prototype  | 000000000000000000000                                                   | False |
      | generalmodel | This model is for creating policy prototype  | 0000000000000000000000000000000000000000000000000000000000000000000     | False |
      | generalmodel | This model is for creating policy prototype  | 00000000000000000000000000000000000000000000000000000000000000000000000 | False |
      | generalmodel | This model is for creating policy prototype  | metarule8,metarule10                                                    | True  |

Scenario Outline: Add an existing model
    Given the following model exists
      | modelname    | modeldescription      | metarule                      |
      | generalmodel | This is a basic model | metarule1,metarule2,metarule6 |
    When the user sets to add the following model
      | modelname   | modeldescription   | metarule   |
      | <modelname> | <modeldescription> | <metarule> |
    Then the system should reply the following
      | flag   |
      | <flag> |
    Examples:
      | modelname     | modeldescription  | metarule                      | flag  |
      | generalmodel  | Thisisabasicmodel | metarule1,metarule3,metarule5 | False |
      | generalmodel1 | Thisisabasicmodel | metarule1,metarule2,metarule6 | False |

  Scenario: Update model
    Given the following model exists
      | modelname    | modeldescription  | metarule                      |
      | generalmodel | Thisisabasicmodel | metarule1,metarule2,metarule6 |
    When the user sets to update the following model
      | modelname    | updatedmodelname | updatedmodeldescription                     | updatedmetarule               |
      | generalmodel | 1-M-%            | This model is for creating policy prototype | metarule3,metarule5,metarule7 |
    Then the following model should be existed in the system
      | modelname | modeldescription                            | metarule                      |
      | 1-M-%     | This model is for creating policy prototype | metarule3,metarule5,metarule7 |

  Scenario Outline: Update model validations
    Given the following model exists
      | modelname    | modeldescription                            | metarule                      |
      | generalmodel | This model is for creating policy prototype | metarule1,metarule2,metarule6 |
    When the user sets to update the following model
      | modelname   | updatedmodelname   | updatedmodeldescription   | updatedmetarule   |
      | <modelname> | <updatedmodelname> | <updatedmodeldescription> | <updatedmetarule> |
    Then the system should reply the following
      | flag   |
      | <flag> |
    Examples:
      | modelname    | updatedmodelname | updatedmodeldescription                      | updatedmetarule                                                         | flag  |
      | generalmodel |                  | This model is for creating policy prototype  | metarule8,metarule3                                                     | False |
      | generalmodel | generalmodel     |                                              | metarule8                                                               | True  |
      | generalmodel | 1                | This model is for creating policy prototype% | metarule8                                                               | True  |
      | generalmodel | _%model%_        | This model is for creating policy prototype1 | metarule8                                                               | True  |
      | generalmodel | generalmodel     | This model is for creating policy prototype  |                                                                         | True  |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | metarule9                                                               | True  |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | metarule10                                                              | True  |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | metarule11                                                              | True  |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | metarule3,                                                              | False |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | 0000000000000000000000000000000000000000000000000000000000000000000     | False |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | 00000000000000000000000000000000000000000000000000000000000000000000000 | False |
      | generalmodel | generalmodel     | This model is for creating policy prototype  | metarule8,metarule10                                                    | True  |

  Scenario: Delete a model
    Given the following model exists
      | modelname    | modeldescription                            | metarule  |
      | generalmodel | This model is for creating policy prototype | metarule1 |
    When the user sets to delete the following model
      | modelname    |
      | generalmodel |
    Then the following model should be existed in the system
      | modelname | modeldescription | metarule |
      |           |                  |          |

  Scenario: Delete a model that has a recorded policy dependency
    Given the following model exists
      | modelname    | modeldescription                            | metarule  |
      | generalmodel | This model is for creating policy prototype | metarule1 |
    And the following policy exists
      | policyname    | policydescription      | modelname    | genre     |
      | generalpolicy | This is a basic policy | generalmodel | financial |
    When the user sets to delete the following model
      | modelname    |
      | generalmodel |
    Then the following model should be existed in the system
      | modelname    | modeldescription                            | metarule  |
      | generalmodel | This model is for creating policy prototype | metarule1 |

  Scenario: Delete a model after deleting the recorded policy dependency
    Given the following model exists
      | modelname    | modeldescription                            | metarule  |
      | generalmodel | This model is for creating policy prototype | metarule1 |
    And the following policy exists
      | policyname    | policydescription      | modelname    | genre     |
      | generalpolicy | This is a basic policy | generalmodel | financial |
    When the user sets to delete the following policy
      | policyname    |
      | generalpolicy |
    And the user sets to delete the following model
      | modelname    |
      | generalmodel |
    Then the following model should be existed in the system
      | modelname | modeldescription | metarule |
      |           |                  |          |