Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: A problem with running PTCs

A problem with running PTCs 29 Jun 2005 09:24 #6837

  • Pekka M
  • Pekka M's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Hello all!

I'm facing a rather annoying problem that is propably related to my test
management tool TTman.
But just to make sure I haven't done some mistake with my TTCN-3 scripts,
let me present the problem to you all
with the help of scripts and logs.

In short the problem is that test management tool claims a PTC is still
running although it shouldn't be.
In scripts I have tried to make sure that the behaviour first started on a
PTC has completed
before trying to start new behaviour on the same PTC.

Should it not be possible to start running multiple functions on one PTC in
one test case assuming
that they are not started before the previous has ended? Example codes and
log are below.

If anyone has an alternate solution or some suggestions I'd be most
grateful to hear them.

BR
Pekka Mäki-Asiala

type component ct_MyMTC {
var ct_MyTester ct_PTC1;
var ct_MyTester ct_PTC2;
}
type component ct_MyTester {
port pt_service service;
var e_role cv_roleOfTheComponent := MTC; // enumerated:
MTC or PTC
}
type component ct_TSI {
port pt_service PTC1Service;
port pt_service PTC2Service;
}

function f_SetTestComponentRole(e_role p_role) runs on ct_MyTester {
cv_roleOfTheComponent := p_role;
}
function f_MapTestSystem(ct_TSI p_system) runs on ct_MyMTC {
ct_PTC1:= ct_MyTester.create;
ct_PTC2:= ct_MyTester.create;
map(ct_PTC1:service, p_system:PTC1Service);
map(ct_PTC2:service, p_system:PTC2Service);
}

testcase TC_1() runs on ct_MyMTC system ct_TSI {
f_MapTestSystem(system);
ct_PTC1.start(f_SetTestComponentRole(PTC));
ct_PTC2.start(f_SetTestComponentRole(PTC));
if(ct_PTC1.running) {
log("###### ct_PTC1 is running"); /* First log
statement indicating that PTC is running */
}
all component.done;
if(ct_PTC1.running) {
log("###### all component.done called, but ct_PTC1
is still running"); /* Second log statement */
}
else {
log("###### all component.done called, behaviour
running on ct_PTC1 has completed."); /* Third log statement */
ct_PTC1.start(f_StartupService()); // CRASH POINT
ct_PTC1.done;
}
f_UnMapTestSystem(system);
}

The following log is printed by the TTman: /* my comments */

09:38:28.656 : starting testcase TC_1
09:38:28.687 : component `component1' is mtc
09:38:28.765 : component `component2' is system
09:38:28.781 : starting component 'component1' with behavior TC_1
09:38:28.812 : started testcase TC_1 with system ports /* ... list of
ports */
09:38:29.656 : component `component3' is ptc
09:38:29.671 : component `component4' is ptc
09:38:29.671 : mapping component3.service of component 'component3' with
component2.PTC1Service
09:38:29.843 : mapping component4.service of component 'component4' with
component2.PTC2Service
09:38:30.390 : starting component 'component3' with behavior
'f_SetTestComponentRole'
09:38:30.390 : starting component 'component4' with behavior
'f_SetTestComponentRole'
/* Here comes the first log statement indicating that the PTC is
running */
09:38:30.390 : component1: ###### ct_PTC1 is running
09:38:30.390 : normal termination of component 'component3' with verdict
'none'
09:38:30.390 : normal termination of component 'component4' with verdict
'none' /* behaviour running on both PTCs should have ended */
/* Here comes the third log statement making it absolutely sure
that behaviour running on ct_PTC1 has completed */
09:38:30.390 : component1: ###### all component.done called, behaviour
running on ct_PTC1 has completed
/* ... And then the "abnormal termination" of MTC */
09:38:30.390 : abnormal termination of component 'component1' component
already running: `component3'
error: component already running: `component3' /* Here's what I don't get
"component already running : `component3' " */
at XXX.ttcn3:74:10:74:44 /* points to the line marked in
the code with // CRASH POINT */

09:38:30.421 : testcase terminated with verdict: 'error'
The administrator has disabled public write access.

A problem with running PTCs 29 Jun 2005 09:48 #6838

  • Pekka M
  • Pekka M's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Okay, I just found out that it is only possible to start behaviour on a
test component once within a given testcase.
So it seems it's back to the drawing board...

cheers
Pekka

At 12:24 29.6.2005 +0300, you wrote:
>Hello all!
>
>I'm facing a rather annoying problem that is propably related to my test
>management tool TTman.
>But just to make sure I haven't done some mistake with my TTCN-3 scripts,
>let me present the problem to you all
>with the help of scripts and logs.
>
>In short the problem is that test management tool claims a PTC is still
>running although it shouldn't be.
>In scripts I have tried to make sure that the behaviour first started on a
>PTC has completed
>before trying to start new behaviour on the same PTC.
>
>Should it not be possible to start running multiple functions on one PTC
>in one test case assuming
>that they are not started before the previous has ended? Example codes and
>log are below.
>
>If anyone has an alternate solution or some suggestions I'd be most
>grateful to hear them.
>
>BR
>Pekka Mäki-Asiala
>
> type component ct_MyMTC {
> var ct_MyTester ct_PTC1;
> var ct_MyTester ct_PTC2;
> }
> type component ct_MyTester {
> port pt_service service;
> var e_role cv_roleOfTheComponent := MTC; // enumerated:
> MTC or PTC
> }
> type component ct_TSI {
> port pt_service PTC1Service;
> port pt_service PTC2Service;
> }
>
> function f_SetTestComponentRole(e_role p_role) runs on ct_MyTester {
> cv_roleOfTheComponent := p_role;
> }
> function f_MapTestSystem(ct_TSI p_system) runs on ct_MyMTC {
> ct_PTC1:= ct_MyTester.create;
> ct_PTC2:= ct_MyTester.create;
> map(ct_PTC1:service, p_system:PTC1Service);
> map(ct_PTC2:service, p_system:PTC2Service);
> }
>
> testcase TC_1() runs on ct_MyMTC system ct_TSI {
> f_MapTestSystem(system);
> ct_PTC1.start(f_SetTestComponentRole(PTC));
> ct_PTC2.start(f_SetTestComponentRole(PTC));
> if(ct_PTC1.running) {
> log("###### ct_PTC1 is running"); /* First log
> statement indicating that PTC is running */
> }
> all component.done;
> if(ct_PTC1.running) {
> log("###### all component.done called, but
> ct_PTC1 is still running"); /* Second log statement */
> }
> else {
> log("###### all component.done called, behaviour
> running on ct_PTC1 has completed."); /* Third log statement */
> ct_PTC1.start(f_StartupService()); // CRASH POINT
> ct_PTC1.done;
> }
> f_UnMapTestSystem(system);
> }
>
>The following log is printed by the TTman: /* my comments */
>
>09:38:28.656 : starting testcase TC_1
>09:38:28.687 : component `component1' is mtc
>09:38:28.765 : component `component2' is system
>09:38:28.781 : starting component 'component1' with behavior TC_1
>09:38:28.812 : started testcase TC_1 with system ports /* ... list of
>ports */
>09:38:29.656 : component `component3' is ptc
>09:38:29.671 : component `component4' is ptc
>09:38:29.671 : mapping component3.service of component 'component3' with
>component2.PTC1Service
>09:38:29.843 : mapping component4.service of component 'component4' with
>component2.PTC2Service
>09:38:30.390 : starting component 'component3' with behavior
>'f_SetTestComponentRole'
>09:38:30.390 : starting component 'component4' with behavior
>'f_SetTestComponentRole'
> /* Here comes the first log statement indicating that the PTC is
> running */
>09:38:30.390 : component1: ###### ct_PTC1 is running
>09:38:30.390 : normal termination of component 'component3' with verdict
>'none'
>09:38:30.390 : normal termination of component 'component4' with verdict
>'none' /* behaviour running on both PTCs should have ended */
> /* Here comes the third log statement making it absolutely sure
> that behaviour running on ct_PTC1 has completed */
>09:38:30.390 : component1: ###### all component.done called, behaviour
>running on ct_PTC1 has completed
> /* ... And then the "abnormal termination" of MTC */
>09:38:30.390 : abnormal termination of component 'component1' component
>already running: `component3'
>error: component already running: `component3' /* Here's what I don't get
>"component already running : `component3' " */
> at XXX.ttcn3:74:10:74:44 /* points to the line marked in
> the code with // CRASH POINT */
>
>09:38:30.421 : testcase terminated with verdict: 'error'
The administrator has disabled public write access.

A problem with running PTCs 29 Jun 2005 09:54 #6839

Hello Pekka,

you are right, it is not allowed to start several functions one after the other on the same test component. But note that this limitation will be weakened in the forthcoming edition 3 of the TTCN-3 standard. There 'keep-alive' components are introduce which will allow the execution of several functions.

But for the 2.2.1 edition, this is not allowed.

Best regards

Thomas


Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.]On Behalf Of ext Pekka Mäki-Asiala
Sent: Wednesday, 29 June, 2005 11:49
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: A problem with running PTCs


Okay, I just found out that it is only possible to start behaviour on a test component once within a given testcase.
So it seems it's back to the drawing board...

cheers
Pekka

At 12:24 29.6.2005 +0300, you wrote:


Hello all!

I'm facing a rather annoying problem that is propably related to my test management tool TTman.
But just to make sure I haven't done some mistake with my TTCN-3 scripts, let me present the problem to you all
with the help of scripts and logs.

In short the problem is that test management tool claims a PTC is still running although it shouldn't be.
In scripts I have tried to make sure that the behaviour first started on a PTC has completed
before trying to start new behaviour on the same PTC.

Should it not be possible to start running multiple functions on one PTC in one test case assuming
that they are not started before the previous has ended? Example codes and log are below.

If anyone has an alternate solution or some suggestions I'd be most grateful to hear them.

BR
Pekka Mäki-Asiala

type component ct_MyMTC {
var ct_MyTester ct_PTC1;
var ct_MyTester ct_PTC2;
}
type component ct_MyTester {
port pt_service service;
var e_role cv_roleOfTheComponent := MTC; // enumerated: MTC or PTC
}
type component ct_TSI {
port pt_service PTC1Service;
port pt_service PTC2Service;
}

function f_SetTestComponentRole(e_role p_role) runs on ct_MyTester {
cv_roleOfTheComponent := p_role;
}
function f_MapTestSystem(ct_TSI p_system) runs on ct_MyMTC {
ct_PTC1:= ct_MyTester.create;
ct_PTC2:= ct_MyTester.create;
map(ct_PTC1:service, p_system:PTC1Service);
map(ct_PTC2:service, p_system:PTC2Service);
}

testcase TC_1() runs on ct_MyMTC system ct_TSI {
f_MapTestSystem(system);
ct_PTC1.start(f_SetTestComponentRole(PTC));
ct_PTC2.start(f_SetTestComponentRole(PTC));
if(ct_PTC1.running) {
log("###### ct_PTC1 is running"); /* First log statement indicating that PTC is running */
}
all component.done;
if(ct_PTC1.running) {
log("###### all component.done called, but ct_PTC1 is still running"); /* Second log statement */
}
else {
log("###### all component.done called, behaviour running on ct_PTC1 has completed."); /* Third log statement */
ct_PTC1.start(f_StartupService()); // CRASH POINT
ct_PTC1.done;
}
f_UnMapTestSystem(system);
}

The following log is printed by the TTman: /* my comments */

09:38:28.656 : starting testcase TC_1
09:38:28.687 : component `component1' is mtc
09:38:28.765 : component `component2' is system
09:38:28.781 : starting component 'component1' with behavior TC_1
09:38:28.812 : started testcase TC_1 with system ports /* ... list of ports */
09:38:29.656 : component `component3' is ptc
09:38:29.671 : component `component4' is ptc
09:38:29.671 : mapping component3.service of component 'component3' with component2.PTC1Service
09:38:29.843 : mapping component4.service of component 'component4' with component2.PTC2Service
09:38:30.390 : starting component 'component3' with behavior 'f_SetTestComponentRole'
09:38:30.390 : starting component 'component4' with behavior 'f_SetTestComponentRole'
/* Here comes the first log statement indicating that the PTC is running */
09:38:30.390 : component1: ###### ct_PTC1 is running
09:38:30.390 : normal termination of component 'component3' with verdict 'none'
09:38:30.390 : normal termination of component 'component4' with verdict 'none' /* behaviour running on both PTCs should have ended */
/* Here comes the third log statement making it absolutely sure that behaviour running on ct_PTC1 has completed */
09:38:30.390 : component1: ###### all component.done called, behaviour running on ct_PTC1 has completed
/* ... And then the "abnormal termination" of MTC */
09:38:30.390 : abnormal termination of component 'component1' component already running: `component3'
error: component already running: `component3' /* Here's what I don't get "component already running : `component3' " */
at XXX.ttcn3:74:10:74:44 /* points to the line marked in the code with // CRASH POINT */

09:38:30.421 : testcase terminated with verdict: 'error'
The administrator has disabled public write access.

A problem with running PTCs 29 Jun 2005 10:56 #6840

Hei Pekka,

If you are using TTCN-3 edition 2, the test component
is destroyed after the function started using start
statement finishes.

If you are using TTCN-3 edition 3, you can create
a test component with "alive" speicification, i.e.
ct_PTC1:= ct_MyTester.create alive;
and that means that you can start multiple functions
in the same component IN SEQUENCE without the started
component being destroyed after the first function
finishes.

You cannot start a new function in the same component
before the previous function has finished (edition 3).

Best regards,
Vesa-Matti

Pekka Mäki-Asiala wrote:
> Hello all!
>
> I'm facing a rather annoying problem that is propably related to my test
> management tool TTman.
> But just to make sure I haven't done some mistake with my TTCN-3
> scripts, let me present the problem to you all
> with the help of scripts and logs.
>
> In short the problem is that test management tool claims a PTC is still
> running although it shouldn't be.
> In scripts I have tried to make sure that the behaviour first started on
> a PTC has completed
> before trying to start new behaviour on the same PTC.
>
> Should it not be possible to start running multiple functions on one PTC
> in one test case assuming
> that they are not started before the previous has ended? Example codes
> and log are below.
>
> If anyone has an alternate solution or some suggestions I'd be most
> grateful to hear them.
>
> BR
> Pekka Mäki-Asiala
>
> * type* *component* ct_MyMTC {
> * var* ct_MyTester ct_PTC1;
> *var* ct_MyTester ct_PTC2;
> }
> *type* *component* ct_MyTester {
> *port* pt_service service;
> *var* e_role cv_roleOfTheComponent := MTC; //
> enumerated: MTC or PTC
> }
> *type* *component* ct_TSI {
> *port* pt_service PTC1Service;
> *port* pt_service PTC2Service;
> }
>
> *function* f_SetTestComponentRole(e_role p_role) *runs* *on*
> ct_MyTester {
> cv_roleOfTheComponent := p_role;
> }
> *function* f_MapTestSystem(ct_TSI p_system) *runs* *on* ct_MyMTC {
> ct_PTC1:= ct_MyTester.*create*;
> ct_PTC2:= ct_MyTester.*create*;
> *map*(ct_PTC1:service, p_system:PTC1Service);
> *map*(ct_PTC2:service, p_system:PTC2Service);
> }
>
> *testcase* TC_1() *runs* *on* ct_MyMTC *system* ct_TSI {
> f_MapTestSystem(*system*);
> ct_PTC1.*start*(f_SetTestComponentRole(PTC));
> ct_PTC2.*start*(f_SetTestComponentRole(PTC));
> *if*(ct_PTC1.*running*) {
> *log*("###### ct_PTC1 is running"); /* First log
> statement indicating that PTC is running */
> }
> *all* *component*.*done*;
> *if*(ct_PTC1.*running*) {
> *log*("###### all component.done called, but
> ct_PTC1 is still running"); /* Second log statement */
> }
> *else* {
> *log*("###### all component.done called,
> behaviour running on ct_PTC1 has completed."); /* Third log statement */
> ct_PTC1.*start*(f_StartupService()); // CRASH POINT
> ct_PTC1.*done*;
> }
> f_UnMapTestSystem(*system*);
> }
>
> The following log is printed by the TTman: /* my comments */
>
> 09:38:28.656 : starting testcase TC_1
> 09:38:28.687 : component `component1' is mtc
> 09:38:28.765 : component `component2' is system
> 09:38:28.781 : starting component 'component1' with behavior TC_1
> 09:38:28.812 : started testcase TC_1 with system ports /* ... list of
> ports */
> 09:38:29.656 : component `component3' is ptc
> 09:38:29.671 : component `component4' is ptc
> 09:38:29.671 : mapping component3.service of component 'component3'
> with component2.PTC1Service
> 09:38:29.843 : mapping component4.service of component 'component4'
> with component2.PTC2Service
> 09:38:30.390 : starting component 'component3' with behavior
> 'f_SetTestComponentRole'
> 09:38:30.390 : starting component 'component4' with behavior
> 'f_SetTestComponentRole'
> /* Here comes the first log statement indicating that the PTC is
> running */
> 09:38:30.390 : component1: ###### ct_PTC1 is running
> 09:38:30.390 : normal termination of component 'component3' with
> verdict 'none'
> 09:38:30.390 : normal termination of component 'component4' with
> verdict 'none' /* behaviour running on both PTCs should have ended */
> /* Here comes the third log statement making it absolutely sure
> that behaviour running on ct_PTC1 has completed */
> 09:38:30.390 : component1: ###### all component.done called, behaviour
> running on ct_PTC1 has completed
> /* ... And then the "abnormal termination" of MTC */
> 09:38:30.390 : abnormal termination of component 'component1'
> component already running: `component3'
> error: component already running: `component3' /* Here's what I don't
> get "component already running : `component3' " */
> at XXX.ttcn3:74:10:74:44 /* points to the line marked in
> the code with // CRASH POINT */
>
> 09:38:30.421 : testcase terminated with verdict: 'error'


le.


Vesa-Matti Puro
OpenTTCN Oy
E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web: www.openttcn.com
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin