Commit a02dcf16 authored by balaskoa's avatar balaskoa
Browse files

New testcases have been mapped from titan.core 7.


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
parent b6f76cdb
......@@ -90,6 +90,13 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>src/done</FolderPath>
<FolderProperties>
<CentralStorage>false</CentralStorage>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FolderProperties>
</FolderResource>
<FolderResource>
<FolderPath>src/json</FolderPath>
<FolderProperties>
......
[EXECUTE]
TcommMessage.commMessageDualFacedPorts1
TcommMessage.commMessageDualFacedPorts2
TconfigOper.InterleaveStatem1
TconfigOper.InterleaveStatem2
TconfigOper.InterleaveStatem3
TconfigOper.InterleaveStatem4
TconfigOper.InterleaveStatem5
#TcommMessage.commMessageDualFacedPorts1
#TcommMessage.commMessageDualFacedPorts2
#TconfigOper.InterleaveStatem1
#TconfigOper.InterleaveStatem2
#TconfigOper.InterleaveStatem3
#TconfigOper.InterleaveStatem4
#TconfigOper.InterleaveStatem5
[ORDERED_INCLUDE]
......
......@@ -9,6 +9,9 @@
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
[ORDERED_INCLUDE]
"src/ERC/config.cfg" #fails in single mode, cfg file parse problems, 4 pass in parallel mode
[EXECUTE]
#==acceptance_test:
#testerlanc # exec time: 40sec
......@@ -27,8 +30,8 @@ ProcPort.control #only in parallel, 14 pass
TconfigOper.control #parallel 43 pass, 5 tc commented ot(3 fail, 1 error) #TODO: implement the excluded interleave testcases
#connectMapOperNegTest
ConnectMapOperNegTest #parallel ok 3 pass
[ORDERED_INCLUDE]
#defaultOper:
TdefaultOper #ok,
[MAIN_CONTROLLER]
......
......@@ -23,7 +23,7 @@
#"src/assignmentNotation/TassignmentNotation.cfg" #Verdict Statistics: 0 none (0 %), 7 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
#HACK: escaped double quote added, ass. not. nok Error message:
# Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
"src/ERC/config.cfg" #fails in single mode, cfg file parse problems, 4 pass in parallel mode TODO: cfg parser bug fix
[EXECUTE]
#all_from_with_functions #TODO: JSON enc-dec function handling,
......
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
[ORDERED_INCLUDE]
"src/assignmentNotation/TassignmentNotation.cfg"
#HACK: escaped double quote added, ass. not. nok, Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
### cfgFile ###
#"src/cfgFile/define/macro_reference/TSTM_macro_test_main.cfg" #nok, it went 57 pass but now stops with StackOverflowError
#"src/cfgFile/define/structured/structured.cfg" #TODO: SError while setting parameter field 'tsp_1' to 'a': Referenced module parameter cannot be found. Module `a' does not exist, and no parameter with name `a' exists in any module.
"src/cfgFile/module_parameters/assignment/assignment.cfg" #enum modulepar, 19 pass
"src/cfgFile/module_parameters/concat/concat.cfg" #fixed: record concat, &= in cfg file
#"src/cfgFile/module_parameters/nested/nested.cfg" #TODO; it is simplified and reported in NestedRoI; RT2 bugfix it! Dot notation problem! Reported
#"src/cfgFile/module_parameters/references/references.cfg" #TODO: mp:=mp+1
"src/cfgFile/module_parameters/special_values/SpecialValues.cfg"
#"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
"src/ucharstrOper/config.cfg"
[EXECUTE]
#==acceptance_test==
#chinese
......@@ -90,8 +106,22 @@ TboolOper.control
#ConnectMapOperNegTest #parallel ok 3 pass
TcontrolTimer
#CRTR00015758:
#no.control
no.control
#customEncoding: not implemented codings!
#customEncoding: not implemented codings!
#defaultOper:
#TdefaultOper #ok, parallel
#enumOper:
TenumOper.control
EnumDefBitHexOct
#ERC: see in [ORDERED_INCLUDE]
#floatOper:
#TfloatOper
#TfloatOperSpecial
#functionReference:
#FuncRef
#json (There are testcases commented out in it!! In preinit of JsonTypes it stops with exception)
#AttributeTestcases.control
......@@ -162,6 +192,7 @@ RAW_integer_test
ustr.control
RAWCodingAttributes.control
#cont here ....
#ucharstrOper #pass, see in [ORDERED_INCLUDE] "src/ucharstrOper/config.cfg"
#################
......@@ -189,10 +220,7 @@ ThexstrOper.control
TunionOper.control
TrecordOper.control
TenumOper.control
TanytypeOper.control
TfloatOper.control
TbitstrOper.control
TobjidOper.control
#imported_templates.control
TsetOper.control
......@@ -205,7 +233,6 @@ TtemplateUnion.control
TarrayOper.control
#everything.control
#types.control
TdefaultOper.control
TlostTimer.control
#TtemplateRecAsn.control
TtemplateSet.control
......@@ -214,23 +241,6 @@ TtemplateRecof.control
TanytypeWrapOper.control
#ImportedTemplates.control
TsetofOper.control
[ORDERED_INCLUDE]
"src/assignmentNotation/TassignmentNotation.cfg"
#HACK: escaped double quote added, ass. not. nok, Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
### cfgFile ###
#"src/cfgFile/define/macro_reference/TSTM_macro_test_main.cfg" #nok, it went 57 pass but now stops with StackOverflowError
#"src/cfgFile/define/structured/structured.cfg" #TODO: SError while setting parameter field 'tsp_1' to 'a': Referenced module parameter cannot be found. Module `a' does not exist, and no parameter with name `a' exists in any module.
"src/cfgFile/module_parameters/assignment/assignment.cfg" #enum modulepar, 19 pass
"src/cfgFile/module_parameters/concat/concat.cfg" #fixed: record concat, &= in cfg file
#"src/cfgFile/module_parameters/nested/nested.cfg" #TODO; it is simplified and reported in NestedRoI; RT2 bugfix it! Dot notation problem! Reported
#"src/cfgFile/module_parameters/references/references.cfg" #TODO: mp:=mp+1
"src/cfgFile/module_parameters/special_values/SpecialValues.cfg"
#"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
"src/ucharstrOper/config.cfg"
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
......
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Raduly, Csaba
#
###############################################################################
[LOGGING]
LogFile:="e=%e,h=%h,l=%l,n=%n,r=%r,t=%t,c=%c,s=.%s"
LogEventTypes := Detailed
AppendFile := yes
[EXECUTE]
no.control
#!/usr/bin/perl -w
use strict;
# No use warnings; in 5.005 but we have the -w flag
my @expected_filenames;
BEGIN { # @expected_filenames must be set at compile time
my $host = $ENV{HOSTNAME} || $ENV{HOSTNAME} || `hostname`;
$host =~ s/\r|\n//g;
$host =~ s/\.\S+//;
my $user = $ENV{USER} || $ENV{USERNAME};
@expected_filenames = (
"e=no,h=$host,l=$user,n=HC,r=hc,t=,c=,s=\.log",
"e=no,h=$host,l=$user,n=MTC,r=mtc,t=,c=,s=\.log",
"e=no,h=$host,l=$user,n=MTC,r=mtc,t=,c=tc_nooooo,s=\.log",
"e=no,h=$host,l=$user,n=MTC,r=mtc,t=,c=tc_no,s=\.log",
"e=no,h=$host,l=$user,n=MTC,r=mtc,t=No,c=tc_nooooo,s=\.log",
"e=no,h=$host,l=$user,n=MTC,r=mtc,t=No,c=tc_no,s=\.log",
"c=,s=.log",
"c=tc_nooooo,s=\.log",
"c=tc_no,s=\.log",
);
}
if ($] < 5.006) {
# ancient perl, we must be on Solaris :(
my @perlloc = qw( /proj/TTCN/Tools/perl-5.10.1/bin/perl /mnt/TTCN/Tools/perl-5.10.1/bin/perl );
foreach (@perlloc) {
if (-x $_) {
warn "Let's try with $_ instead";
exec( $_, '-wT', $0, @ARGV ) or die "That didn't work either: $!";
}
}
}
else {
require Test::More;
use constant NUM_LOGFILES => scalar @expected_filenames;
Test::More->import(
tests =>
1 # test number of log files
+ 2 * NUM_LOGFILES # test existence + switched/not switched
+ 1 # Local IP address warning
+ 1 # Non-unique log file name warning
);
}
use strict;
# grep a file. Returns the number of times (lines) it matched.
# Parameter 1: filename
# Parameter 2: regex
sub grepper($$) {
local $_;
my ($filename, $regex) = @_;
my $result = 0;
open (LOG, '< ' . $filename) or die "open : $!, $^E";
while (<LOG>) {
if ( /$regex/ ) {
++$result;
}
}
close(LOG) or die "close: $!, $^E";
return $result;
}
# Return 1 if "switching to log file" appears in the file.
# One parameter, the file name
sub switched($) {
return grepper($_[0], qr/EXECUTOR_RUNTIME [sS]witching to log file/) != 0;
}
# Start !
# Collect the list of log files on the disk. There are two patterns.
my @files = <e=no,h=*,l=*,n={HC\,r=hc,MTC\,r=mtc},*.log>;
push @files , <c=*.log>;
# Check that it is the correct number
is(scalar @files, NUM_LOGFILES, 'Number of log files');
foreach my $x ( @expected_filenames )
{
# Filter the list of filenames, keep just the matching ones
my @g = grep($_ =~ /^$x$/, @files);
# There must be exactly one match
is(scalar @g, 1, "Found : $x");
}
foreach my $fn ( @files )
{
chomp $fn;
if ($fn =~ /^e=no,h=[\w.-]+,l=\w+,n=HC,r=hc,t=,c=,s=\.log$/ ) {
ok( !switched($fn), "Not switched : $fn" );
is( grepper($fn, qr/The address of MC was set to a local IP address\. This may cause incorrect behavior/), 1,
"Local IP warn: $fn" );
}
else {
ok( switched($fn), "Switched : $fn" );
}
if ($fn =~ /^c=,s=.log$/) {
is( grepper($fn, qr/does not guarantee unique log file name for every test system process/), 1,
"Warns once : $fn\n(about log file name not being unique)" );
}
}
__END__
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Raduly, Csaba
*
******************************************************************************/
module no {
type component No {}
testcase tc_no() runs on No
{
timer boredom := 0.3;
boredom.start;
boredom.timeout;
log("nothing to see here either");
setverdict(pass);
}
testcase tc_nooooo() runs on No
{
timer boredom := 0.5;
boredom.start;
boredom.timeout;
log("Do not want");
setverdict(pass);
}
control {
log("Nothing to see here");
execute(tc_no());
execute(tc_nooooo());
execute(tc_no());
}
}
with {
extension "version R2D2";
}
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Raduly, Csaba
#
###############################################################################
# Good for manual running of mctr_cli
[INCLUDE]
"config.cfg"
[MAIN_CONTROLLER]
NumHCs := 1
TCPPort := 31415
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Raduly, Csaba
#
###############################################################################
[LOGGING]
# A log file without %h and at least one of {%p,%r} is ambiguous.
# The runtime should warn only once, and most definitely
# should _not_ go into infinite recursion.
LogFile := "c=%c,s=.%s"
LogEventTypes := Detailed
AppendFile := yes
[EXECUTE]
no.control
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Raduly, Csaba
# Szabados, Kristof
#
###############################################################################
[DEFINE]
string := "charstring"
binary_string := "binary_octet"
[INCLUDE]
//cyclic include
#"config.cfg" #TODO: report !
[MODULE_PARAMETERS]
m_base_float := ${four, float}
m_base_string := $base & "_" & $string
m_base_integer := 4
m_base_bitstring := '11001100'B
m_base_hexstring := '0F0F'H
m_base_octetstring := 'F0F0'O
m_base_binaryoctet := ${binary_string, binaryoctet}
m_base_array := {{1,1},{${two, integer},2},{3,${three, integer}},{4,4}}
[DEFINE]
base := base
[DEFINE]
//these will be used in included1.cfg
two := 2
one := 1.0
four := 4.0
three := 3
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Szabados, Kristof
#
###############################################################################
[DEFINE]
many_F := "FFFF"
some_F := "FF"
identifier := "Monday"
module := module
/*akarmi*/
create := "create"
result := "true"
env_test = "variable" #hack, this should be an environment variable
[MODULE_PARAMETERS]
m_float1 := 1.0
m_boolean1 := ${result, boolean}
m_days := ${identifier, identifier}
m_string1 := $string
m_integer1 := 1
m_bitstring1 := '00001111'B
m_hexstring1 := ${many_F, hexstring}
m_octetstring1 := ${many_F, octetstring}
m_env_test := $env_test
ttcn_keyword1 := $module
ttcn_keyword2 := ${create, charstring}
m_array1 := {
{1, 1},
{2, 2},
{3, 3},
-}
m_array2 := {
{1, 1},
{2, 2},
{3, 3},
{4, 4}
}
[INCLUDE]
"included1.cfg"
"included2.cfg"
//testing if configs from other directories can be included
"subdir/subdir_config.cfg"
"included1.cfg"
//testing if the same file can be included several times
[EXECUTE]
erc.control
//saved by GUI
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Szabados, Kristof
*
******************************************************************************/
module erc
{
type enumerated days { Monday, Tuesday, Wednesday, Thursday, Friday};
modulepar float m_float1;
modulepar boolean m_boolean1;
modulepar days m_days;
modulepar charstring m_string1;
modulepar integer m_integer1;
modulepar bitstring m_bitstring1;
modulepar hexstring m_hexstring1;
modulepar octetstring m_octetstring1;
modulepar charstring m_env_test;
type integer mysubarray1[2];
type mysubarray1 mysubarray2[4];
modulepar mysubarray2 m_array1;
template mysubarray2 t_array1 := {{1,1},{2,2},{3,3},?}
type integer mysubarray3[4][2];
modulepar mysubarray3 m_array2;
template mysubarray3 t_array2 := {{1,1},{2,2},{3,3},{4,4}};
modulepar float m_included1_float;
modulepar octetstring m_included1_binaryoctet;
modulepar charstring m_included1_string;
modulepar integer m_included1_integer;
modulepar bitstring m_included1_bitstring;
modulepar hexstring m_included1_hexstring;
modulepar octetstring m_included1_octetstring;
modulepar float m_included2_float;
modulepar octetstring m_included2_binaryoctet;
modulepar charstring m_included2_string;
modulepar integer m_included2_integer;
modulepar bitstring m_included2_bitstring;
modulepar hexstring m_included2_hexstring;
modulepar octetstring m_included2_octetstring;
modulepar float m_base_float;
modulepar octetstring m_base_binaryoctet;
modulepar charstring m_base_string;
modulepar integer m_base_integer;
modulepar bitstring m_base_bitstring;
modulepar hexstring m_base_hexstring;
modulepar octetstring m_base_octetstring;
modulepar mysubarray3 m_base_array;
modulepar{
charstring ttcn_keyword1,ttcn_keyword2;
}
type component empty_comp{};
testcase test_own_config() runs on empty_comp
{
if(m_float1 == 1.0){setverdict(pass);}
else{setverdict(fail);}
if(m_boolean1 == true){setverdict(pass);}
else{setverdict(fail);}
if(m_days == Monday){setverdict(pass);}
else{setverdict(fail);}
if(m_string1 == "charstring"){setverdict(pass);}
else{setverdict(fail);}
if(m_integer1 == 1){setverdict(pass);}
else{setverdict(fail);}
if(m_bitstring1 == '00001111'B){setverdict(pass);}
else{setverdict(fail);}
if(m_hexstring1 == 'FFFF'H){setverdict(pass);}
else{setverdict(fail);}
if(m_octetstring1 == 'FFFF'O){setverdict(pass);}
else{setverdict(fail);}
if(m_env_test == "variable"){setverdict(pass);}
else{setverdict(fail);}
if(match(m_array1,t_array1)){setverdict(pass);}
else{setverdict(fail);}
if(match(m_array2,t_array2)){setverdict(pass);}
else{setverdict(fail);}
if(ttcn_keyword1 == "module"){setverdict(pass);}
else{setverdict(fail);}
if(ttcn_keyword2 == "create"){setverdict(pass);}
else{setverdict(fail);}
}
testcase test_included1_config() runs on empty_comp
{
if(m_included1_float == 2.0){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_binaryoctet == '62696E617279'O){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_string == "included1_charstring"){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_integer == 2){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_bitstring == '11110000'B){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_hexstring == '0000'H){setverdict(pass);}
else{setverdict(fail);}
if(m_included1_octetstring == '0000'O){setverdict(pass);}
else{setverdict(fail);}
}
testcase test_included2_config() runs on empty_comp
{
if(m_included2_float == 3.0){setverdict(pass);}
else{setverdict(fail);}
if(m_included2_binaryoctet == '32'O){setverdict(pass);}
else{setverdict(fail);}
if(m_included2_string == "included2_charstring"){setverdict(pass);}
else{setverdict(fail);}
if(m_included2_integer == 3){setverdict(pass);}
else{setverdict(fail);}
if(m_included2_bitstring == '00110011'B){setverdict(pass);}
else{setverdict(fail);}
if(m_included2_hexstring == '00FF'H){setverdict(pass);}