perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r623 - 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] r623 - 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] r623 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client
- Date: Thu, 26 Aug 2010 09:59:19 +0100
Author: dfn.calim
Date: 2010-08-26 09:59:19 +0100 (Thu, 26 Aug 2010)
New Revision: 623
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/Echo.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/status-test
Log:
Creating stabilization branch for MDM 3.3
Modified: branches/perfsonar-oppd-new-architect/bin/oppd.pl
===================================================================
--- branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-17 14:37:08
UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-26 08:59:19
UTC (rev 623)
@@ -840,7 +840,7 @@
#Do here response on error
$log->error("A error occured in creating data struct");
$log->error("$ds->{ERROROCCUR}");
- } else{
+ }else{
$ds->{SERVICES} = \%services;
#Run $ds
perfSONAR->handle_request($ds);
Modified:
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-17 14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-26 08:59:19 UTC (rev 623)
@@ -1,5 +1,20 @@
package perfSONAR::DataStruct::NMWG;
-
+#
+# 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::DataStruct::NMWG
@@ -50,7 +65,8 @@
"http://ggf.org/ns/nmwg/tools/bwctl/2.0/",
"http://ggf.org/ns/nmwg/tools/iperf/2.0/",
"owamp",
- "bwctl"
+ "bwctl",
+ "http://schemas.perfsonar.net/tools/admin/echo/2.0"
);
bless $self, $class;
@@ -76,6 +92,10 @@
return;
}
+ #Now get the new messagetype
+ $messagetype = $ds->{REQUESTMSG}->get_message_type();
+
+
($ds->{SERVICE} = $ds->{URI}) =~ s/^.*\/services\///;
$ds->{SERVICE} =~ s/\/$//;
$self->{LOGGER}->info("Requested service: $ds->{SERVICE}");
@@ -116,16 +136,11 @@
foreach my $meta (keys %{$ds->{REQUESTMSG}->{"metadataIDs"}}){
#check for unknown eventTypes
my $et = $ds->{REQUESTMSG}->{"metadataIDs"}{$meta}{"eventType"};
-
if ($et =~ /admin/){ #dispatch to Echo module
- $ds->{RETURNMSG} =
perfSONAR::Echo::handle_echo_request($ds->{REQUESTMSG}, $ds->{SERVICE});
- $ds->{ERROROCCUR} = 1;
- return;
- #return $reqmsg;
+ $ds->{DOECHO} = 1;;
}
my $found = undef;
- #foreach my $sup_et (@{$services{$service}{"eventtype"}}){
foreach my $sup_et (@module_ets){
next unless ($sup_et =~ /$et/);
$found = 1;
@@ -155,7 +170,7 @@
}
} #End forech
- #TODO This is a big block. Split it in more functions
+
#add metadata parameters to data hashes
($errorstring, $metaid) = $ds->{REQUESTMSG}->concatenate_params;
if ($errorstring){
@@ -199,7 +214,8 @@
#do selftests
#TODO test this part
- if($messagetype =~ /EchoResponse/){
+ if($messagetype =~ /EEchoResponse/){
+ $self->{LOGGER}->debug("Perform Echo");
my @tests = ("bwctl_command_test",
"bwctl_exec_test",
"bwctld_running_test",
@@ -346,13 +362,19 @@
sub parseResult{
my ($self, $ds) = @_;
my $ns = $self->{EVENTTYPE};
-
- my $params = $$ds->{PARAMS};
+ my $params = $$ds->{PARAMS};
+
foreach my $id (keys %{$params}){
- my $datalines_ref = $$ds->{PARAMS}->{$id}->{MRESULT}; #Returns a
ref to array
- $$ds->{REQUESTMSG}->set_data_ns ($id, $ns, @$datalines_ref);
+ my $datalines_ref = $$ds->{PARAMS}->{$id}->{MRESULT}; #Returns a
ref to array
+ if ($$ds->{DOECHO} == 1){
+
+ my %data_hash =
%{@$datalines_ref[0]};
+ $$ds->{REQUESTMSG}->return_result_code($data_hash{'echocode'},
$data_hash{'echomsg'}, "$id")
+ }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-17 14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
2010-08-26 08:59:19 UTC (rev 623)
@@ -62,7 +62,7 @@
$self->{SERVICES} = ();
$self->{RETURNMSG} = undef;
$self->{PARAMS} = {}; #The measurement parameters defined by a ID
- #$self->{BWCTL} = perfSONAR::DataStruct::BWCTL->new();
+ $self->{DOECHO} = -1; #Do a status report for the selected service
#Check if uri is given
if (!$uri){
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/Echo.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/Echo.pm 2010-08-17
14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/Echo.pm 2010-08-26
08:59:19 UTC (rev 623)
@@ -15,40 +15,52 @@
# limitations under the License.
#
#
+=head1 NAME
+perfSONAR::Echo
+
+=head1 DESCRIPTION
+
+This is the main class for Echo requests. All services use this class as a
base
+class. This class hasnt a constructor. All services use the
handle_echo_request
+method.
+=cut
+
#DEBUG
use Data::Dumper;
#/DEBUG
use strict;
use warnings;
+use Log::Log4perl qw(get_logger);
-use perfSONAR qw(print_log %services);
-
-our $log = undef;
-
-our %services = ();
-
my $echo_et = "http://schemas.perfsonar.net/tools/admin/echo/2.0";
my $selftest_et = "http://schemas.perfsonar.net/tools/admin/selftest/1.0";
my $response_et = "http://schemas.perfsonar.net/tools/admin/selftest/";
-my $returnstring = "I'm still alive and happy to talk to you!";
+
sub handle_echo_request{
-#sub start_action {
- my $msg = shift;
- my $service = shift;
-
- print Dumper($msg->{"metadataIDs"});
-
- foreach my $key (keys %{$msg->{"metadataIDs"}}){
- my $et = $msg->{"metadataIDs"}{$key}{"eventType"};
- if ($et =~ /$echo_et/){
- #echo request
- print_log("info", "Reply to EchoRequest ping");
- $msg->return_result_code("success.echo", "$returnstring", "$key");
+
+ my ($self, $ds) = @_;
+ my $logger = get_logger("perfSONAR::Echo" );
+ $logger->debug("Start Echo");
+ my $params = $$ds->{PARAMS};
+ my @datalines;
+
+ foreach my $id (keys %{$params}){
+
+ #echo request
+ my %data_hash;
+ $logger->info("Reply to EchoRequest ping");
+ $data_hash{'echocode'} = "success";
+ $data_hash{'echomsg'} = "Service: $$ds->{SERVICE} is ready for call";
+ push @datalines, \%data_hash;
+ $$ds->{PARAMS}->{$id}->{MRESULT} =
\@datalines
}
+
+ ;
+=head2
elsif ($et =~ /$selftest_et/){
#my %refs = $services{$service}->{handler}->selftest();
@@ -73,6 +85,6 @@
#return success message
return $msg;
}
-
+=cut
}
1;
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-08-17 14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-08-26 08:59:19 UTC (rev 623)
@@ -26,6 +26,7 @@
use Log::Log4perl qw(get_logger);
use base qw(perfSONAR::MP);
+use base qw(perfSONAR::Echo);
=head2 run()
@@ -41,7 +42,7 @@
=cut
sub run{
my ($self, $ds) = @_;
- $self->{LOGGER}->info("RUN method!!!");
+
$self->{DS} = $ds;
$self->runMeasurement();
}
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm 2010-08-17
14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP.pm 2010-08-26
08:59:19 UTC (rev 623)
@@ -33,7 +33,9 @@
use Log::Log4perl qw(get_logger);
use IPC::Run qw( run timeout start finish pump);
use IO::Pty;
+use base qw(perfSONAR::Echo);
+
=head2 new()
The constructor is called withoud a parameter.
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm 2010-08-17
14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR.pm 2010-08-26
08:59:19 UTC (rev 623)
@@ -87,8 +87,13 @@
my ($self, $ds) = @_;
my $logger = get_logger("perfSONAR" );
- $logger->debug("Running perfsonar->request_handler");
- $ds->{SERVICES}->{$ds->{SERVICE}}->{handler}->run(\$ds);
+
+ if ($ds->{DOECHO} == 1){
+ $logger->debug("Running Echo");
+
$ds->{SERVICES}->{$ds->{SERVICE}}->{handler}->handle_echo_request(\$ds);
+ }else{
+ $ds->{SERVICES}->{$ds->{SERVICE}}->{handler}->run(\$ds);
+ }
$ds->{$ds->{DSTYPE}}->parseResult(\$ds);
}
Modified:
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
===================================================================
---
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
2010-08-17 14:37:08 UTC (rev 622)
+++
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
2010-08-26 08:59:19 UTC (rev 623)
@@ -13,7 +13,7 @@
<perfsonar:subject id="subj1">
<nmwgt:endPointPair>
<nmwgt:src type="ipv4" value="131.188.81.34"/>
- <nmwgt:dst type="ipv4" value="198.129.254.102"/>
+ <nmwgt:dst type="ipv4" value="131.188.81.178"/>
</nmwgt:endPointPair>
</perfsonar:subject>
Modified:
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/status-test
===================================================================
--- branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/status-test
2010-08-17 14:37:08 UTC (rev 622)
+++ branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/status-test
2010-08-26 08:59:19 UTC (rev 623)
@@ -1 +1 @@
-./perfsonar-client.pl --reqfile=status-req-psui-3.xml
--uri=http://radagast.rrze.uni-erlangen.de:3070/services/MA/HADES/STATUS
--host=radagast.rrze.uni-erlangen.de
+./perfsonar-client.pl --reqfile=psping.xml
--uri=http://calim.rrze.uni-erlangen.de:8090/services/MP/OWAMP
--host=calim.rrze.uni-erlangen.de --port=80900
- [pS-dev] [GEANT/SA2/SA2T3-OPPD] r623 - in branches/perfsonar-oppd-new-architect: bin lib lib/perfSONAR lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client, svn-noreply, 08/26/2010
Archive powered by MHonArc 2.6.16.