common/tools/ats/ats3_testdrop.pl
author Mike Kinghan <mikek@symbian.org>
Thu, 28 May 2009 14:55:09 +0100
changeset 113 7f0174848f99
parent 105 3aef06ac7a6a
child 134 039d0b7e56f3
permissions -rw-r--r--
Adding license boilerplate to perl scripts.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     1
#!/usr/bin/perl
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     2
113
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     4
# This component and the accompanying materials are made available
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     6
# which accompanies this distribution, and is available
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     8
#
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
     9
# Initial Contributors:
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    11
#   Mike Kinghan, mikek@symbian.org
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    12
#
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    13
# Contributors:
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    14
#
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    15
# Description:
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    16
#   This is a tool for sending an ATS3 testdrop to an ATS3 server.
7f0174848f99 Adding license boilerplate to perl scripts.
Mike Kinghan <mikek@symbian.org>
parents: 105
diff changeset
    17
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    18
use strict;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    19
use Getopt::Long;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    20
use File::Copy;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    21
use File::Spec;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    22
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    23
my $username = "admin";
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    24
my $password = "admin";
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    25
my $host;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    26
my $schedule;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    27
my $host_drop_path;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    28
my $local_drop_path;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    29
my $local_test_pkg;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    30
my $help;
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    31
my $dev_null = $^O =~ /^MSWin/ ? "nul" : "/dev/null";
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    32
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    33
sub usage($);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    34
sub help();
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    35
sub usage_error();
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    36
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    37
my %optmap = (  'host' => \$host,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    38
			    'local-test-pkg' => \$local_test_pkg,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    39
				'host-drop-path' => \$host_drop_path,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    40
				'local-drop-path' =>\$local_drop_path,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    41
				'username' => \$username,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    42
				'password' => \$password,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    43
				'schedule' => \$schedule,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    44
                'help' => \$help);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    45
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    46
GetOptions(\%optmap,
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    47
          'host=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    48
          'local-test-pkg=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    49
          'host-drop-path=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    50
          'local-drop-path=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    51
          'username=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    52
          'password=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    53
          'schedule=s',
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    54
          'help!') 
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    55
          or usage_error();
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    56
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    57
if ($help) {
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    58
	help();
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    59
}
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    60
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    61
usage_error(), unless (defined($host) && defined($local_test_pkg) && defined($local_drop_path) && defined($host_drop_path));
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    62
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    63
my $curl_version = $^O =~ /^MSWin/ ? `curl --version 1> $dev_null 2>&1` : `curl --version 1> $dev_null 2>&1`;
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    64
die("Need program \"curl\". Not found"), if ($?);
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    65
die("Test drop path \"$local_drop_path\" not found"), unless ( -d "$local_drop_path");
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    66
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    67
$host .= ":8080", unless ($host =~ /:\d+$/);
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    68
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    69
my ($vol,$dir,$pkg);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    70
my $local_test_drop;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    71
my $host_test_drop;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    72
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    73
if ($local_test_pkg =~ /^\.\.\.(.+)/ ) {
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    74
    $pkg = $1;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    75
    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    76
    die("Test package file \"$local_test_drop\" not found"), unless ( -f "$local_test_drop");        
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    77
}
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    78
else {
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    79
    die("Test package file \"$local_test_pkg\" not found"), unless ( -f "$local_test_pkg");
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    80
    ($vol,$dir,$pkg) = File::Spec->splitpath($local_test_pkg);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    81
    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    82
    if ( -f "$local_test_drop") {
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    83
        my $cmp_local_test_drop = $local_test_drop;
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    84
        my $cmp_local_test_pkg = $local_test_pkg;
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    85
        if ($^O =~ /^MSWin/) {
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    86
            $cmp_local_test_drop = lc($local_test_drop);
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    87
            $cmp_local_test_pkg = lc($local_test_pkg);        
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    88
        }   
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    89
        if ("$cmp_local_test_drop" eq "$cmp_local_test_pkg") {
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    90
            if (unlink($local_test_drop) == 0) {
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    91
                die("Can't delete stale test drop \"$local_test_drop\". $!");
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    92
            }
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    93
            else {
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    94
                print("A stale test drop \"$local_test_drop\" existed. Deleted\n");
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    95
            }
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    96
        }
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    97
    }
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    98
    copy("$local_test_pkg","$local_test_drop")
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
    99
        or die("Cannot copy \"$local_test_pkg\" -> \"$local_test_drop\". $!");
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   100
}
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   101
$host_test_drop = File::Spec->catfile($host_drop_path,$pkg);
99
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
   102
my $url ="http://$host/ats3/XTestRunExecute.do?username=$username&password=$password&testrunpath=$host_test_drop";
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
   103
$url .= "&schedule=$schedule", if (defined($schedule));
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
   104
my $curl_cmd = "curl \"$url\"";
2c7b53b5228f Add ATS test client target <sf-send-testpkg> to default configuration. Default is off.
Shabe Razvi <shaber@symbian.org>
parents: 91
diff changeset
   105
system("$curl_cmd");
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   106
die("\nTest drop failed: $!"), if ($?);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   107
print("\nTest drop done");
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   108
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   109
exit 0;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   110
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   111
sub usage($)
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   112
{
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   113
    my $error = shift;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   114
    my $fh = $error == 0 ? *STDOUT : *STDERR;
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   115
    print $fh "ats3_testdrop.pl\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   116
            "Send a test drop to an ATS3 server for execution\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   117
            "usage:\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   118
            "  ats3_testdrop.pl --help\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   119
            "  ats3_testdrop.pl --host=HOSTNAME --local-test-pkg=PKGFILE --local-drop-path=LOCALPATH " .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   120
                " --host-drop-path=HOSTPATH " .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   121
                "[--username=ATS3USERNAME] [--password=ATS3PASSWORD] [--schedule=DD.MM.YYYY-HH:MM]\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   122
            "options:\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   123
            "  --help                        Display this help and exit\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   124
            "  --host=HOSTAME                HOSTNAME is ATS3 server\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   125
            "  --local-test-pkg=PKGFILE      PKGFILE is the test package.\n" .
105
3aef06ac7a6a Fixed minor bug in ats3_testdrop.pl: Quote marks within quotation needed to be escaped.
Mike Kinghan <mikek@symbian.org>
parents: 99
diff changeset
   126
            "                                If PKGFILE begins \"...\" a filename in LOCALPATH is assumed\n" .
91
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   127
            "  --local-drop-path=LOCALPATH   Path to local directory where PKGFILE will be dropped\n" .            
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   128
            "  --host-drop-path=HOSTPATH     Host directory that is mapped to LOCALPATH.\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   129
            "                                Must agree with the properties of the registered device that the test package nominates\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   130
            "  --username=ATS3USERNAME       ATS3 user to whome the test will belong. Default=admin\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   131
            "  --password=ATS3PASSWORD       Password of ATS3 user. Default=admin\n" .
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   132
            "  --schedule=DD.MM.YYYY-HH:MM   Date-time at which test is to run. Default=as soon as possible\n";
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   133
    exit $error;            
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   134
}
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   135
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   136
sub help()
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   137
{
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   138
    usage(0);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   139
}
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   140
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   141
sub usage_error()
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   142
{
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   143
    usage(1);
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   144
}             
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   145
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   146
# EOF
786a0a00701e 1) Update binary packaging solution to invoke 7za directly. 2) Add partially complete ATS sf-send-testpkg target and associated tools
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   147