common/tools/ats/smoketest/http/group/delproxy.pl
author Maciej Seroka <maciejs@symbian.org>
Wed, 06 Jan 2010 13:41:51 +0000
changeset 836 675529c38614
permissions -rw-r--r--
Added smoke test for making a connection to a web server through ethernet
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
836
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
#!/usr/bin/perl
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
#
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
#   Maciej Seroka, maciej@symbian.org
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
#
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
# Description:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
#   This is a tool for removing proxy settings from ethernetced.xml.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
use Tie::File;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
my $filename;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
if ($ARGV[0]) {
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
  $filename = $ARGV[0];
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
 }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
else { die 'Missing parameter "filename"'; }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
my $LINE;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
print $filename;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
tie @LINE, 'Tie::File', $filename or die 'file not found';
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
my $n = 0;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
my $proxy_begin = 0;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
my $proxy_end = 0;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
for (@LINE) {
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
  if ($LINE[$n] =~ /<ProxyTable>/) {
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
     $proxy_begin = $n;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
   }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
  if ($LINE[$n] =~ /<\/ProxyTable>/) {
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
     $proxy_end = $n;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
     last;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
   }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
  $n += 1;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
 }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
if ($proxy_end > 0) {
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
  splice @LINE, $proxy_begin, ($proxy_end - $proxy_begin + 1);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
 }
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
untie @LINE;