Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r625 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/SA2T3-OPPD] r625 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/SA2T3-OPPD] r625 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client
  • Date: Wed, 1 Sep 2010 10:23:41 +0100

Author: dfn.calim
Date: 2010-09-01 10:23:40 +0100 (Wed, 01 Sep 2010)
New Revision: 625

Modified:
branches/perfsonar-oppd-new-architect/bin/oppd.pl
branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/BWCTL.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/bwctl-test
Log:
Error messages included for owamp and bwctl mp

Modified: branches/perfsonar-oppd-new-architect/bin/oppd.pl
===================================================================
--- branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-26 09:02:45
UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-09-01 09:23:40
UTC (rev 625)
@@ -836,7 +836,7 @@
#Create a DataStruct
my $ds = perfSONAR::DataStruct->new($soap_message->uri,
$nmwg_message);
my $nmwg_response;
- if ($ds->{ERROROCCUR} == 1){
+ if ($ds->{ERROROCCUR}){
#Do here response on error
$log->error("A error occured in creating data struct");
$log->error("$ds->{ERROROCCUR}");

Modified:
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-26 09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-09-01 09:23:40 UTC (rev 625)
@@ -361,21 +361,23 @@

sub parseResult{
my ($self, $ds) = @_;
+ #TODO USE namespace and not eventtype
my $ns = $self->{EVENTTYPE};
my $params = $$ds->{PARAMS};

foreach my $id (keys %{$params}){
my $datalines_ref = $$ds->{PARAMS}->{$id}->{MRESULT}; #Returns a
ref to array
- if ($$ds->{DOECHO} == 1){
-
+ if ($$ds->{DOECHO} == 1){
my %data_hash =
%{@$datalines_ref[0]};
$$ds->{REQUESTMSG}->return_result_code($data_hash{'echocode'},
$data_hash{'echomsg'}, "$id")
+ }elsif ($$ds->{ERROROCCUR}){
+ my $et = pop @$datalines_ref;
+ $$ds->{REQUESTMSG}->return_result_code($et,
"@$datalines_ref", $$ds->{REQUESTMSG}->{"dataIDs"}{$id}{"metaref"});
}else{
$$ds->{REQUESTMSG}->set_data_ns ($id, $ns, @$datalines_ref);
}
#$self->{LOGGER}->debug(Dumper(@$datalines_ref));
- }
-
+ }
}



Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
2010-08-26 09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
2010-09-01 09:23:40 UTC (rev 625)
@@ -1,5 +1,20 @@
package perfSONAR::DataStruct;
-
+#
+# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
use strict;
use warnings;

@@ -57,12 +72,12 @@
my ( $class, $uri, $msg ) = @_;
my $self = {};
$self->{LOGGER} = get_logger( $CLASSPATH );
- $self->{ERROROCCUR} = -1; #If error occur set to 1
+ $self->{ERROROCCUR} = 0; #If error occur set to 1
$self->{SERVICE} = undef; #The request message
$self->{SERVICES} = ();
$self->{RETURNMSG} = undef;
$self->{PARAMS} = {}; #The measurement parameters defined by a ID
- $self->{DOECHO} = -1; #Do a status report for the selected service
+ $self->{DOECHO} = 0; #Do a status report for the selected service

#Check if uri is given
if (!$uri){

Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/BWCTL.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/BWCTL.pm
2010-08-26 09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/BWCTL.pm
2010-09-01 09:23:40 UTC (rev 625)
@@ -1,6 +1,20 @@
package perfSONAR::MP::BWCTL;
-
-
+#
+# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
=head1 NAME

perfSONAR::MP::BWCTL
@@ -41,7 +55,7 @@
=cut
sub run{
my ($self, $ds) = @_;
- $self->{LOGGER}->info("RUN method!!!");
+
$self->{DS} = $ds;
$self->runMeasurement();
}
@@ -150,12 +164,13 @@
my @result = split(/\n/, $result);
my @datalines;
my $time = time;
-
+ my %data_hash;
+
foreach my $resultline (@result){
next unless ($resultline =~

/(\d+\.\d+\s*\-\s*\d+\.\d+)\s+sec\s+(\d+\.?\d*)\s+(\w+)\s+(\d+\.?\d*)\s+(\w+\/\w+)/);

- my %data_hash;
+
$data_hash{"timeType"} = "unix";
$data_hash{"timeValue"} = $time;
$data_hash{"interval"} = $1;
@@ -168,16 +183,16 @@
if($#datalines < 0){
#no data -> something wrong, write result as error description:
$datalines[0]="BWCTL Error:";
- foreach my $resultline (@result){
- push @datalines, $resultline;
- }
+ push @datalines, @result;
+
}

if ($datalines[0] eq "BWCTL Error:"){
- my $errorstring = join(" ", @datalines);
+ my $errorstring = "@datalines";
$errorstring =~ s/usage.*$//;
$$ds->{ERROROCCUR} = 1;
- $$ds->{RETURNMSG} = $errorstring;
+ $self->{LOGGER}->error($errorstring);
+ push @datalines,"error.mp.bwctl";
}
return @datalines;
}

Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-08-26 09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-09-01 09:23:40 UTC (rev 625)
@@ -1,6 +1,20 @@
package perfSONAR::MP::OWAMP;
-
-
+#
+# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
=head1 NAME

perfSONAR::MP::OWAMP
@@ -26,9 +40,9 @@

use Log::Log4perl qw(get_logger);
use base qw(perfSONAR::MP);
-use base qw(perfSONAR::Echo);


+
=head2 run()

The run method starts a OWAMP measurement and use the runMeasurement()
@@ -139,7 +153,7 @@
my @result = split(/\n/, $result);
my @datalines;
my $time = time;
-
+
foreach my $resultline (@result){
if ($self->{OUTPUTTYPE} eq "per_packet"){

@@ -171,7 +185,17 @@
}#End else
}#End foreach my $resultline

- #$self->{LOGGER}->info(Dumper($1));
+ if($#datalines < 0){
+ #no data -> something wrong, write result as error description:
+ $datalines[0]="OWAMP Error:";
+ push @datalines, @result;
+
+ my $errorstring = "@datalines";
+ $$ds->{ERROROCCUR} = 1;
+ $self->{LOGGER}->error($errorstring);
+ push @datalines,"error.mp.owamp";
+ } #End if ($#datalines < 0
+
return @datalines;
}
1;
\ No newline at end of file

Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm 2010-08-26
09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm 2010-09-01
09:23:40 UTC (rev 625)
@@ -1,5 +1,20 @@
package perfSONAR::MP;
-
+#
+# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
=head1 NAME

perfSONAR::MP
@@ -104,20 +119,19 @@
else{
$$ds->{PARAMS}->{$id}->{MEASRESULT} = "$out_tmp" . "$out";
}
-
+ #$logger->info(Dumper($out));
#parse the result
my @mresult = $self->parse_result($ds,$id);
$$ds->{PARAMS}->{$id}->{MRESULT} =
\@mresult;
- #$logger->info(Dumper(@datalines));
+ #$logger->info(Dumper(@mresult));
}#End foreach my $id
- #$logger->info(Dumper($params));
-
+
#On success write to log
if ($$ds->{ERROROCCUR}){
- $logger->info("Measurement point was successfull for service:
$$ds->{SERVICE}");
+ $logger->info("Measurement point was NOT successfull for
service: $$ds->{SERVICE}");
}
else{
- $logger->info("Measurement point was NOT successfull for
service: $$ds->{SERVICE}");
+ $logger->info("Measurement point was successfull for service:
$$ds->{SERVICE}");
}

}

Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm 2010-08-26
09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm 2010-09-01
09:23:40 UTC (rev 625)
@@ -85,11 +85,23 @@
sub handle_request {

my ($self, $ds) = @_;
-
my $logger = get_logger("perfSONAR" );
+ my @datalines;

- if ($ds->{DOECHO} == 1){
- $logger->debug("Running Echo");
+ #look if service is availible
+ if (! $ds->{SERVICES}->{$ds->{SERVICE}}){
+ my $errormsg = "Requested service: $ds->{SERVICE} is not availible";
+ $logger->error($errormsg);
+ $ds->{ERROROCCUR} = 1;
+ $datalines[0]="Service request Error:";
+ push @datalines, $errormsg;
+ push @datalines, "error.common.service_not_availible";
+ $ds->{PARAMS}->{"1"}->{MRESULT} =
\@datalines;
+ $ds->{$ds->{DSTYPE}}->parseResult(\$ds);
+ return;
+ }
+
+ if ($ds->{DOECHO}){

$ds->{SERVICES}->{$ds->{SERVICE}}->{handler}->handle_echo_request(\$ds);
}else{
$ds->{SERVICES}->{$ds->{SERVICE}}->{handler}->run(\$ds);

Modified:
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/bwctl-test
===================================================================
--- branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/bwctl-test
2010-08-26 09:02:45 UTC (rev 624)
+++ branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/bwctl-test
2010-09-01 09:23:40 UTC (rev 625)
@@ -1 +1 @@
-./perfsonar-client.pl --reqfile=bwctl-iperf-req2.xml
--uri=http://calim.rrze.uni-erlangen.de:8090/services/MP/BWCTL
--host=calim.rrze.uni-erlangen.de --port=80900
+./perfsonar-client.pl --reqfile=message.xml
--uri=http://calim.rrze.uni-erlangen.de:8090/services/MP/BWCTL
--host=calim.rrze.uni-erlangen.de --port=80900



  • [pS-dev] [GEANT/SA2/SA2T3-OPPD] r625 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client, svn-noreply, 09/01/2010

Archive powered by MHonArc 2.6.16.

Top of Page