diff --git a/event/DESIGN b/event/DESIGN index 4165e8ebec535a669dcdd023e89b9f3fd30edded..f5555d7985fd27f185ee4e885798a3b1a5c9334b 100644 --- a/event/DESIGN +++ b/event/DESIGN @@ -64,7 +64,7 @@ notifications. The system defined fields include: typedef struct { char *site; /* Which Emulab site. */ char *expt; /* Project and experiment IDs */ - char *group; /* User defined group of nodes */ + char *group; /* Deprecated */ char *host; /* A specific host (ipaddr) */ char *objtype; /* LINK, TRAFGEN, etc ... */ char *objname; /* link0, cbr0, cbr1, etc ... */ @@ -72,6 +72,12 @@ notifications. The system defined fields include: int scheduler; /* A dynamic event to schedule */ } address_tuple; +Important Note: Event groups are *not* implemented by the group field +in the tuple. Rather, they are implemented by adding names to the +objname field treating it as a comma-delimited field. Since names are +not unique, the event is sent to every agent registered under the +group name. + The last field, scheduler, is used internally to route notifications to the scheduler for an experiment. This is described in more detail below. diff --git a/protogeni/lib/GeniCredential.pm.in b/protogeni/lib/GeniCredential.pm.in old mode 100644 new mode 100755 index 6ec682c37b9350304624141ab450277bcac494f8..b82c3ae311169c6d6f72e7e59674145710a9d283 --- a/protogeni/lib/GeniCredential.pm.in +++ b/protogeni/lib/GeniCredential.pm.in @@ -513,9 +513,12 @@ sub Sign($$) # # Create a template xml file to sign. # + my $id = sprintf( "%04X%04X%04X%04X", int( rand( 0x10000 ) ), + int( rand( 0x10000 ) ), int( rand( 0x10000 ) ), + int( rand( 0x10000 ) ) ); my $template = "\n". - "\n". + "\n". " privilege\n". " $idx\n". " $owner_cert\n". diff --git a/protogeni/test/delegate.py b/protogeni/test/delegate.py index 45062bf22a7e08082a27dd3c88ef5cfd783c7942..1940b8fd88d51354a9a0772e7eba98c697aa5e88 100755 --- a/protogeni/test/delegate.py +++ b/protogeni/test/delegate.py @@ -16,6 +16,7 @@ import datetime import getopt import os +import random import re import sys import tempfile @@ -200,11 +201,14 @@ old = Lookup( doc.documentElement, "credential" ) c = doc.createElement( "credential" ) -id = 1 -while filter( lambda x: x.getAttribute( "xml:id" ) == "ref" + str( id ), - doc.getElementsByTagName( "credential" ) ): - id = id + 1 -c.setAttribute( "xml:id", "ref" + str( id ) ) +# I really want do loops in Python... +while True: + id = "ref" + '%016X' % random.getrandbits( 64 ) + if not filter( lambda x: x.getAttribute( "xml:id" ) == "ref" + str( id ), + doc.getElementsByTagName( "credential" ) ): + break + +c.setAttribute( "xml:id", str( id ) ) c.appendChild( Lookup( old, "type" ).cloneNode( True ) ) c.appendChild( SimpleNode( doc, "serial", "1" ) ) @@ -258,7 +262,7 @@ p.appendChild( old ) c.appendChild( p ) signature = doc.createElement( "Signature" ); -signature.setAttribute( "xml:id", "Sig_ref" + str( id ) ) +signature.setAttribute( "xml:id", "Sig_" + str( id ) ) signature.setAttribute( "xmlns", "http://www.w3.org/2000/09/xmldsig#" ) Lookup( doc.documentElement, "signatures" ).appendChild( signature ) signedinfo = doc.createElement( "SignedInfo" ) @@ -272,7 +276,7 @@ sigmeth.setAttribute( "Algorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ) signedinfo.appendChild( sigmeth ) reference = doc.createElement( "Reference" ); -reference.setAttribute( "URI", "#ref" + str( id ) ) +reference.setAttribute( "URI", "#" + str( id ) ) signedinfo.appendChild( reference ) transforms = doc.createElement( "Transforms" ) reference.appendChild( transforms ) @@ -309,7 +313,7 @@ doc.writexml( tmpfile ) tmpfile.flush() ret = os.spawnlp( os.P_WAIT, XMLSEC1, XMLSEC1, "--sign", "--node-id", - "Sig_ref" + str( id ), "--privkey-pem", + "Sig_" + str( id ), "--privkey-pem", CERTIFICATE + "," + CERTIFICATE, tmpfile.name ) if ret == 127: print >> sys.stderr, XMLSEC1 + ": invocation error\n" diff --git a/protogeni/xmlrpc/protogeni-wrapper.pl.in b/protogeni/xmlrpc/protogeni-wrapper.pl.in index 76791463371779ec3f6c876975cfbcb1867ecf5e..6281fc11a79710e4369d3814db9c820f827bd5dd 100644 --- a/protogeni/xmlrpc/protogeni-wrapper.pl.in +++ b/protogeni/xmlrpc/protogeni-wrapper.pl.in @@ -58,7 +58,8 @@ my $user = "geniuser"; my $group = "GeniSlices"; # Need a command line option. -my $debug = 1; +my $debug = 0; +my $mailerrors = 1; # Determined by version. my $responder; @@ -296,6 +297,9 @@ if ($@) { else { if (GeniResponse::IsError($result)) { $message .= "Error: " . $result->{'code'} . "\n"; + if ($mailerrors) { + print STDERR "Mail Errors is on.\n"; + } } else { $message .= "Code: " . $result->{'code'} . "\n"; diff --git a/tbsetup/ptopgen.in b/tbsetup/ptopgen.in index 22887176e808739ae05059c03f86819e94a4586e..dd65729a74820449812bbd78f81ca5b68aa907a0 100644 --- a/tbsetup/ptopgen.in +++ b/tbsetup/ptopgen.in @@ -1196,7 +1196,7 @@ if ($widearea && ! defined($component_name)) { if ($iface && $genimode eq $NO_GENI) { print_simple_link($physnode, $iface, $fake_inet_switch, $fake_inet_iface, - 100000, 0, 0, @inet_protos); + 100000, 0, 0, \@inet_protos); } # Insert into nodes array in case there are wires entries. @@ -1213,7 +1213,7 @@ if ($genimode ne $NO_GENI) { if (defined($nodes{$node})) { print_simple_link($node, $iface, $fake_inet_switch, $fake_inet_iface, - 100000, 0, 0, @inet_protos); + 100000, 0, 0, \@inet_protos); } } } @@ -1413,7 +1413,7 @@ while (($node1,$card1,$port1,$node2,$card2,$port2) = print_simple_link($node1, $iface1, $node2, $iface2, - $bw, 0, 0, @types); + $bw, 0, 0, \@types); } } } @@ -1490,10 +1490,10 @@ if (! defined($component_name)) { # This is really dumb - BigInts like to print out with a leading '+', # which we don't want. Stript it off. $speed =~ s/^\+|-//; - print_named_link("link-$interconnect", + print_named_interconnect("link-$interconnect", $src, "(null)", $dst, "(null)", - $speed, 0, 0, "ethernet"); + $speed, 0, 0, ["ethernet"]); } } @@ -1551,7 +1551,7 @@ if (! defined($component_name)) { } print_simple_link($node, $iface, $fake_air_switch, $fake_air_iface, - $max_bw, 0, 0, @intersection); + $max_bw, 0, 0, \@intersection); } } @@ -1977,19 +1977,20 @@ sub print_named_link_ptop my $bw = shift(@_); my $delay = shift(@_); my $loss = shift(@_); - my $proto_count = scalar(@_); + my @proto = @{ shift(@_) }; + my $is_interconnect = shift(@_); my $source_full = "$source:$source/$source_if"; # Not sure about (null) stuff ... my $dest_full = "$dest:" . (($dest_if eq "(null)") ? "$dest_if" : "$dest/$dest_if"); - if ($source =~ /cisco/ && $dest =~ /cisco/) + if ($is_interconnect) { $source_full = $source; $dest_full = $dest; } print "link $name $source_full " - . "$dest_full $bw $delay $loss 1 " . join(" ", @_) . "\n"; + . "$dest_full $bw $delay $loss 1 " . join(" ", @proto) . "\n"; } sub print_named_link_xml @@ -2002,7 +2003,9 @@ sub print_named_link_xml my $bw = shift(@_); my $delay = shift(@_); my $loss = shift(@_); - my $proto_count = scalar(@_); + my @proto = @{ shift(@_) }; + my $is_interconnect = shift(@_); + my $proto_count = scalar(@proto); if ($genimode ne $NO_GENI) { print "" . $_[$i] + print " " . $proto[$i] . "\n"; } elsif ($genimode eq $V_0_1 || $genimode eq $V_0_2) { - print " \n"; + print " \n"; } elsif ($genimode eq $V_2) { - print " \n"; + print " \n"; } } print "\n\n"; @@ -2095,9 +2098,18 @@ sub print_interface_contents sub print_named_link { if (!$do_xml) { - print_named_link_ptop(@_); + print_named_link_ptop(@_, 0); } elsif ($do_xml) { - print_named_link_xml(@_); + print_named_link_xml(@_, 0); + } +} + +sub print_named_interconnect +{ + if (!$do_xml) { + print_named_link_ptop(@_, 1); + } elsif ($do_xml) { + print_named_link_xml(@_, 1); } }