rsmp-nordic / rsmp_validator

Official RSMP Nordic automated test tool, build with Ruby and Rpec.
https://rsmp-nordic.github.io/rsmp_validator/
MIT License
4 stars 1 forks source link

ITC-3 sends invalid S0006, emergencystage is empty #296

Closed emiltin closed 2 days ago

emiltin commented 2 years ago

2021-10-26T13:17:25.002Z 47678 KK+AG9998=001TC000 KK+AG9998=001TC000 60cb Received invalid StatusUpdate, schema errors: /sS/1/s, pattern, {"mType":"rSMsg","type":"StatusUpdate","mId":"60cbbe80-207a-44b5-a9a2-e20577ca045d","ntsOId":"KK+AG9998=001TC000","xNId":"","cId":"KK+AG9998=001TC000","sTs":"2021-10-26T13:15:41.213Z","sS":[{"sCI":"S0006","n":"status","s":"False","q":"recent"},{"sCI":"S0006","n":"emergencystage","s":"","q":"recent"}]}

emergencystage is empty, but according to the spec it must be an integer: https://rsmp-nordic.org/rsmp_specifications/rsmp_sxl_traffic_lights/1.0.15/sxl_traffic_light_controller.html#s0006

emiltin commented 2 years ago

Causes the test: Site::Traffic Light Controller Operational emergency stage is read with S0006

to fail with: Did not receive status response within 60s

emiltin commented 2 years ago

@otterdahl is the implementation or the spec wrong here? does it makes sense that an integer must always be send, even if status=false?

otterdahl commented 2 years ago
RSMP version How to handle undefined/unknown values? What can "s" be set to?
<= 3.1.2 undefined integer
3.1.3 "q" should be set to "undefined" or "unknown" integer
3.1.4 and later "q" should be set to "undefined" or "unknown" integer or null if undefined/unknown
emiltin commented 2 years ago

ok, the current spec must be updated then to state that an integer OR null can be passed. currenty it status that is must be an integer: https://rsmp-nordic.org/rsmp_specifications/rsmp_sxl_traffic_lights/1.0.15/sxl_traffic_light_controller.html#s0006

do you mean null or an empty string?

emiltin commented 2 years ago

hm since you say this is from core 3.1.4 or later this must be in the core spec? and as such relate to all statues?

emiltin commented 2 years ago

i cannot find where in the core spec it's stated that null can be send for status values?

otterdahl commented 2 years ago

i cannot where in the core spec it's stated that null can be send for status values?

In chapter http://rsmp-nordic.org/rsmp_specifications/core/3.2-draft/applicability/basic_structure.html#return-values-returnvalue, and look for the table that defines q:

Value Description
recent The value is up to date
old The value is not up to date. Used when sending buffered values
undefined The component does not exist and no subscription will be performed. s should be set to null.
unknown The value is unknown and no subscription will be performed. s should be set to null.
otterdahl commented 2 years ago

do you mean null or an empty string?

I mean null, not empty string ("")

emiltin commented 2 years ago

searching the core spec for "null" shows only one result in section 4.4:

Empty values are sent as “” for simple values and as [] for arrays. Optional values can be omitted, but can not be sent as null unless otherwise stated.

Where does the spec state that null can be used for 's' in status updates?

otterdahl commented 2 years ago

searching the core spec for "null" shows only one result in section 4.4: ... Where does the spec state that null can be used for 's' in status updates?

Searching for null doesn't seem to be working for some reason. But it is present in chapter http://rsmp-nordic.org/rsmp_specifications/core/3.2-draft/applicability/basic_structure.html#return-values-returnvalue, and look for the table that defines q. You need to scroll a bit to right in the table in the HTML version, but it does show up more clearly in the PDF version. Perhaps we should rearrange/clarify this to make it better

emiltin commented 2 years ago

ah, weird that searching is not working. the table above defining s should be amended to note that when it should be null. Right now it just states 'Value'

otterdahl commented 2 years ago

I've updated the draft

SwarcoPalm commented 2 days ago

I assume this can be closed since ITC-3 passes the validator?

emiltin commented 2 days ago

Confirmed, the ITC returns an integer.

Note: the emergecystate attribute is deprecated.