Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » How to execute test cases with Linux command line
How to execute test cases with Linux command line [message #1796343] Thu, 11 October 2018 09:00 Go to next message
le tian is currently offline le tianFriend
Messages: 16
Registered: October 2018
Junior Member
I have established project,this project have many test case.I need to execute these test cases over and over again.How to execute these test cases with Linux command line rather than click the "run as" in eclipse titan.

Thank you for your answer.
Re: How to execute test cases with Linux command line [message #1796443 is a reply to message #1796343] Sat, 13 October 2018 06:35 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi le tian,

there are two ways to start a parallel execution from the command line;
let's assume that you have built with Titan an executable binary myExecutableBinary
and you have a configuration file ConfigurationFile.cfg
I will assume that environment variables are set correctly (
see README.linux here https://github.com/eclipse/titan.core/blob/master/README.linux)
and I'm located and the same directory as the config file and the binary:



1) starting step by step ( this is more cumbersome but sheds some light on the architecture) :

start the main controller
./mctr_cli  ConfigurationFile.cfg 


this will display the port on which the main controller will be listening:
...Listening on IP address 127.0.0.1 and TCP port 46308

Create mtc:
cmtc
Waiting for HC to connect...


then start the host controller in a second console:
./myExecutableBinary   127.0.0.1 46308

(port has to match the above, and no config file here)


then start mtc in the first console:
smtc

2) use the ttcn3_start script:
ttcn3_start  ./myExecutableBinary  ConfigurationFile.cfg

I would recommend the latter as it is simpler.

For details, see Titan user guide , ch 4 Executing Test Suites.

Best regards
Elemer
Re: How to execute test cases with Linux command line [message #1796446 is a reply to message #1796343] Sat, 13 October 2018 07:42 Go to previous messageGo to next message
Gyorgy Rethy is currently offline Gyorgy RethyFriend
Messages: 31
Registered: April 2015
Member
Hi le tian,
Just one more hint, if you want to execute your test cases repeatedly:
Using the methods above, in the ConfigurationFile.cfg, the [EXECUTE] section have to list all testcases you want to execute, and then call ttcn3_start as many times as you want to repeat execution of your set of test cases.

Alternatively you may consider creating a new TTCN-3 module with a control {...} part in it, and define a for loop, the body of which is executing your test cases like:
for (var integer i=0;i<X;i:=i+1){
execute(MyTestcase1());
execute(MyTestcase2());
...
}
In this case you shall just execute this control part in you configuration part:
[EXECUTE]
MyControlModule.control

Some further advantages are, that you can control test case execution dynamically:
- add different guard timers to your test cases (you can also define a global guard timer in the .cfg file), the number of repetitions may be defined as a runtime parameter in the .cfg file or
- may even depend on the test case execution result -> you can save test case verdicts in a verdicttype variable and use it e.g. in if-else statements or increase/decrease/stop the number of cycles the test cases are executed in.

[Updated on: Sat, 13 October 2018 07:57]

Report message to a moderator

Re: How to execute test cases with Linux command line [message #1796816 is a reply to message #1796443] Fri, 19 October 2018 11:50 Go to previous messageGo to next message
le tian is currently offline le tianFriend
Messages: 16
Registered: October 2018
Junior Member

I successfully executed the test case with your method.thank you very much.
Re: How to execute test cases with Linux command line [message #1796817 is a reply to message #1796446] Fri, 19 October 2018 12:09 Go to previous messageGo to next message
le tian is currently offline le tianFriend
Messages: 16
Registered: October 2018
Junior Member
Thank you very much,your advice gave me a lot of inspiration.
Re: How to execute test cases with Linux command line [message #1798199 is a reply to message #1796443] Wed, 14 November 2018 07:02 Go to previous messageGo to next message
le tian is currently offline le tianFriend
Messages: 16
Registered: October 2018
Junior Member
Hello,
Why do I use the ttcn3_start script to start test to produce the following results?
My code is following that:
ttcn3_start ./home/ttcn3/eclipse/workspace/set_rssi/bin/set_rssi /home/ttcn3/eclipse/workspace/set_rssi/SerialPort.cfg
The result is that:
>
The result did not appear in my test results.
Re: How to execute test cases with Linux command line [message #1798200 is a reply to message #1798199] Wed, 14 November 2018 07:28 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi le tian,

please send me the whole console display and any log produced.

Do you you the Eclipse plug-ins as well as teh directory structure would suggest?


try to simplify you command line

go to /bin

simlink SerialPort.cfg into it

ttcn3_start ./set_rssi SerialPort.cfg


BR

Elemer

Previous Topic:DTE: Decoding of integer failed when component stops
Next Topic:Compiler Issues
Goto Forum:
  


Current Time: Thu Apr 25 01:38:52 GMT 2024

Powered by FUDForum. Page generated in 0.03770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top