common/tools/ats/smoketest/SmokeTest.pm
author Chetan Kapoor <chetank@symbian.org>
Tue, 31 Aug 2010 15:28:38 +0100
changeset 1233 3df3f73a7802
parent 872 17498133d9ad
permissions -rw-r--r--
Merge He 9 Fix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
117
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     2
# All rights reserved.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 117
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
117
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 117
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
117
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     7
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    10
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    11
# Contributors:
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    12
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    13
# Description:
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    14
# SmokeTestSuite.pm 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    15
# The SmokeTestSuite package contains subroutines that are needed to build a 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    16
# testdriver test suite.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    17
# This script was born on 18/04/2005
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    18
# 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    19
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    20
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    21
#!/usr/bin/perl -w
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    22
package SmokeTest;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    23
use SmokeTestROM;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    24
use SmokeTestSuite;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    25
use FindBin;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    26
use lib "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    27
use FileRead; #Need to include a Findbin::path
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    28
use strict;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    29
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    30
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    31
# Global Variables
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    32
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    33
our $BuildDir = $ENV{'BuildDir'}; # usually M:
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    34
our $serverpool = $ENV{'SmokeTestServerPool'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    35
our $buildNo = $ENV{'BuildShortName'}; # Eg. 9.1
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    36
# The Client is run from the dir where SmokeTestClient.pl is located
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    37
# This is to ensure that any ROMs and test packages created are stored there.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    38
our $sourceDir = "$BuildDir\\src\\common\\testtools";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    39
our $TestSuite = "SmokeTest";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    40
our $SmokeTestDir;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    41
our $NandDir;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    42
our $TestDriverLocation   = "\\epoc32\\tools\\TDEP";   # location for TD zips
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    43
our $TestDriverDrive = "M:";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    44
our $TestDriverCmd = "$TestDriverDrive\\testdriver\\testdriver.cmd";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    45
our $TestDriverXML;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    46
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    47
# Publish details
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    48
our $PublishServer = $ENV{'PublishLocation'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    49
our $ProductType   = $ENV{'Type'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    50
our $BuildNum      = $ENV{'BuildNumber'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    51
our $LogsDir       = $ENV{'LogsDir'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    52
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    53
# Epocwind.out
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    54
my $tempDirLocation = $ENV{'TEMP'};
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    55
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    56
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    57
# CheckVars: ensures that the essential environment vars and directories exist
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    58
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    59
sub CheckVars
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    60
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    61
	print "\n** Settings **\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    62
	print "Build Drive                = $BuildDir\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    63
	print "Smoke Test Server Pool     = $serverpool\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    64
	print "Build Product              = $buildNo\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    65
	print "TestDriver Zip Location    = $TestDriverLocation\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    66
	print "TestDriver XML Location    = $TestDriverXML\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    67
	print "TestDriver Source Location = $sourceDir\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    68
	print "TestDriver Drive           = $TestDriverDrive\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    69
	print "SmokeTest working directory= $SmokeTestDir\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    70
	print "NAND build directory       = $NandDir\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    71
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    72
	print "\n** Publishing Information **\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    73
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    74
	print "Publish server = $PublishServer\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    75
	print "Product Type   = $ProductType\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    76
	print "Build Number   = $BuildNum\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    77
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    78
	DieLog("CheckVars: \"Build Directory\" not defined") if !defined $BuildDir;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    79
	DieLog("CheckVars: \"Smoke Test Server Pool\" not defined") if !defined $serverpool;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    80
	DieLog("CheckVars: \"Build Product\" not defined") if !defined $buildNo;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    81
	DieLog("CheckVars: \"Publish server\" not defined") if !defined $PublishServer;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    82
	DieLog("CheckVars: \"Product Type\" not defined") if !defined $ProductType;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    83
	DieLog("CheckVars: \"Build Number\" not defined") if !defined $BuildNum;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    84
	DieLog("CheckVars: Directory \"SmokeTest working directory\" does not exist") if ! -e $SmokeTestDir;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    85
	DieLog("CheckVars: Directory \"TestDriver Zip Location\" does not exist") if ! -e $TestDriverLocation;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    86
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    87
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    88
sub main
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    89
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    90
	print "\n\n*** START OF SMOKE TEST ***\n\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    91
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    92
	PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    93
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    94
	my ($iSourceDir,       $iTestSuite,   $iProduct, $iServerPool, $iProductType,
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    95
	    $iPublishLocation, $iBuildNumber, $iXML,     $iUnzip,      $iBuildDrive, $iTDDrive) = @_;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    96
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    97
	$TestSuite       = $iTestSuite           if defined $iTestSuite;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    98
	$BuildDir        = $iBuildDrive          if defined $iBuildDrive;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    99
	$sourceDir       = $BuildDir.$iSourceDir if defined $iSourceDir;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   100
	$buildNo         = $iProduct             if defined $iProduct;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   101
	$serverpool      = $iServerPool          if defined $iServerPool;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   102
	$ProductType     = $iProductType         if defined $iProductType;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   103
	$PublishServer   = $iPublishLocation     if defined $iPublishLocation;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   104
	$BuildNum        = $iBuildNumber         if defined $iBuildNumber;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   105
	$TestDriverDrive = $iTDDrive             if defined $iTDDrive;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   106
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   107
	$SmokeTestDir    = "$sourceDir\\$TestSuite";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   108
	if (defined $iXML)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   109
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   110
		$TestDriverXML = $iXML;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   111
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   112
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   113
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   114
		$TestDriverXML = $SmokeTestDir."\\xml";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   115
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   116
	$NandDir = "$BuildDir\\src\\cedar\\generic\\base\\e32\\rombuild";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   117
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   118
	CheckVars();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   119
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   120
	# change dir to Smoketest dir
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   121
	chdir "$SmokeTestDir" or DieLog("Can't cd to $SmokeTestDir");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   122
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   123
	# unzip latest version of TD
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   124
	if (defined $iUnzip)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   125
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   126
		unpackTestDriver2();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   127
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   128
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   129
	# configure TD
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   130
	configureTestDriver2();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   131
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   132
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   133
	# Copy the correct configuration.cfg file
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   134
	# But such source only exists for these products: 8.0a, 8.0b, 8.1a, 8.1b, 9.0, 9.1
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   135
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   136
	print "\n#\n# Copy the correct configuration.cfg file\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   137
	ExecCommand("COPY /Y $SmokeTestDir\\Group\\$buildNo\\configuration.cfg $SmokeTestDir\\Group\\configuration.cfg");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   138
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   139
	#Read in hash of smoketests to be run for each product.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   140
	my ($iCfgFileLocation) = "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   141
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   142
	#Read in the smoketest list from a cfg file
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   143
	my $text = &FileRead::file_read ("$iCfgFileLocation\\Product.cfg");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   144
	#Search for an entry matching (At the beginning of line there should be 1 or more alphanumberic chars
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   145
	#Followed by a "."(optional to allow codenames) followed by more alphanumberic chars followed by 0 or more spaces then an = then 0
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   146
	#or more spaces then any amount of chars till the end of the line.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   147
	#8.1b = EMULATOR_WINSCW ARM4_LUBBOCK ARMV5_LUBBOCK
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   148
	my %iProducts = $text =~ /^\s*(\w+\.?\w+)\s*=\s*(.+)$/mg ;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   149
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   150
	#Get the list of platforms to be smoketested for the product.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   151
	#Need to turn the hash value into an array using split
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   152
	my @iPlatforms = split (/ /,$iProducts{$buildNo});
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   153
	#Build and Execute Test package for each platform as read from configuration file and create and zip rom.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   154
	ProcessPlatforms (@iPlatforms);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   155
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   156
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   157
	# Build Test Package for ROMs
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   158
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   159
	if ($buildNo eq '8.1a' || $buildNo eq '8.1b')
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   160
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   161
		&SmokeTestSuite::BuildAndPackage("ARM4");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   162
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   163
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   164
	if ($buildNo ne '8.1a')
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   165
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   166
		&SmokeTestSuite::BuildAndPackage("ARMv5");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   167
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   168
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   169
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   170
	# Find out which server to use
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   171
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   172
	print "\n#\n# Find out which server to use\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   173
	ProcessPlatformsforSmoketest(@iPlatforms);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   174
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   175
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   176
	# End of Smoke Test
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   177
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   178
	print "\n\n*** END OF SMOKE TEST ***\n\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   179
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   180
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   181
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   182
# DieLog: Exits script and inserts a Remark in the build log, which will be picked up by htmlscanlog
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   183
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   184
sub DieLog
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   185
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   186
	die "\nREMARK: $_[0]\n $!\n\n\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   187
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   188
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   189
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   190
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   191
# Build and publish based on entries in the Product.cfg file
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   192
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   193
sub ProcessPlatforms 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   194
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   195
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   196
my $i = 0;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   197
my @temp;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   198
my @iPlatforms = @_;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   199
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   200
foreach my $platform (@iPlatforms)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   201
 {  
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   202
  undef @temp;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   203
  @temp = split (/_/,$iPlatforms[$i]);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   204
  $i++;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   205
  
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   206
  if( $temp[0] eq "EMULATOR")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   207
  {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   208
	&SmokeTestSuite::BuildAndPublish("$temp[1]");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   209
	CheckPlatsecErrors("$temp[1]");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   210
  }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   211
  else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   212
  {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   213
		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   214
	if(3 == scalar(@temp)) # there are 3 arguments, so this will be a NAND ROM
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   215
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   216
		if((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand\(dp\)" )) # H4HRP Demand Paging ROM options is -D_NAND2
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   217
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   218
			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "pagedrom", "PlatSec", "$buildNo", "-D_NAND2" );
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   219
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   220
		elsif((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand" )) # H4 options is -D_NAND2
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   221
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   222
			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   223
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   224
		elsif(lc($temp[1]) eq "h2") # H2 options is -D_NAND# H2 option is NAND2 due to CR 0844 (Both H2 and H4 use -D_NAND2)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   225
                {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   226
			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   227
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   228
		else	# Bad option entered
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   229
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   230
			die "SmokeTest::ProcessPlatforms error: invalid board type entered: $temp[1]. Check that Product.cfg is correct.\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   231
		}		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   232
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   233
	else # This is the NOR ROM.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   234
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   235
		&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   236
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   237
  }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   238
  
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   239
 }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   240
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   241
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   242
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   243
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   244
# Build and publish based on entries in the Product.cfg file
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   245
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   246
sub ProcessPlatformsforSmoketest
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   247
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   248
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   249
my $i = 0;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   250
my @temp;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   251
my @iPlatforms = @_;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   252
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   253
foreach my $platform (@iPlatforms)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   254
 {  
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   255
    undef @temp;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   256
    @temp = split (/_/,$iPlatforms[$i]);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   257
    $i++;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   258
    if( $temp[0] eq "EMULATOR")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   259
    {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   260
        next;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   261
    }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   262
	my $mServ = &SmokeTestSuite::PollServers("$temp[1]");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   263
	unless (defined $mServ)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   264
    {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   265
        next;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   266
    }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   267
	if(3 == scalar(@temp))
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   268
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   269
		if(lc($temp[2]) eq "nand\(dp\)" ) 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   270
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   271
		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\(DP\)\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   272
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   273
        elsif(lc($temp[2]) eq "nand") 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   274
	    {
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   275
		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   276
	    }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   277
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   278
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   279
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   280
		&SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   281
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   282
 }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   283
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   284
 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   285
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   286
# Check for platsec errors - checks the epocwind.out on build machine
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   287
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   288
sub CheckPlatsecErrors
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   289
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   290
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   291
	print "#\n# Check for platsec errors\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   292
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   293
	PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   294
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   295
	# open epocwind.out and parse for both errors and warnings
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   296
	open EPOCWIND, "$tempDirLocation\\epocwind.out" or print "\nERROR: Cannot open EPOCWIND.OUT\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   297
	my @epocWind = <EPOCWIND>;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   298
	close EPOCWIND;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   299
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   300
	foreach my $tempEW (@epocWind)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   301
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   302
		if ($tempEW =~ m/(\*PlatSec\* ERROR)(.*)/i)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   303
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   304
			print "\nERROR: $_[0] - $1$2";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   305
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   306
		elsif ($tempEW =~ m/(\*PlatSec\* WARNING)(.*)/i)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   307
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   308
			print "\nWARNING: $_[0] - $1$2";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   309
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   310
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   311
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   312
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   313
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   314
# Take TestDriver and unpack into a given location.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   315
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   316
sub unpackTestDriver2()
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   317
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   318
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   319
	# Unzip TestDriver
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   320
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   321
	print "\n#\n# Unzip TestDriver\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   322
	PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   323
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   324
	# first remove the "old" version of test driver
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   325
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   326
	ExecCommand("RMDIR $TestDriverDrive\\testdriver\\ /Q /S");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   327
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   328
	# now unzip the latest version of testdriver which has been synced down
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   329
	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe $TestDriverLocation\\TestDriver2.zip -d $TestDriverDrive\\testdriver\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   330
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   331
	# now copy the latest version of testdriver_new.cmd which has been obtained
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   332
	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver_new.cmd  $TestDriverCmd");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   333
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   334
	# now copy the latest version of logging.properties which has been obtained
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   335
	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\logging.properties  $TestDriverDrive\\testdriver\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   336
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   337
    # 11-08-08 - additional steps required for SITK1.2 version of TD2
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   338
    ExecCommand("MKDIR $TestDriverDrive\\testdriver\\eclipse\\links\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   339
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   340
    ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver.link $TestDriverDrive\\testdriver\\eclipse\\links\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   341
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   342
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   343
	# Unzip JRE v1.5
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   344
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   345
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   346
	print "#\n# Unzip JRE 1.5 required by TestDriver v2\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   347
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   348
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   349
	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe \\\\builds01\\devbuilds\\BuildPCs\\Software\\JDK1.5.0_13\\jre1.5.zip -d $TestDriverDrive\\testdriver\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   350
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   351
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   352
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   353
sub configureTestDriver2()
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   354
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   355
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   356
	# Configure TestDriver
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   357
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   358
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   359
	print "#\n# Configure TestDriver\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   360
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   361
	my $localtimes = localtime;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   362
	PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   363
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   364
	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -e $BuildDir\\
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   365
								-x $TestDriverXML
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   366
								-l $TestDriverDrive\\TestDriver\\Results
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   367
								--source $sourceDir
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   368
								-s smoketest
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   369
								-r $TestDriverDrive\\TestDriver\\Repos
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   370
								-c $TestDriverDrive\\TestDriver\\Results");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   371
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   372
	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --commdb overwrite");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   373
	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --bldclean off");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   374
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   375
	# platsec for > 9.x only
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   376
	if ($buildNo ne "8.1a" && $buildNo ne "8.1b")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   377
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   378
		ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -p ON");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   379
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   380
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   381
	# Setup commdb for WINSCW smoketest
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   382
	print "\n*** Setup commdb for WINSCW to use WinTAP ***\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   383
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   384
	# export smoketest_commdb.xml to a place that ced.exe can see it
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   385
	ExecCommand("copy $SmokeTestDir\\smoketest_commdb.xml $BuildDir\\epoc32\\WINSCW\\c\\");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   386
	ExecCommand("$BuildDir\\epoc32\\release\\WINSCW\\udeb\\ced.exe c:\\smoketest_commdb.xml");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   387
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   388
	print "\n*** Confirm TestDriver Config ***\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   389
	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   390
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   391
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   392
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   393
# ExecCommand
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   394
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   395
# Execute a system command, having first echoed it. Display and return the output of the command.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   396
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   397
# Input: Command string (without final newline)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   398
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   399
# Output: Command output (including STDERR) to STDOUT
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   400
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   401
# Return: Command output (including STDERR)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   402
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   403
sub ExecCommand
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   404
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   405
    my $iCmd = shift;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   406
    print "\n================================================================\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   407
    print "Command: $iCmd\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   408
    print   "----------------------------------------------------------------\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   409
    my $iRet = `$iCmd 2>&1`;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   410
    chomp $iRet;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   411
    print "Return:  $iRet\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   412
    print   "================================================================\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   413
    return $iRet;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   414
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   415
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   416
# PrintDateTime
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   417
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   418
# Print to STDOUT, Current Date and Time
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   419
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   420
# Input: none
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   421
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   422
# Output: text to STDOUT
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   423
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   424
sub PrintDateTime
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   425
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   426
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   427
    #### my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   428
    $year += 1900;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   429
    $mon += 1;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   430
	printf "\n*** Current Time: %04d/%02d/%02d %02d:%02d:%02d ***\n", $year,$mon,$mday,$hour,$min,$sec;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   431
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   432
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   433
1;