View Issue Details

IDProjectCategoryView StatusLast Update
0004129Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2019-08-09 15:48
ReporterMartin Lang Assigned ToAlexander Allmendinger  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.03.340.380 
Target Version1.03Fixed in Version1.03.341.381 
Summary0004129: Base Information/Base Info Server Capabilities/ 008 + 011 difference in limit testing + operation length check bug
Description

script 008.js - MaxNodesPerRead:
Script checks only on the max limit e.g. MaxNodesPerRead = 200, test case: request with exaclty max 200 operations.
Not tested: request with max 200 + 1 operations.

script 011.js - MaxNodesPerWrite
The script tries in line 34 to exceed the MaxNodesPerWrite limit.
So the server shall reject the request with service result BadTooManyOperations or BadEncodingLimitsExceeded.
Unfortunately the script throws an error:
The number of results does not match the number of NodesToWriteService.
called from: C:/Arbeit/CTT-project/ServerTest103/library/ServiceBased/AttributeServiceSet/Write.js line: 453
called from: C:/Arbeit/CTT-project/ServerTest103/library/ServiceBased/AttributeServiceSet/Write.js line: 83
called from: C:/Arbeit/CTT-project/ServerTest103/maintree/Base Information/Base Info Server Capabilities/Test Cases/011.js line: 37
called from: C:/Arbeit/CTT-project/ServerTest103/library/Base/safeInvoke.js line: 95
called from: C:/Arbeit/CTT-project/ServerTest103/maintree/Base Information/Base Info Server Capabilities/Test Cases/011.js line: 42
NodesToWriteService.length = 201 Results.length = 0
called from: C:/Arbeit/CTT-project/ServerTest103/library/ServiceBased/AttributeServiceSet/Write.js line: 454
called from: C:/Arbeit/CTT-project/ServerTest103/library/ServiceBased/AttributeServiceSet/Write.js line: 83
called from: C:/Arbeit/CTT-project/ServerTest103/maintree/Base Information/Base Info Server Capabilities/Test Cases/011.js line: 37
called from: C:/Arbeit/CTT-project/ServerTest103/library/Base/safeInvoke.js line: 95
called from: C:/Arbeit/CTT-project/ServerTest103/maintree/Base Information/Base Info Server Capabilities/Test Cases/011.js line: 42

So the underlaying script Write.js checks the operation result length whereas the service result match.

Additional Information

modifications for script 008.js - MaxNodesPerRead:
current implementation script 008.js begin line 27:
[...]
var bigReadItems = MonitoredItem.GetRequiredNodes( { Number: realValue, settings: Settings.ServerTest.NodeIds.Static.AllProfiles.Scalar.AllSettings } );
ReadHelper.Execute( { NodesToRead: bigReadItems } );

return( result );

}
[...]

Proposal:
[...]
var bigReadItems = MonitoredItem.GetRequiredNodes( { Number: realValue, settings: Settings.ServerTest.NodeIds.Static.AllProfiles.Scalar.AllSettings } );
ReadHelper.Execute( { NodesToRead: bigReadItems } );

// increase the # and expect a 
if (realValue < MAX_ALLOWED_SIZE) {
    bigReadItems.push(bigReadItems[0].clone());
    ReadHelper.Execute( { NodesToRead: bigReadItems, ServiceResult: new ExpectedAndAcceptedResults([StatusCode.BadTooManyOperations, StatusCode.BadEncodingLimitsExceeded]) } );
}

return( result );

}
[...]


modifications for script 011.js - MaxNodesPerWrite:
no modification in script 011.js needed, but in script /library/ServiceBased/AttributesServiceSet/Write.js
current implementation, begin line 77
[...]
// check result
if( this.UaStatus.isGood() ) {
result = UaResponseHeader.IsValid( { Service: this, ServiceResult: args.ServiceResult, SuppressMessaging: args.SuppressMessaging, SuppressErrors: args.SuppressErrors, ServiceInfo: "NodesToWrite #" + this.Request.NodesToWrite.length } );
if( result ) {
var settingNames = MonitoredItem.GetSettingNames( args.NodesToWrite );
if( isDefined( args.OperationResults ) ) this.writeSuccess = checkWriteError( this.Request, this.Response, args.OperationResults, args.ReadVerification, settingNames, args.CheckNotSupported, session );
else this.writeSuccess = ( checkWriteValidParameter( this.Request, this.Response, args.ReadVerification, settingNames, undefined, args.SuppressMessaging, session ) );
}
else {
[...]

proposal:
[...]
// check result
if( this.UaStatus.isGood() ) {
result = UaResponseHeader.IsValid( { Service: this, ServiceResult: args.ServiceResult, SuppressMessaging: args.SuppressMessaging, SuppressErrors: args.SuppressErrors, ServiceInfo: "NodesToWrite #" + this.Request.NodesToWrite.length } );
/////// Modified line. Add "&& this.Response.ResponseHeader.ServiceResult.isGood()"
if( result && this.Response.ResponseHeader.ServiceResult.isGood() ) {
var settingNames = MonitoredItem.GetSettingNames( args.NodesToWrite );
if( isDefined( args.OperationResults ) ) this.writeSuccess = checkWriteError( this.Request, this.Response, args.OperationResults, args.ReadVerification, settingNames, args.CheckNotSupported, session );
else this.writeSuccess = ( checkWriteValidParameter( this.Request, this.Response, args.ReadVerification, settingNames, undefined, args.SuppressMessaging, session ) );
}
else {
[...]

TagsNo tags attached.
Files Affected

Activities

Etienne Rossignon

2018-01-13 10:01

reporter   ~0008837

Last edited: 2018-01-13 10:10

I came across this issue as well. As spotted by mlang, there is a bug in the Write.js file

if( result ) {

should be

if( result && this.ResponseHeader.ServiceResult.IsGood() ) {

(The correct pattern is used in Read.js )

Paul Hunkar

2018-02-22 16:45

administrator   ~0008886

reviewed in CTT - agreed to target 1.03

The is valid should be setting the status based on the service result.

Alexander Allmendinger

2018-08-06 11:02

developer   ~0009266

Fixed according to the suggestion.
Thanks for the very detailed report.

Paul Hunkar

2019-08-09 15:48

administrator   ~0010742

reviewed in CMP call

Issue History

Date Modified Username Field Change
2018-01-12 14:46 Martin Lang New Issue
2018-01-13 10:01 Etienne Rossignon Note Added: 0008837
2018-01-13 10:02 Etienne Rossignon Note Edited: 0008837
2018-01-13 10:10 Etienne Rossignon Note Edited: 0008837
2018-02-22 16:45 Paul Hunkar Note Added: 0008886
2018-02-22 16:45 Paul Hunkar Target Version => 1.03
2018-02-22 16:45 Paul Hunkar Assigned To => Alexander Allmendinger
2018-02-22 16:45 Paul Hunkar Status new => assigned
2018-08-06 11:02 Alexander Allmendinger Note Added: 0009266
2018-08-06 11:02 Alexander Allmendinger Status assigned => resolved
2018-08-06 11:02 Alexander Allmendinger Fixed in Version => 1.03.341.381
2018-08-06 11:02 Alexander Allmendinger Resolution open => fixed
2019-01-28 14:10 Paul Hunkar Category Script Issue => 1 - Script Issue
2019-08-09 15:48 Paul Hunkar Status resolved => closed
2019-08-09 15:48 Paul Hunkar Note Added: 0010742