-
Type: Task
-
Status: In Progress (View Workflow)
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: 3.0
-
Fix Version/s: 5.0
-
Component/s: XOS
-
Labels:
-
Story Points:5
After using the xosgenx tool to create unit tests for the grpc calls to the xos core models, I noticed a few models that need to be cleaned up or fixed.
Here is how I'm creating the tests and determining the required fields per model/object.
- Loop through each core model
- Determine any links to that model
- Create those links (other core models)
- Determine required fields to be set and set those to random values
- this is done by checking if the modifier field is set to "required" and the options.blank field is set to "False"
In the privilege model, the accessor_id and object_ids are required when the model doesnt state that. Error is that in this model's options field, there is no "blank" option.
{'_type': 'field', 'name': 'accessor_id', 'id': '1', 'policy': None, 'modifier': 'required', 'type': 'int32', 'options': {'modifier': 'required', 'null': 'False'}} {'_type': 'field', 'name': 'object_id', 'id': '3', 'policy': None, 'modifier': 'required', 'type': 'int32', 'options': {'modifier': 'required', 'null': 'False'}}
Port Model always give this exception (no more details given). Is a slice attribute required for a port model? -
Exception calling application: 'NoneType' object has no attribute 'slice' exc_info=(<type 'exceptions.AttributeError'>, AttributeError("'NoneType' object has no attribute 'slice'",), <traceback object at 0x7fee9d1fc320>)
AddressManagerServiceInstance fails with this exception -
====================================================================== ERROR: test_addressmanagerserviceinstance_1 (grpctest.TestSequence) ---------------------------------------------------------------------- Traceback (most recent call last): File "grpctest.py", line 1485, in test model_2 = eval(str) File "<string>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 481, in __call__ return _end_unary_response_blocking(state, False, deadline) File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 432, in _end_unary_response_blocking raise _Rendezvous(state, None, None, deadline) _Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNKNOWN, Exception calling application: null value in column "owner_id" violates not-null constraint DETAIL: Failing row contains (5, 2017-10-20 19:41:28.156951+00, 2017-10-20 19:41:28.156074+00, null, null, {}, f, f, Provisioning in progress, 0, f, f, f, f, f, Policy in process, 0, AddressManagerServiceInstance, f, null, null, null, 0, null). )>
The model of the AddressManagerServiceInstance doesnt have any attribute of "owner_id"
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
7646,4 | CORD-1605 | master | xos | Status: MERGED | +2 | +1 |