Commit 8f592596 authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 37ffe0b9 bdb6959b
......@@ -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.
......
......@@ -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 =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n".
"<credential xml:id=\"ref1\">\n".
"<credential xml:id=\"ref$id\">\n".
" <type>privilege</type>\n".
" <serial>$idx</serial>\n".
" <owner_gid>$owner_cert</owner_gid>\n".
......
......@@ -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"
......
......@@ -3146,6 +3146,10 @@ sub AddLinkToSolution($$$$$$$$)
$member0->_lannode($nodeB);
$member0->_lanport($portB);
}
else {
$member0->_lannode("null");
$member0->_lanport("null");
}
}
}
elsif (($lan,$virtA) =
......@@ -3656,7 +3660,7 @@ sub AllocNodes($)
if (exists($self->solution()->{'TORESERVE'}->{$nodeid})) {
$self->newreserved()->{$nodeid} = $nodeid;
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY())
if (!($self->impotent() || $self->alloconly()));
if ($self->impotent());
#
# Fix all of the nodes assigned to the pnode.
......@@ -3769,7 +3773,7 @@ sub AllocNodes($)
# Mark it for teardown by the caller (tbswap currently).
#
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN())
if (!($self->impotent() || $self->alloconly()));
if (! $self->impotent());
}
elsif ($pnode->_reuse() eq "reboot") {
#
......@@ -3777,7 +3781,7 @@ sub AllocNodes($)
# it should be rebooted.
#
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY())
if (!($self->impotent() || $self->alloconly()));
if (! $self->impotent());
}
}
skip:
......@@ -4134,8 +4138,7 @@ sub AllocVirtNodes($)
"nodeid" => $physical,
"debug" => 0,
"verbose" => $self->verbose(),
"impotent" => $self->impotent() ||
$self->alloconly(),
"impotent" => $self->impotent(),
"sharedokay" => $sharedokay,
"regression" => $self->regression()})
< 0) {
......@@ -4225,7 +4228,7 @@ sub AllocVirtNodes($)
# state they were in so that os_setup/vnode_setup know they
# need to reboot them.
#
if (!($self->impotent() || $self->alloconly())) {
if (! $self->impotent()) {
if (!exists($self->current_v2v()->{$virtual})) {
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_CLEAN());
}
......@@ -4234,6 +4237,12 @@ sub AllocVirtNodes($)
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY());
}
}
#
# When doing alloconly, we have to set the vname for the
# physical nodes so that update works.
#
$pnode->ModifyReservation({"vname" => $virtual}) == 0
or return -1 if (!$self->impotent() && $self->alloconly());
}
# Since we have some extra physical vnodes reserved on this pnode,
......@@ -4246,7 +4255,9 @@ sub AllocVirtNodes($)
my $pnode = $self->pnodes()->{$pname};
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN())
if (!($self->impotent() || $self->alloconly()));
if (!$self->impotent() &&
$pnode->allocstate() ne
TBDB_ALLOCSTATE_RES_INIT_CLEAN());
}
}
}
......
......@@ -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 "<link ";
my $cmurn = GeniHRN::Generate($OURDOMAIN, "authority", "sa");
......@@ -2044,12 +2047,12 @@ sub print_named_link_xml
my $i = 0;
for (; $i < $proto_count; ++$i) {
if ($genimode eq $NO_GENI) {
print " <link_type><type_name>" . $_[$i]
print " <link_type><type_name>" . $proto[$i]
. "</type_name></link_type>\n";
} elsif ($genimode eq $V_0_1 || $genimode eq $V_0_2) {
print " <link_type type_name=\"" . $_[$i] . "\" />\n";
print " <link_type type_name=\"" . $proto[$i] . "\" />\n";
} elsif ($genimode eq $V_2) {
print " <link_type name=\"" . $_[$i] . "\" />\n";
print " <link_type name=\"" . $proto[$i] . "\" />\n";
}
}
print "</link>\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);
}
}
......
......@@ -58,7 +58,8 @@ $default_image = Image::LookupByName($emulab_ops, $default_imagename);
if ($freebsd_mfs == null || $default_image == null ||
$rhl_std == null || $fbsd_std == null || $frisbee_mfs == null) {
PAGEERROR("You must add images from Utah into your database" .
" before adding a nodetype. See installation documentation for details!",1);
" before adding a nodetype. ".
"See installation documentation for details!",1);
}
# This belongs elsewhere!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment