Skip to Content.
Sympa Menu

perfsonar-dev - r2145 - in trunk/functional-testing/rrdMA: . conf metadatakey

Subject: perfsonar development work

List archive

r2145 - in trunk/functional-testing/rrdMA: . conf metadatakey


Chronological Thread 
  • From:
  • To:
  • Subject: r2145 - in trunk/functional-testing/rrdMA: . conf metadatakey
  • Date: Tue, 27 Feb 2007 06:05:00 -0500

Author: ilias
Date: 2007-02-27 06:04:59 -0500 (Tue, 27 Feb 2007)
New Revision: 2145

Modified:
trunk/functional-testing/rrdMA/Coordinator.pl
trunk/functional-testing/rrdMA/conf/MetadataKeyRequest.conf
trunk/functional-testing/rrdMA/conf/Service.conf
trunk/functional-testing/rrdMA/metadatakey/creator.pl
trunk/functional-testing/rrdMA/metadatakey/parser.pl
Log:


Modified: trunk/functional-testing/rrdMA/Coordinator.pl
===================================================================
--- trunk/functional-testing/rrdMA/Coordinator.pl 2007-02-26 12:48:03
UTC (rev 2144)
+++ trunk/functional-testing/rrdMA/Coordinator.pl 2007-02-27 11:04:59
UTC (rev 2145)
@@ -189,12 +189,24 @@

$ok = 0;

-# $creator = $1, $ok = 1 if ($line =~ /Creator\s+:\s+(\S+)$/);
-# $parser = $1, $ok = 1 if ($line =~ /Parser\s+:\s+(\S+)$/);
+ $db_type = $1, $ok = 1 if ($line =~ /Database type\s+:\s+(\S+)$/);
+ $db_location = $1, $ok = 1 if ($line =~ /Database
location\s+:\s+(\S+)$/);
$int_type = $1, $ok = 1 if ($line =~ /Interface type\s+:\s+(\S+)$/);
$int_addr = $1, $ok = 1 if ($line =~ /Interface Address\s+:\s+(\S+)$/);
$hostname = $1, $ok = 1 if ($line =~ /Hostname\s+:\s+(\S+)$/);

+
+ $int_name = $1, $ok = 1 if ($line =~ /Interface Name\s+:\s+(\S+)$/);
+ $int_descr = $1, $ok = 1 if ($line =~ /Interface
Description\s+:\s+\"(.+)\"$/);
+ $int_descr = $1, $ok = 1 if ($line =~ /Interface
Description\s+:\s+(\S+)$/);
+ $auth_realm = $1, $ok = 1 if ($line =~ /AuthRealm\s+:\s+(\S+)$/);
+ $capacity = $1, $ok = 1 if ($line =~ /Capacity\s+:\s+(\S+)$/);
+ $datasource = $1, $ok = 1 if ($line =~ /Datasource\s+:\s+(\S+)$/);
+ $value_unit = $1, $ok = 1 if ($line =~ /Value Units\s+:\s+(\S+)$/);
+ $resolution = $1, $ok = 1 if ($line =~ /resolution\s+:\s+(\S+)$/);
+
+
+
if ($line =~ /Number of Modules\s+:\s+(\S+)$/){
$modules = $1;
$ok = 1;
@@ -427,6 +439,10 @@
$hash_to_hashfile{"last_update_time"} = "NaN";
store(\%hash_to_hashfile, $hash_to_creator{"hashfile"});
}
+ if ($message_type =~ /metadatakey/){
+ $hash_to_creator{"db_type"} = $db_type;
+ $hash_to_creator{"db_location"} = $db_location;
+ }

# print $invokers[1];
foreach $invoker (@invokers){
@@ -436,20 +452,17 @@
$parameters[$outfile] = $invoker;
$outfile = "$req_dir$outfile.xml";
$hash_to_creator{"invoker"} = $invoker;
+ $hash_to_creator{"int_type"} = $int_type;
+ $hash_to_creator{"int_addr"} = $int_addr;
+ $hash_to_creator{"int_name"} = $int_name;
+ $hash_to_creator{"int_descr"} = $int_descr;
+ $hash_to_creator{"resolution"} = $resolution;
+ $hash_to_creator{"auth_realm"} = $auth_realm;
+ $hash_to_creator{"capacity"} = $capacity;
+ $hash_to_creator{"datasource"} = $datasource;
+ $hash_to_creator{"value_unit"} = $value_unit;
+ $hash_to_creator{"hostname"} = $hostname;

- if ($message_type =~ /store/){
- $hash_to_creator{"int_type"} = $int_type;
- $hash_to_creator{"int_addr"} = $int_addr;
- $hash_to_creator{"int_name"} = $int_name;
- $hash_to_creator{"int_descr"} = $int_descr;
- $hash_to_creator{"auth_realm"} = $auth_realm;
- $hash_to_creator{"capacity"} = $capacity;
- $hash_to_creator{"datasource"} = $datasource;
- $hash_to_creator{"value_unit"} = $value_unit;
- $hash_to_creator{"resolution"} = $resolution;
- $hash_to_creator{"hostname"} = $hostname;
- }
-
$req_hash_file = $req_dir."shash";
store(\%hash_to_creator, $req_hash_file);


Modified: trunk/functional-testing/rrdMA/conf/MetadataKeyRequest.conf
===================================================================
--- trunk/functional-testing/rrdMA/conf/MetadataKeyRequest.conf 2007-02-26
12:48:03 UTC (rev 2144)
+++ trunk/functional-testing/rrdMA/conf/MetadataKeyRequest.conf 2007-02-27
11:04:59 UTC (rev 2145)
@@ -8,11 +8,25 @@

#
# Database Information
-Interface type : ipv4
-Interface Address : 10.1.2.3
-Hostname : test-hostName
-Number of Modules : 15
+### We declare the database type so as to make the neccessary check while
creating keys
+### Also database location is used, since keys in both the requests and
responses should contain this

+Database type : rrd
+Database location :
/opt/perfSONAR-RRD-MA-2.0-RC5/perfsonar/data/rrd/test/test.rrd
+Interface type : ipv4
+Interface Address : 10.1.2.3
+Hostname : test-hostName
+Interface Name : test-0
+Interface Description : "test descripyion"
+AuthRealm : TestRealm
+Capacity : 1000BaseT
+Datasource : bytes
+Value Units : Bps
+
+resolution : 60
+
+Number of Modules : 6
+
# Now we declare the number of different occurences of each module
# e.g. 6:1:13 <module number>:<possibilities>,[0]:<related module>
# <module number> is the module's number for which we make declarations
@@ -22,20 +36,8 @@
# and closing tags, so as to have well structured xml files

1:1
-2:1:15
-3:4:5
-#3:1,0:5
-4:2,0
-#4:1,0
-5:1,0
-6:1:13
-7:1:11
-8:1:10
-9:4,0
-#9:1,0
-10:1
-11:1
-12:1
-13:1
-14:1
-15:1
+2:1
+3:1
+4:6,0
+5:2,0
+6:1

Modified: trunk/functional-testing/rrdMA/conf/Service.conf
===================================================================
--- trunk/functional-testing/rrdMA/conf/Service.conf 2007-02-26 12:48:03
UTC (rev 2144)
+++ trunk/functional-testing/rrdMA/conf/Service.conf 2007-02-27 11:04:59
UTC (rev 2145)
@@ -4,8 +4,8 @@
#
# Service Declaration

-Web service URL :
http://localhost:8080/perfSONAR-RRDMA-1.1-beta/services/MeasurementArchiveService
-rrd file : /opt/perfsonar/data/rrd/test/test.rrd
+Web service URL :
http://localhost:8080/perfSONAR-RRD-MA-2.0-RC5/services/MeasurementArchiveService
+rrd file :
/opt/perfSONAR-RRD-MA-2.0-RC5/perfsonar/data/rrd/test/test.rrd
Main directory : /home/itsomp/functional_tests/
Metadatakey directory : metadatakey/
Setupdata directory : setupdata/

Modified: trunk/functional-testing/rrdMA/metadatakey/creator.pl
===================================================================
--- trunk/functional-testing/rrdMA/metadatakey/creator.pl 2007-02-26
12:48:03 UTC (rev 2144)
+++ trunk/functional-testing/rrdMA/metadatakey/creator.pl 2007-02-27
11:04:59 UTC (rev 2145)
@@ -8,10 +8,9 @@

$invoker = $hash{"invoker"};
$rrd_file = $hash{"rrd_file"};
-
$pass_or_fail = "PASS";
+$filter = "NO";

-
sub print_xml_header{
$this_index = 1;

@@ -32,242 +31,171 @@

$status = $status_array[$this_index];

- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
-
- print "<nmwg:message type=\"MetadataKeyRequest\"\n";
- print " id=\"mdrq1-$invoker\"\n";
- print "
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"\n";;
- print "
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"\n";;
- print "
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\";>\n";
- #print "
xmlns:select=\"http://ggf.org/ns/nmwg/ops/select/2.0/\";>\n";
-
- print "\n";
-
- }
-
-}
-
-sub print_parametersID{
- $this_index = 3;
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " <nmwg:parameters id=\"msgparam1\">\n";
- }
- if ($status == 2){
- print " <nmwg:parameters id=\"test-other-parameters\">\n";
- }
-
- if ($status == 3){
- print " <nmwg:parametrs id=\"msgparam1\">\n";
- $pass_or_fail = "FAIL";
- }
- if ($status == 4){
- print " <nmwg:paramd>\n";
- $pass_or_fail = "FAIL";
- }
-}
-
-sub print_parameters{
- $this_index = 4;
-
- $status = $status_array[$this_index];
-
- print " <nmwg:parameter
name=\"authToken\">Internet2</nmwg:parameter>\n";
-
if ($status == 0){
#leave this out
}
- if ($status == 1){
- print " <nmwg:parameter
name=\"timeValue\">1127250480</nmwg:parameter>\n";
- }
- if ($status == 2){
- print " <nmwg:parameter
name=\"timeValue\">1127260480</nmwg:parameter>\n";
- }
-
- print " <nmwg:parameter
name=\"timeType\">unix</nmwg:parameter>\n";
-}
+ if ($status == 1){

-sub print_parametersID_end{
- $this_index = 5;
+ print "<nmwg:message type=\"MetadataKeyRequest\"\n";
+ print " id=\"mdkrq#$invoker\"\n";
+ print "
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"\n";;
+ print "
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"\n";;
+ print "
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\"\n";;
+ print "
xmlns:select=\"http://ggf.org/ns/nmwg/ops/select/2.0/\";>\n";

- $status = $status_array[$this_index];
-
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " </nmwg:parameters>\n";
- }
- if ($status == 2){
- print " </nmwg:parameters>\n";
- }
+ print "\n";

- if ($status == 3){
- print " </nmwg:parametrs>\n";
- $pass_or_fail = "FAIL";
}
- if ($status == 4){
- print " </nmwg:paramd>\n";
- $pass_or_fail = "FAIL";
- }
- print "\n";
-}

-sub print_metadataID{
- $this_index = 6;
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
-
- print " <nmwg:metadata id=\"meta1\">\n";
- }
}

-sub print_netutil{
- $this_index = 7;

+sub print_optional_parameters{
+ $this_index = 3;
$status = $status_array[$this_index];

- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " <netutil:subject id=\"subj1\">\n";
- }
-}
-
-sub print_interface_header{
- $this_index = 8;
-
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " <nmwgt:interface>\n";
- }
-}
-
-sub print_interface_parameters{
- $this_index = 9;
-
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #print nothing - ommit all parameters
+ if ($status == 0){
+ #leave this out
}
if ($status == 1){
- print " <nmwgt:ifAddress
type=\"ipv4\">10.1.2.3</nmwgt:ifAddress>\n";
- print " <nmwgt:hostName>test-hostName</nmwgt:hostName>\n";
- print " <nmwgt:direction>in</nmwgt:direction>\n";
- }
- if ($status == 2){
- print " <nmwgt:ifAddress
type=\"ipv4\">10.1.2.3</nmwgt:ifAddress>\n";
- print " <nmwgt:hostName>test-hostName</nmwgt:hostName>\n";
- print " <nmwgt:direction>out</nmwgt:direction>\n";
- }
- if ($status == 3){
- print " <nmwgt:ifAddress
type=\"ipv4\">10.1.2.4</nmwgt:ifAddress>\n";
- print " <nmwgt:hostName>test-hostName</nmwgt:hostName>\n";
- print " <nmwgt:direction>in</nmwgt:direction>\n";
- $pass_or_fail = "FAIL";
- }
- if ($status == 4){
- print " <nmwgt:ifAddress
type=\"ipv4\">10.1.2.4</nmwgt:ifAddress>\n";
- print " <nmwgt:hostName>test-hostName</nmwgt:hostName>\n";
- $pass_or_fail = "FAIL";
- }
-}
+ print " <nmwg:parameters id=\"msgparam1\">\n";
+ print " <nmwg:parameter
name=\"authToken\">Internet2</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"timeValue\">1127250495</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"timeType\">unix</nmwg:parameter>\n";
+ print " </nmwg:parameters>\n";

-sub print_interface_header_end{
- $this_index = 10;
-
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " </nmwgt:interface>\n";
- }
+ }
}

-sub print_netutil_end{
- $this_index = 11;
-
+sub print_all_metadata_for_key{
+ $this_index = 4;
$status = $status_array[$this_index];
+
+ if ($status == 0){
+ #leave this out
+ $pass_or_fail = "FAIL";
+ }
+ if ($status == 1){
+ print " <nmwg:metadata id=\"meta1\">\n";
+ print " <netutil:subject id=\"subj1\">\n";
+ print " <nmwgt:interface>\n";
+ print " <nmwgt:ifAddress
type=\"".$hash{"int_type"}."\">".$hash{"int_addr"}."</nmwgt:ifAddress>\n";
+ print "
<nmwgt:hostName>".$hash{"hostname"}."</nmwgt:hostName>\n";
+ print " </nmwgt:interface>\n";
+ print " </netutil:subject>\n";
+ print " <nmwg:eventType>utilization</nmwg:eventType>\n";
+ print " </nmwg:metadata>\n";
+ }
+ if ($status == 2){
+ print " <nmwg:metadata id=\"meta1\">\n";
+ print " <netutil:subject id=\"subj1\">\n";
+ print " <nmwgt:interface>\n";
+ print " <nmwgt:ifAddress
type=\"ipv4\">10.1.2.3</nmwgt:ifAddress>\n";
+ print "
<nmwgt:hostName>test-hostName</nmwgt:hostName>\n";
+ print " </nmwgt:interface>\n";
+ print " </netutil:subject>\n";
+ # print " <nmwg:eventType>utilization</nmwg:eventType>\n";
we ommit the eventType element
+ print " </nmwg:metadata>\n";
+
+ $pass_or_fail = "FAIL";
+ }
+ if ($status == 3){
+ print " <nmwg:metadata id=\"meta1\">\n";
+ create_valid_key();
+ print " </nmwg:metadata>\n";
+ }
+ if ($status == 4){
+ ### Here we create a metadata element containing an invalid key.
+ ### Since the service is supposed to give back the same key, this
test should not fail...
+ print " <nmwg:metadata id=\"meta1\">\n";
+ create_invalid_key();
+ #$pass_or_fail = "FAIL";
+ print " </nmwg:metadata>\n";
+ }
+ if ($status == 5){
+ # Here we create a filtered request, added to an interface
description metadata element
+ print " <nmwg:metadata id=\"meta1\">\n";
+ print " <netutil:subject id=\"subj1\">\n";
+ print " <nmwgt:interface>\n";
+ print " <nmwgt:ifAddress
type=\"".$hash{"int_type"}."\">".$hash{"int_addr"}."</nmwgt:ifAddress>\n";
+ print "
<nmwgt:hostName>".$hash{"hostname"}."</nmwgt:hostName>\n";
+ print " </nmwgt:interface>\n";
+ print " </netutil:subject>\n";
+ print " <nmwg:eventType>utilization</nmwg:eventType>\n";
+ print " </nmwg:metadata>\n";

- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " </netutil:subject>\n";
- }
+ print "\n";
+
+ print " <nmwg:metadata id=\"meta2\">\n";
+ print " <select:subject id=\"iusub2\"
metadataIdRef=\"meta1\"/>\n";
+ print " <select:parameters id=\"param1\">\n";
+ print " <nmwg:parameter
name=\"startTime\">1148370000</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"endTime\">1148373000</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"consolidationFunction\">AVERAGE</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"resolution\">60</nmwg:parameter>\n";
+ print " </select:parameters>\n";
+ print " <nmwg:eventType>select</nmwg:eventType>\n";
+ print " </nmwg:metadata>\n";
+ $filter = "meta2";
+ }
+ if ($status == 6){
+ # Here we create a filtered request, added to a key metadata
element
+
+ print " <nmwg:metadata id=\"meta1\">\n";
+ create_valid_key("valid1");
+ print " </nmwg:metadata>\n";

-}
+ print "\n";

-sub print_eventtype{
- $this_index = 12;
+ print " <nmwg:metadata id=\"meta2\">\n";
+ print " <select:subject id=\"iusub2\"
metadataIdRef=\"meta1\"/>\n";
+ print " <select:parameters id=\"param1\">\n";
+ print " <nmwg:parameter
name=\"startTime\">1148370000</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"endTime\">1148373000</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"consolidationFunction\">AVERAGE</nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"resolution\">60</nmwg:parameter>\n";
+ print " </select:parameters>\n";
+ print " <nmwg:eventType>select</nmwg:eventType>\n";
+ print " </nmwg:metadata>\n";
+ $filter = "meta2";
+ }
+
+ print "\n";

- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " <nmwg:eventType>utilization</nmwg:eventType>\n";
- }
}

-sub print_metadataID_end{
- $this_index = 13;
-
+sub print_data_id{
+ $this_index = 5;
$status = $status_array[$this_index];
-
if ($status == 0){
+ $pass_or_fail = "FAIL";
#leave this out
}
if ($status == 1){
- print " </nmwg:metadata>\n";

- print "\n";
- }
-}
+ if ($filter =~ /NO/){
+ print "<nmwg:data id=\"data1\" metadataIdRef=\"meta1\"/>\n";
+ }
+ else{
+ print "<nmwg:data id=\"data1\"
metadataIdRef=\"$filter\"/>\n";
+ }

-sub print_data{
- $this_index = 14;
-
- $status = $status_array[$this_index];
-
- if ($status == 0){
- #leave this out
- }
- if ($status == 1){
- print " <nmwg:data id=\"1\" metadataIdRef=\"meta1\"/>\n";
-
- print "\n";
}
+ if ($status == 2){
+ print "<nmwg:data id=\"data1\"
metadataIdRef=\"invalid-metadata-block\"/>\n";
+ $pass_or_fail = "FAIL";
+ }
+
}

sub print_message_header_end{
- $this_index = 15;
+ $this_index = 6;

$status = $status_array[$this_index];

if ($status == 0){
- #leave this out
+ #leave this out
+ $pass_or_fail = "FAIL";
}
if ($status == 1){
print "</nmwg:message>\n";
@@ -288,23 +216,47 @@
}
}

+sub create_valid_key{
+ my ($key_num) = shift (@_);
+ my ($parameters_id) = shift (@_);
+
+ if($hash{"db_type"} =~ /rrd/){
+ print " <nmwg:key>\n";
+ print " <nmwg:parameters id=\"param1\">\n";
+ print " <nmwg:parameter name=\"file\">\n";
+ print " ".$hash{"db_location"}."\n";
+ print " </nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"datasource\">".$hash{"datasource"}."</nmwg:parameter>\n";
+ print " </nmwg:parameters>\n";
+ print " </nmwg:key>\n";
+ }
+
+}
+
+sub create_invalid_key{
+ my ($key_num) = shift (@_);
+ my ($parameters_id) = shift (@_);
+
+ if($hash{"db_type"} =~ /rrd/){
+ print " <nmwg:key>\n";
+ print " <nmwg:parameters id=\"param1\">\n";
+ print " <nmwg:parameter name=\"file\">\n";
+ print " ".$hash{"db_location"}."---invalid_file\n";
+ print " </nmwg:parameter>\n";
+ print " <nmwg:parameter
name=\"datasource\">".$hash{"datasource"}."</nmwg:parameter>\n";
+ print " </nmwg:parameters>\n";
+ print " </nmwg:key>\n";
+ }
+
+}
+
populate_status_array();
print_xml_header(); #1
print_message_header(); #2
- print_parametersID(); #3
- print_parameters(); #4
- print_parametersID_end(); #5
- print_metadataID(); #6
- print_netutil(); #7
- print_interface_header(); #8
- print_interface_parameters(); #9
- print_interface_header_end(); #10
- print_netutil_end(); #11
- print_eventtype(); #12
- print_metadataID_end(); #13
- print_data(); #14
- print_message_header_end(); #15
+ print_optional_parameters(); #3
+ print_all_metadata_for_key(); #4
+ print_data_id(); #5
+ print_message_header_end(); #6

-
if ($pass_or_fail =~ /FAIL/){ exit 1; }
else { exit 0; }

Modified: trunk/functional-testing/rrdMA/metadatakey/parser.pl
===================================================================
--- trunk/functional-testing/rrdMA/metadatakey/parser.pl 2007-02-26
12:48:03 UTC (rev 2144)
+++ trunk/functional-testing/rrdMA/metadatakey/parser.pl 2007-02-27
11:04:59 UTC (rev 2145)
@@ -9,7 +9,7 @@
$ref = retrieve("$hash_file");
%hash = %{$ref};

-$outfile_status = "FAIL";
+$outfile_status = "default-FAIL";

$req_file_to_check = $hash{"xml_req_dir"}.$hash{"parse_file"}.".xml";

@@ -35,7 +35,7 @@
foreach my $element ($out_doc->getElementsByTagName("nmwg:eventType")) {
$string = $element->toString();
$text = $1 if ($string =~ />(.+)</);
- #print $text;
+ print $text;
if ($text =~ /warning/) {
$outfile_status = "FAIL";
print "Warning was found. Warning text:\n $text\n";
@@ -62,12 +62,66 @@
}

}
-
+ if ($outfile_status =~ /default/ ){
+ $metadata_blocks = 0;

- foreach my $element ($doc->getElementsByTagName("nmwgt:ifDescription")) {
- $string = $element->toString();
- $text = $1 if ($string =~ />(.+)</);
- #print $text;
+### for every metadata element found at the response, the following things
are checked
+ foreach my $element ($out_doc->getElementsByTagName("nmwg:metadata")) {
+ $metadata_blocks++;
+ $found_corresponding_data = 0;
+ $string = $element->toString();
+ print $string."\n\n";
+ $metadata_id = $1 if ($string =~ /id="(.+)">/);
+
+
+### Here we check whether there is a corresponding data element
+ foreach my $data_element ($out_doc->getElementsByTagName("nmwg:data"))
{
+ $data_string = $data_element->toString();
+ if ( $data_string =~ /metadataIdRef="$metadata_id"/){

+ print "Found Data element for Metadata element $metadata_id!\n";
+ $found_corresponding_data = 1;
+ $corresponding_data_element = $data_element;
+ }
+ }
+
+### If key is present in metadata section, we check whether a key with the
same id
+### is is present in data section
+ foreach my $inside_element_key
($element->getElementsByTagName("nmwg:key")) {
+ print " Key element Found in Metadata Section!\n";
+ $key_string = $inside_element_key->toString();
+ $metadata_key_id = $1 if ($key_string =~ /id="(.+)">/);
+ print " with id:$metadata_key_id\n\n";
+
+ foreach my $data_key_element
($corresponding_data_element->getElementsByTagName("nmwg:key")) {
+ $data_string = $data_key_element->toString();
+ if ( $data_string =~ /$metadata_key_id/){
+ print " Corresponding Key found in Data section!\n";
+
+ }
+ else {
+ $outfile_status == "FAIL";
+ print " FAIL --- Corresponding Key was not found in Data
section\n";
+ }
+ }
+
+ }
+
+### If Subject element is present in metadata section, we check if the
corresponding data
+### section contains a key
+ foreach my $inside_element_subject
($element->getElementsByTagName("netutil:subject")) {
+ print " Subject element Found!\n";
+ foreach my $data_key_element
($corresponding_data_element->getElementsByTagName("nmwg:key")) {
+ print " Key element Found in data Section!\n";
+ $key_string = $data_key_element->toString();
+ $data_key_id = $1 if ($key_string =~ /id="(.+)">/);
+ print " with id:$data_key_id\n\n";
+ }
+
+ }
+ if ($outfile_status =~ /default/){
+ $outfile_status = "PASS";
+ }
+ }
}

}



  • r2145 - in trunk/functional-testing/rrdMA: . conf metadatakey, svnlog, 02/27/2007

Archive powered by MHonArc 2.6.16.

Top of Page