4 # ==================================================================================
5 # Copyright (c) 2019 Nokia
6 # Copyright (c) 2018-2019 AT&T Intellectual Property.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ==================================================================================
29 http://flask.pocoo.org/docs/1.0/testing/
32 db_fd, app.app.config["DATABASE"] = tempfile.mkstemp()
33 app.app.config["TESTING"] = True
34 cl = app.app.test_client()
39 os.unlink(app.app.config["DATABASE"])
45 represents a good put for adm control type
48 "name": "Admission Control",
49 "description": "various parameters to control admission of dual connection",
50 "policy_type_id": 6660666,
52 "$schema": "http://json-schema.org/draft-07/schema#",
55 "enforce": {"type": "boolean", "default": True},
61 "description": "Sliding window length (in minutes)",
68 "description": "% Connections to block",
70 "trigger_threshold": {
74 "description": "Minimum number of events in window to trigger blocking",
77 "required": ["enforce", "blocking_rate", "trigger_threshold", "window_length"],
78 "additionalProperties": False,
84 def adm_instance_good():
86 represents a good put for adm control instance
88 return {"enforce": True, "window_length": 10, "blocking_rate": 20, "trigger_threshold": 10}