View Issue Details

IDProjectCategoryView StatusLast Update
0005681Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2020-06-03 16:57
ReporterJochen Baier Assigned ToPaul Hunkar  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.04.09.395 
Summary0005681: WriteService.GenerateString() is called with wrong parameter in script: generates string with wrong size
Description

In this script WriteService.GenerateString() is called with
WriteService.GenerateString( stringLen ) instead of WriteService.GenerateString({length: stringLen})

maintree\Base Information\Base Info Server Capabilities\Test Cases\006.js

in this case the WriteService.GenerateString() will generate a string with the length of the parameter as a string.
for example: WriteService.GenerateString( 1 + stringLen ) with stringLen (as type string) of 254 will generate a string with length 4 (length of "1254" because stringLen is not a number)

Searching for "WriteService.GenerateString" will find other possible wrong occurrences.

posssible patch for maintree\Base Information\Base Info Server Capabilities\Test Cases\006.js:

diff --git a/maintree/Base Information/Base Info Server Capabilities/Test Cases/006.js b/maintree/Base Information/Base Info Server Capabilities/Test Cases/006.js
--- a/maintree/Base Information/Base Info Server Capabilities/Test Cases/006.js
+++ b/maintree/Base Information/Base Info Server Capabilities/Test Cases/006.js
@@ -22,7 +22,8 @@ function test() {
var realValue = itemMaxLen.Value.Value;

 // check the setting and set a bound if necessary
  • var stringLen = itemMaxLen.Value.Value;
  • var stringLen = itemMaxLen.Value.Value.toUInt32();
  • if( stringLen == 0 ) {
    addWarning( "MaxStringLength set to 0 (meaning 'no limit'). It should be set to a more realistic value. OperationLimit will be limited to this value." );
    stringLen = MAX_ALLOWED_SIZE;
    @@ -36,7 +37,7 @@ function test() {
    itemString.InitialValue = itemString.Value.Value.clone();

    // now to write a string whose length matches the setting

  • itemString.Value.Value.setString( WriteService.GenerateString( stringLen ) );
  • itemString.Value.Value.setString( WriteService.GenerateString({length: stringLen}));
    addLog( "Specified string of length: " + itemString.Value.Value.toString().length );
    if( !WriteHelper.Execute( { NodesToWrite: itemString, ReadVerification: false } ) ) {
    // In testing we've found that some servers will crash or become none-too-reliable. Terminate channel and recreate.
    @@ -47,7 +48,7 @@ function test() {

    // can we exceed the count?
    if (stringLen != Constants.UInt32_Max && stringLen != MAX_ALLOWED_SIZE ) {

  • itemString.Value.Value.setString( WriteService.GenerateString( 1 + stringLen ) );
  • itemString.Value.Value.setString( WriteService.GenerateString({ length: 1 + stringLen} ));
    if( !WriteHelper.Execute( { NodesToWrite: itemString, OperationResults: new ExpectedAndAcceptedResults( [ StatusCode.BadOutOfRange, StatusCode.BadEncodingLimitsExceeded ] ), ServiceResult: new ExpectedAndAcceptedResults( [ StatusCode.Good, StatusCode.BadEncodingLimitsExceeded ] ), ReadVerification: false } ) ) {
    // In testing we've found that some servers will crash or become none-too-reliable. Terminate channel and recreate.
    Test.Disconnect();
    --
TagsNo tags attached.
Files Affected

Relationships

related to 0005603 closedAlexander Allmendinger MaxStringLength test problem (Base Info Server Capabilities/006.js) 

Activities

Paul Hunkar

2020-06-03 16:57

administrator   ~0012166

See related issue

Paul Hunkar

2020-06-03 16:57

administrator   ~0012167

Reviewed in cmp call

Issue History

Date Modified Username Field Change
2020-06-03 09:57 Jochen Baier New Issue
2020-06-03 16:56 Paul Hunkar Relationship added related to 0005603
2020-06-03 16:57 Paul Hunkar Assigned To => Paul Hunkar
2020-06-03 16:57 Paul Hunkar Status new => resolved
2020-06-03 16:57 Paul Hunkar Resolution open => duplicate
2020-06-03 16:57 Paul Hunkar Note Added: 0012166
2020-06-03 16:57 Paul Hunkar Status resolved => closed
2020-06-03 16:57 Paul Hunkar Note Added: 0012167