common/tools/ats/smoketest/SmokeTestSuite.pm
author Maciej Seroka <maciejs@symbian.org>
Fri, 02 Oct 2009 12:17:26 +0100
changeset 568 a1d3b0c3227b
parent 117 483f966c6335
child 872 17498133d9ad
permissions -rw-r--r--
Device NAME removed
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
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Symbian Foundation License v1.0"
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
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
# 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
    15
# testdriver test suite.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    16
# This script was born on 18/04/2005
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    17
# 
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
#!/usr/bin/perl -w
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    21
package SmokeTestSuite;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    22
use strict;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    23
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    24
my $servicename;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    25
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    26
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    27
# BuildAndPackage: Used to create a test package for remote execution on the ROM
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    28
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    29
sub BuildAndPackage
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
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    32
	# Build Test Package for $_[0]
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    33
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    34
	print "\n#\n# Build Test Package for $_[0]\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    35
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    36
	my $testbuild = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    37
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    38
	# now check for results
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    39
	$testbuild =~ m/fail\:\s(\d+)\s\%/i;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    40
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    41
	if ( ($testbuild =~ m/\*\*error\:/i) || $1 == 100 )
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    42
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    43
		print "\nREMARK: Smoke Test *** Building the Test failed $!\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    44
		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    45
	} 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    46
	else 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    47
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    48
		print "\n*** Test Building successful ***\n";	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    49
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    50
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    51
	SmokeTest::PrintDateTime();
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
	my $testpackage = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd package -p $_[0] -b udeb -s $SmokeTest::TestSuite --tp $SmokeTest::SmokeTestDir\\$_[0].tpkg");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    54
	print "\n";
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
	if (($testpackage =~ m/\*\*error/i))
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    57
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    58
		print "\nREMARK: Smoke Test *** Building the Test Package failed\n\"$1\"\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    59
		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test Package failed");
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
	else 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    62
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    63
		print "\n*** Building the Test Package successful ***\n";	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    64
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    65
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    66
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    67
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    68
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    69
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    70
# BuildAndPublish: used to build and test the smoketest test suite on an Emulator
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
sub BuildAndPublish
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
	my $runid = 0;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    75
	my $buildname;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    76
	
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
	# Build Test Suite for $_[0]
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    79
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    80
	print "\n#\n# Build Test Suite for $_[0]\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    81
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    82
	my $testbuildwinscw = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    83
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    84
	# now check for results
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    85
	$testbuildwinscw =~ m/fail\:\s(\d+)\s\%/i;
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
	if ( ($testbuildwinscw =~ m/\*\*error\:/i) || $1 == 100 )
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    88
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    89
		print "\nREMARK: Smoke Test *** Building the Test for $_[0] failed $!\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    90
		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
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
	else 
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
		print "\n*** Test Build successful ***\n";	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    95
	}
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
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    98
	# Run Test Suite for $_[0]
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
    99
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   100
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   101
	print "#\n# Run Test Package for $_[0]\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   102
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   103
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   104
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   105
	SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd run -p $_[0] -b udeb -s $SmokeTest::TestSuite");
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
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   108
	
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
	# Publish results of emulator onto publish server
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
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   113
	print "#\n# Publish results of emulator onto publish server\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   114
	print "\n";
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
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   117
	# Find the correct directory to publish
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   118
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   119
	my $source = "$SmokeTest::TestDriverDrive\\TestDriver\\Results";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   120
	if (opendir Results, $source)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   121
	{	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   122
		my @dirArray = readdir(Results);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   123
		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   124
		#print "@results";	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   125
		# to remove "." and ".." from this list
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   126
		shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   127
		shift @dirArray;
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
		if (!scalar(@dirArray))
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   130
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   131
			print "REMARK: The emulator for $_[0] has an empty $source directory";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   132
			return;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   133
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   134
		else
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 "\nContents of $source = @dirArray\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   137
			$source .= "\\$dirArray[0]"; 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   138
			# dirArray should always have just the one subdir - 0XXXX_Symbian_OS_vX.X
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   139
			
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   140
			$buildname = $dirArray[0];
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
			if (opendir tempDir, "$source")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   143
			{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   144
				# to remove "." and ".." from this list
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   145
				@dirArray = readdir(tempDir);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   146
				shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   147
				shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   148
				
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   149
				print "\nContents of $source = @dirArray\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   150
				
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   151
				foreach my $directory (@dirArray)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   152
				{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   153
					if ($directory =~ /(?:$_[0])/i)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   154
					{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   155
						$source .= "\\$directory";
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
						# added this to remove udeb/xx
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   158
						if (opendir tempDir, "$source")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   159
						{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   160
							# to remove "." and ".." from this list
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   161
							@dirArray = readdir(tempDir);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   162
							shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   163
							shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   164
				
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   165
							print "\nContents of $source = @dirArray\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   166
				
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   167
							foreach my $directory (@dirArray)
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
								if ($directory =~ /(udeb|urel)/i)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   170
								{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   171
									$source .= "\\$directory";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   172
									if (opendir tempDir, "$source")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   173
									{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   174
										# to remove "." and ".." from this list
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   175
										@dirArray = readdir(tempDir);
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   176
										shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   177
										shift @dirArray;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   178
				
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   179
										print "\nContents of $source = @dirArray\n";
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
										my @iNumericDirList = ();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   182
										foreach my $directory (@dirArray)
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
											if ($directory =~ /(^[0-9]+)/i)
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
    											push @iNumericDirList, $directory;
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
									    @iNumericDirList = sort { $b <=> $a } @iNumericDirList;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   190
									    $runid = $iNumericDirList[0];
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   191
                                        $source .= "\\$runid";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   192
									    last;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   193
									}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   194
									last;
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
							}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   197
						}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   198
						
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
				}
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
				print "\nThe final source directory = $source\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   203
			}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   204
			else
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
				print "REMARK: The emulator for $_[0] has an empty $source directory";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   207
				return;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   208
			}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   209
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   210
		my $emulatorpublish = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\SmokeTest\\Emulator\\$_[0]";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   211
		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   212
		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
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
		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source\\xml $emulatorpublish\\xml\\");
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
		#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   217
		# Copy runXX_<snapshot>_SymbianOS_vYY.xml/html to <snapshot>_Symbian_OS_vYY.xml/html
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   218
		#
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
		my $xmlfile   = "$source\\run".$runid."_".$buildname."\.xml";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   221
		my $htmlfile  = "$source\\run".$runid."_".$buildname."\.html";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   222
		
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   223
		if (-e $xmlfile)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   224
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   225
			SmokeTest::ExecCommand ("COPY $xmlfile $emulatorpublish\\$buildname.xml");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   226
		}
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
		if (-e $htmlfile)
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
			SmokeTest::ExecCommand ("COPY $htmlfile $emulatorpublish\\$buildname.html");
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
		#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   234
		# Publish results of emulator onto logs dir
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   235
		#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   236
		print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   237
		print "#\n# Publish results of emulator onto Logs Dir\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   238
		print "\n";
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
		my $emulatorpublish = "$SmokeTest::LogsDir\\SmokeTest\\Emulator\\$_[0]\\";
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
		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
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
		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source $emulatorpublish");
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
	else
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
		print "REMARK: Cannot open dir $source: $!";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   249
		return;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   250
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   251
	SmokeTest::PrintDateTime();
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
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
# PollServers: Polls all the servers from the Pool and picks out the one with the shortest queue.
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   256
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   257
sub PollServers
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   258
{
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
	# Parse ENV and create an array of smoketest servers for $_[0]
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
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   263
	print "#\n# Parse ENV and create an array of smoketest servers for $_[0]\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   264
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   265
	SmokeTest::PrintDateTime();
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 (($_[0] eq "Lubbock") || ($_[0] eq "LUBBOCK"))
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
		$SmokeTest::servicename = "RemoteTestDriverLubbock";
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
	elsif ($_[0] eq "H2")
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
		$SmokeTest::servicename = "RemoteTestDriverH2";
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
        elsif ($_[0] eq "H4HRP")
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
		$SmokeTest::servicename = "RemoteTestDriverH4HRP";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   278
	} 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   279
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   280
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   281
		&SmokeTest::DieLog("Cannot poll serverpool for pool \"$_[0]\"");
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
	my @servers = split /\#/, $SmokeTest::serverpool;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   285
	if (@servers < 1)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   286
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   287
		&SmokeTest::DieLog("*** Error In Smoke Test ***\nNo SmokeTest Servers specified for $_[0]$!\n");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   288
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   289
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   290
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   291
		print "\n*** Retrieved Pool of Smoke Test Servers from ENV for $_[0]***\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   292
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   293
	
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
	# Poll each of the smoke test servers and parse the results
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   296
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   297
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   298
	print "#\n# Poll each of the smoke test servers and parse the results\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   299
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   300
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   301
	my %serverlist;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   302
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   303
    print "Checking TestDriver Version\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   304
    SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd version");
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
	foreach my $server (@servers)
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 "Polling Server: $server\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   309
        my $masterstatus = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd masterstatus --srv //$server/$SmokeTest::servicename");
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
		my $value = -2;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   312
		if ($masterstatus =~ m/Master: TestDriver is currently (....)/i)
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
			if ($1 eq 'free')
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
				#print "Free!\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   317
				$value = 0;
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
			else
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
				$masterstatus =~ m/are\s+(\w+)\s+jobs/i;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   322
				if ($1 =~ m/\D+/)
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
					$value = 1;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   325
				}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   326
				else
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
					$value = $1 + 1;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   329
				}
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
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   332
		else
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
			# The master is not running a service
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   335
			$value = -1;
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
		$serverlist{$server} = $value;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   338
		print "\n"; 
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
	
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
	# Decide which server to use
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   343
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   344
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   345
	print "#\n# STEP8 Decide which server to use\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   346
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   347
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   348
	my $masterserver;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   349
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   350
	# Loop through first time only to print out all the available servers
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   351
	print "\nAvailable Servers\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   352
	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   353
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   354
		print "\n$servername : number in queue are $serverlist{$servername}\n";
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
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   357
	# Loop through second time to actually select the correct server
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   358
	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   359
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   360
		if ($serverlist{$servername} > -1)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   361
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   362
			$masterserver = $servername;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   363
			last;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   364
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   365
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   366
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   367
	if (defined $masterserver)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   368
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   369
		print "\n*** The Smoke Test Server to be used for $_[0] is $masterserver ***\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   370
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   371
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   372
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   373
		print "\nREMARK: Smoke Test *** No available Smoke Test Servers for $_[0] \n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   374
		#&SmokeTest::DieLog("Error In Smoke Test: No available Smoke Test Servers for $_[0]");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   375
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   376
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   377
	return $masterserver;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   378
}
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
# Usage: RunRemote(Architecture, Testing Board, Server)
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   382
#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   383
sub RunRemote
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   384
{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   385
	my $masterserver = $_[2];
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   386
	
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
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   389
	# Call TestDriver runremote for $_[0]
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   390
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   391
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   392
	print "#\n# Call TestDriver runremote for $_[0]\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   393
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   394
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   395
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   396
	my $tempZipLocation = "$SmokeTest::SmokeTestDir\\$_[0]\\$_[1]";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   397
	if ($_[3] eq "NAND\\")
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
		$tempZipLocation .= "\\NAND";
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
	elsif ($_[3] eq "NAND\(DP\)\\")
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
                $tempZipLocation .= "\\NAND\(DP\)";
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
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   406
	SmokeTest::ExecCommand ("COPY /Y $tempZipLocation\\sys\$rom.zip $SmokeTest::SmokeTestDir\\sys\$rom.zip");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   407
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   408
	# Decide whether this is a platsec ROM or not
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   409
	my $platsec;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   410
	if ($SmokeTest::buildNo eq "9.1" || $SmokeTest::buildNo eq "9.2" || $SmokeTest::buildNo eq "9.3" || $SmokeTest::buildNo eq "Future" || $SmokeTest::buildNo eq "9.4" || $SmokeTest::buildNo eq "9.5" || $SmokeTest::buildNo eq "9.6" || $SmokeTest::buildNo eq "tb91")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   411
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   412
		$platsec = "ON";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   413
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   414
	else
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
		$platsec = "OFF";
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
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   419
	# calling testdriver for $_[0]
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   420
	my $runremote = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd runremote -m async -i $SmokeTest::SmokeTestDir --tp $_[0].tpkg -r sys\$rom.zip --srv //$masterserver/$SmokeTest::servicename --platsec $platsec --testexec ON");
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
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   423
	# Parse output to get the job number or error
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   424
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   425
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   426
	print "#\n# Parse output to get the job number or error\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   427
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   428
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   429
	my $jobid;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   430
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   431
	if ($runremote =~ m/job id/i)
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
		$runremote =~ m/job id: (\d+)/i;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   434
		$jobid = $1;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   435
		print "\n*** Job submitted successfully ***\n\nJob Id = $jobid\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   436
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   437
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   438
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   439
		print "\nREMARK: Smoke Test Job Submission failed\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   440
		#&SmokeTest::DieLog("Error In Smoke Test: Submitting the Job failed");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   441
		return;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   442
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   443
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   444
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   445
	# Create a text file with publish details
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   446
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   447
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   448
	print "#\n# Create a text file with publish details\n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   449
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   450
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   451
	my $publishstring;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   452
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   453
	$publishstring = "Publish: $SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   454
	print "$publishstring";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   455
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   456
	if ( (defined $SmokeTest::PublishServer) && (defined $SmokeTest::ProductType) && (defined $SmokeTest::BuildNum) )
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   457
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   458
		open PublishFile, ">$_[0]$_[1].txt" or &SmokeTest::DieLog("Cannot open File $_[0]$_[1].txt: $!\n");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   459
		$publishstring = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   460
		if ($_[3] eq "NAND\\")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   461
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   462
			$publishstring .= "NAND\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   463
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   464
		elsif ($_[3] eq "NAND\(DP\)\\")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   465
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   466
            $publishstring .= "NAND\(DP\)\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   467
	    }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   468
		print PublishFile "$publishstring";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   469
		$publishstring = "\n$SmokeTest::PublishServer\\$SmokeTest::ProductType\\logs\\$SmokeTest::BuildNum\\Smoketest\\$_[0]\\$_[1]\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   470
		if ($_[3] eq "NAND\\")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   471
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   472
			$publishstring .= "NAND\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   473
		}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   474
		elsif ($_[3] eq "NAND\(DP\)\\")
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   475
		{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   476
                $publishstring .= "NAND\(DP\)\\";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   477
        }
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   478
		print PublishFile "$publishstring";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   479
		close PublishFile;
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   480
		print "\n*** Publish file created successfully ***\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   481
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   482
	else
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   483
	{
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   484
		print "\nREMARK: Smoke Test *** Could not Create Publish File\n$!";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   485
		#&SmokeTest::DieLog("Error In Smoke Test: Could not Create Publish File");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   486
	}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   487
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   488
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   489
	# Copy This publish file to the correct directory 
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   490
	#
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   491
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   492
	print "#\n# Copy This publish file to the correct directory \n#\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   493
	print "\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   494
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   495
	###print "\nabout to move /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt\n";
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   496
    SmokeTest::ExecCommand ("MOVE /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt");
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   497
	
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   498
	SmokeTest::PrintDateTime();
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   499
}
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   500
483f966c6335 Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff changeset
   501
1;