+ json:
+ class: 12
+ enforce: true
+ window_length: 20
+ blocking_rate: 20
+ trigger_threshold: 10
+
+ - name: test the admission control policy status get
+ delay_before: 10 # give it a few seconds for rmr
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status
+ method: GET
+ response:
+ status_code: 200
+ json:
+ instance_status: "IN EFFECT"
+ has_been_deleted: False
+ created_at: !anyfloat
+
+ - name: instance list 200 and contains the instance
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies
+ method: GET
+ response:
+ status_code: 200
+ json:
+ - admission_control_policy
+
+ # DELETE the instance and make sure subsequent GETs return properly
+ - name: delete the instance
+ delay_after: 4
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy
+ method: DELETE
+ response:
+ status_code: 202
+
+ - name: status should now be not in effect but still there
+ delay_before: 3 # give it a few seconds for rmr
+ delay_after: 10 # 3 + 10 > 10; that is, wait until t2 expires
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status
+ method: GET
+ response:
+ status_code: 200
+ json:
+ instance_status: "NOT IN EFFECT"
+ has_been_deleted: True
+ deleted_at: !anyfloat
+ created_at: !anyfloat
+
+ - name: instance list 200 but no instance
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies
+ method: GET
+ response:
+ status_code: 200
+ json: []
+
+ - name: cant get instance status
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status
+ method: GET
+ response:
+ status_code: 404
+
+ - name: cant get instance
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy
+ method: GET
+ response:
+ status_code: 404
+
+ - name: delete ac type
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666
+ method: DELETE
+ response:
+ status_code: 204
+
+ - name: cant delete again
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666
+ method: DELETE
+ response:
+ status_code: 404
+
+ - name: cant get
+ request:
+ url: http://localhost:10000/a1-p/policytypes/6660666
+ method: DELETE
+ response:
+ status_code: 404
+
+ - name: empty type list
+ request:
+ url: http://localhost:10000/a1-p/policytypes
+ method: GET
+ response:
+ status_code: 200
+ json: []
+