View Issue Details

IDProjectCategoryView StatusLast Update
0008029CTT UA Scripts1 - Script Issuepublic2022-09-09 16:04
ReporterYannik Klaass Assigned ToYannik Klaass  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.03.501 
Summary0008029: Monitor Value Change -> 043 fails if no array nodes are defined
Description

If no array nodes are defined, this testcase can fail returning 'TC_Variables.Arrays' [null] is not an object. This only happens when a script that is calling MonitoredItem.GetRequiredNodes with the Array Settings set as Settings parameter (like in 013.js line 14), is executed before. So TC 043 will run on its own, but 013 + 043 will fail.
This is because the GetRequiredNodes function internally splices out unusable (here not configured) nodes of the object passed in the Settings parameter by reference, which is then used in fromSettings in script 043 line 18, making it return null.

The GetRequiredNodes method should be restructured to use an internal copy of the object passed by the Settings parameter. Or alternatively the fromSettings method should be modified to return an empty array in case the passed settings are empty.

Steps To Reproduce

Configure no array nodes, but at least one scalar node in the CTT settings (so the CU will not be skipped) and run the scripts in Monitor Value Change -> 013 + 043. Script 043 should fail in this case. Run script 043 again on its own and it should pass.

TagsNo tags attached.
Files Affected

Relationships

has duplicate 0008234 closedPaul Hunkar CTT UA Scripts 0008029: Monitor Value Change -> 043 fails if no array nodes are defined 
related to 0008173 closedPaul Hunkar Compliance Test Tool (CTT) Unified Architecture Failing array specific test case on a OPC UA Server which does not support array datatype. 

Activities

Hans Berende

2022-06-07 07:17

reporter   ~0016803

I got an error on line 19:
Test.Execute() encounted an unexpected error:
message:Result of expression 'TC_Variables.Arrays' [null] is not an object.
lineNumber:19
sourceId:154605848
fileName:D:/Source/Protocol_TestTools/OpcUa/Server/CTT Test Tool/maintree/Monitored Item Services/Monitor Value Change/Test Cases/043.js

It seems that statement
TC_Variables.Arrays=MonitoredItem.fromSettings( Settings.ServerTest.NodeIds.Static.AllProfiles.Arrays.Settings );
sometimes returns null and sometimes returns an empty array object.

Modifying line 19 to
if(TC_Variables.Arrays == null || TC_Variables.Arrays.length<1 ) {
solved the issue for me.

Camille Guérin

2022-07-01 08:11

reporter   ~0017077

I also have no Array configured and observed the same issue.
Actually the test shall be able to run without array configured but still fail due to a wrong IndexRange.

TC_Variables.Arrays[i].IndexRange=TC_Variables.Arrays[i].Value.Value.getArraySize()-TC_Variables.NumberOfValidItems+":"+( TC_Variables.Arrays[i].Value.Value.getArraySize()-10);

In most of the case the nodes Server_ServerCapabilities_ServerProfileArray contains less than 10 elements....

Camille Guérin

2022-07-01 13:15

reporter   ~0017078

+10 not -10
And this is actually regarding the specification...
"If any of the upper bounds of the indexes is out of range, the Server shall return partial results."

Yannik Klaass

2022-08-15 12:54

developer   ~0017323

Changed GetRequiredNodes to create an internal copy of the passed 'Settings' to work with, to avoid editing the content by reference

Paul Hunkar

2022-09-09 16:04

administrator   ~0017597

review changes in call, agreed to updates and closed

Issue History

Date Modified Username Field Change
2022-06-03 09:52 Yannik Klaass New Issue
2022-06-07 07:17 Hans Berende Note Added: 0016803
2022-07-01 08:11 Camille Guérin Note Added: 0017077
2022-07-01 13:15 Camille Guérin Note Added: 0017078
2022-08-04 14:51 Paul Hunkar Relationship added related to 0008173
2022-08-04 14:52 Paul Hunkar Assigned To => Yannik Klaass
2022-08-04 14:52 Paul Hunkar Status new => assigned
2022-08-15 12:54 Yannik Klaass Status assigned => resolved
2022-08-15 12:54 Yannik Klaass Resolution open => fixed
2022-08-15 12:54 Yannik Klaass Note Added: 0017323
2022-08-25 03:09 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Scripts
2022-08-25 14:25 Paul Hunkar Relationship added has duplicate 0008234
2022-09-09 16:04 Paul Hunkar Status resolved => closed
2022-09-09 16:04 Paul Hunkar Fixed in Version => 1.03.501
2022-09-09 16:04 Paul Hunkar Note Added: 0017597