Commit 0b96dfbe authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

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

parents 3718362b accbcc41
VERSION export-subst
# Files that already had DOS-style line endings and those
# that require them should be added to the list below.
delay/linux/iptables_mods/iptables-1.3.6-imq.diff -crlf
......
event/trafgen/tg2.0
event/linktest/iperf/iperf-2.0.2
event/linktest/rude/rude-0.70
sensors/nfstrace/nfsdump2/Makefile
sensors/nfstrace/nfsdump2/config.h
sensors/nfstrace/nfsdump2/config.log
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
# Testbed Makefile
......@@ -33,7 +33,7 @@ ifeq ($(STANDALONE_CLEARINGHOUSE),0)
SUBDIRS = lib db assign www @optional_subdirs@ ipod security sensors \
pxe tbsetup account tmcd utils backend tip capture ipod vis \
sensors os xmlrpc install/newnode_sshkeys mote tools/whol \
tools/svn wiki bugdb collab protogeni node_usage
tools/svn wiki bugdb collab protogeni node_usage install
ifeq ($(ISMAINSITE),1)
SUBDIRS += tools/rmanage
endif
......@@ -41,7 +41,7 @@ else
SUBDIRS = db tbsetup account protogeni
endif
all: all-subdirs
all: all-subdirs just-builddirs
#
# We used to statically link our event agents. We no longer do this, but
......@@ -62,17 +62,34 @@ endif
#
# For installation on boss node
#
boss-install: install-schemacheck install-sitevarscheck install-dbfillcheck \
install-genischemacheck install-subdirs install-mkdirs \
boss-install: install-checks \
install-subdirs install-mkdirs \
install-setbuildinfo
@echo "Boss node installed!"
#
# Same target, with the install-schemacheck dependency omitted
#
# Same target, with the checks omitted
boss-install-force: install-subdirs install-mkdirs install-setbuildinfo
@echo "Boss node installed!"
# Skip only the schema checks, but do the other checks.
boss-install-noschemacheck: install-updatecheck \
install-sitevarscheck install-dbfillcheck \
install-genischemacheck install-subdirs install-mkdirs \
install-setbuildinfo
# Skip the update check.
boss-install-noupdatecheck: install-schemacheck \
install-sitevarscheck install-dbfillcheck \
install-genischemacheck install-subdirs install-mkdirs \
install-setbuildinfo
# Only the checks:
install-checks: install-updatecheck \
install-schemacheck \
install-sitevarscheck \
install-dbfillcheck install-genischemacheck
@echo "Installation checks completed!"
clrhouse-install: install-subdirs install-mkdirs
@echo "CleaingHouse code installed!"
......@@ -159,6 +176,10 @@ ifeq ($(STANDALONE_CLEARINGHOUSE),0)
-ln -s /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
endif
just-builddirs:
@$(MAKE) -C rc.d all
@$(MAKE) -C apache all
tipserv-install:
-mkdir -p $(INSTALL_TOPDIR)/log/tiplogs
-mkdir -p $(INSTALL_TOPDIR)/etc
......@@ -197,6 +218,31 @@ endif
@$(MAKE) -C sensors client-install
@$(MAKE) -C tmcd client-install
subboss: client
@$(MAKE) -C os subboss
@$(MAKE) -C utils subboss
subboss-install: subboss
ifeq ($(EVENTSYS),1)
@$(MAKE) -C event client-install
endif
ifneq ($(SYSTEM),CYGWIN_NT-5.1)
@$(MAKE) -C capture client-install
@$(MAKE) -C tip client-install
@$(MAKE) -C tools client-install
endif
@$(MAKE) -C sensors client-install
@$(MAKE) -C utils subboss-install
@$(MAKE) -C os subboss-install
@$(MAKE) -C db subboss-install
@$(MAKE) -C tmcd subboss-install
@$(MAKE) -C rc.d subboss-install
@$(MAKE) -C dhcpd subboss-install
@$(MAKE) -C tbsetup client-install
# Hack: this should probably be done by a subboss-install
# script, but there isn't a huge need for that yet
@rm -f $(INSTALL_RCDIR)/isc-dhcpd
TARBALLDESTDIR = /var/tmp/emulab-client
client-tarball:
......@@ -289,6 +335,42 @@ flashboot-install: destdircheck flashboot
# A check to see if this is a 'real' install. Kinda hacky, but as far as I can
# tell, you can't put ifeq()'s inside of targets
#
ifeq ($(TBROOT),/usr/testbed)
UPDATETESTBED= @cd $(OBJDIR)/install && perl update-testbed
else
UPDATETESTBED= @echo "Skipping update check, since prefix isn't /usr/testbed"
endif
ifeq ($(ISMAINSITE),1)
update-testbed: update-testbed-nostop
else
update-testbed: update-testbed-install
endif
update-testbed-install:
@echo "Updating the testbed ..."
$(UPDATETESTBED) -i -s
update-testbed-noinstall:
@echo "Updating the testbed ..."
$(UPDATETESTBED)
update-testbed-nostop:
@echo "Updating the testbed ..."
$(UPDATETESTBED) -i
update-testbed-force:
@echo "Updating the testbed in force mode ..."
$(UPDATETESTBED) -f
ifeq ($(TBROOT),/usr/testbed)
UPDATECHECK= @cd $(OBJDIR)/install && perl update-testbed -v
else
UPDATECHECK= @echo "Skipping update checks, since prefix isn't /usr/testbed"
endif
install-updatecheck:
@echo "Checking to see if updates need to be run"
$(UPDATECHECK)
ifeq ($(TBROOT),/usr/testbed)
SCHEMACHECK= cd $(OBJDIR)/db && perl schemacheck
else
......@@ -350,6 +432,11 @@ elabinelab:
rm -f $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
tar czf $(INSTALL_TOPDIR)/src/emulab-src.tar.gz -C $(SRCDIR) --exclude=.git .
elabinelab-git:
-mkdir -p $(INSTALL_TOPDIR)/src
rm -f $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
git archive --prefix=testbed/ | gzip -c > $(INSTALL_TOPDIR)/src/emulab-src.tar.gz
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
......@@ -359,7 +446,10 @@ elabinelab:
# By default, make any target by descending into subdirectories.
%: %-subdirs ;
.PHONY: post-install install-mkdirs clrhouse-install install
.PHONY: post-install install-mkdirs clrhouse-install install \
boss-install-noupdatecheck boss-install-noschemacheck \
boss-install-force update-testbed update-testbed-install \
update-testbed-noinstall update-testbed-nostop
# Get rid of a bunch of nasty built-in implicit rules.
.SUFFIXES:
......@@ -90,3 +90,5 @@ HAVE_ULXMLRPCPP = @HAVE_ULXMLRPCPP@
STANDALONE_CLEARINGHOUSE = @STANDALONE_CLEARINGHOUSE@
NODE_USAGE_SUPPORT = @NODE_USAGE_SUPPORT@
EXP_VIS_SUPPORT = @EXP_VIS_SUPPORT@
Version: $Format:%H %ci$
#
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2007, 2010 University of Utah and the Flux Group.
# Copyright (c) 2002-2010 University of Utah and the Flux Group.
# All rights reserved.
#
#
......@@ -54,6 +54,12 @@ httpd.conf.fixed: httpd.conf
install-dirs:
-mkdir -p $(INSTALL_TOPDIR)/www
#
# Well, this is awkward. Make sure we don't try to install anything from
# a dev tree both because it doesn't make any sense and because it would
# clobber the "real" version.
#
ifeq ($(TBROOT),/usr/testbed)
#
# XXX another woeful hack. There appears to be a well-documented problem
# with Apache and PHP4, where loading PHP with certain extensions will cause
......@@ -78,5 +84,9 @@ install: install-dirs install-scripts httpd.conf.fixed
control-install: install-dirs install-scripts httpd.conf-ops
$(INSTALL_DATA) httpd.conf-ops $(INSTALL_APACHE_CONFIG)/httpd.conf
else
install-scripts install control-install:
@echo "Cannot install Apache config in dev tree"
endif
clean:
......@@ -1328,8 +1328,16 @@ CustomLog @prefix@/log/apache_ssl_request_log \
SSLCACertificateFile @prefix@/etc/genica.bundle
# Another bundle of CRLs.
SSLCARevocationFile @prefix@/etc/genicrl.bundle
# Default this to none so that regular web server requests pass.
SSLVerifyClient none
#
# THIS HAS TO BE optional! Why? Cause recent security patches disables SSL
# renegotiation, which is needed when a subdir turns on ssl client
# verification (as we used to). Now, we set it to "optional",
# which avoids the renegotiation problem. The backend scripts MUST
# check their environment to ensure they are always invoked by a client
# supplying a verifiable certificate.
#
SSLVerifyClient optional
SSLVerifyDepth 10
# Reject the unencrypted certs that all users get.
<Location />
......@@ -1340,23 +1348,22 @@ ScriptAlias /protogeni/xmlrpc/ch @prefix@/protogeni/xmlrpc/protogeni-ch.pl
ScriptAlias /protogeni/xmlrpc/cm @prefix@/protogeni/xmlrpc/protogeni-cm.pl
ScriptAlias /protogeni/xmlrpc/sa @prefix@/protogeni/xmlrpc/protogeni-sa.pl
ScriptAlias /protogeni/xmlrpc/ses @prefix@/protogeni/xmlrpc/protogeni-ses.pl
<IfDefine GENI_AM>
ScriptAlias /protogeni/xmlrpc/am @prefix@/protogeni/xmlrpc/geni-am.pl
</IfDefine>
<Directory "@prefix@/www/protogeni">
SSLRequireSSL
Order deny,allow
allow from all
SSLVerifyClient require
SSLVerifyDepth 5
</Directory>
<Directory "@prefix@/protogeni/">
SSLRequireSSL
Order deny,allow
allow from all
SSLOptions +StdEnvVars
SSLOptions +StdEnvVars +ExportCertData
Options +ExecCGI +FollowSymLinks
SetHandler cgi-script
SetEnv USER "nobody"
SSLVerifyClient require
SSLVerifyDepth 5
</Directory>
</IfDefine>
</VirtualHost>
......
This diff is collapsed.
......@@ -8,8 +8,6 @@
* Base class for the annotater.
*/
/* This is ugly, but we only really need this file if we are building with XML support */
#ifdef WITH_XML
#ifndef __ANNOTATE_RSPEC_H
......@@ -28,7 +26,8 @@
class annotate_rspec : public annotate
{
private:
// Enumeration of which interface in a hop is an interface to a link end point
// Enumeration of which interface in a hop
// is an interface to a link end point
enum endpoint_interface_enum { NEITHER, SOURCE, DESTINATION, BOTH };
std::map< std::string, std::set<std::string> > lan_links_map;
......@@ -37,40 +36,76 @@ class annotate_rspec : public annotate
~annotate_rspec () { ; }
// Annotates nodes and direct links in the rspec
void annotate_element(const char* v_name, const char* p_name);
void annotate_element(const char* v_name, const char* p_name);
// Annotates intraswitch and interswitch links in the rspec
void annotate_element(const char* v_name, std::list<const char*>* links);
void annotate_element(const char* v_name,
std::list<const char*>* links);
// Annotate a trivial link
void annotate_element(const char* v_name);
// Annotates an interface element on a link
void annotate_interface (const xercesc::DOMElement* plink, xercesc::DOMElement* vlink, int interface_number);
void annotate_interface (const xercesc::DOMElement* plink,
const xercesc::DOMElement* vlink,
int interface_number,
bool is_trivial_link);
// Annotates an interface element on a non-trivial link
void annotate_interface (const xercesc::DOMElement* plink,
const xercesc::DOMElement* vlink,
int interface_number);
// Annotate a trivial link
void annotate_trivial_link (const char* v_name);
// Creates a hop from a switch till the next end point. Adds the hop to the vlink and returns the hop element that was created
xercesc::DOMElement* create_component_hop (const xercesc::DOMElement* plink, xercesc::DOMElement* vlink, int endpoint_interface, const xercesc::DOMElement* prev_component_hop);
// Annotates an interface element on a trivial link
void annotate_interface (const xercesc::DOMElement* vlink,
int interface_number);
// Creates a hop from a switch till the next end point.
// Adds the hop to the vlink
// Returns the hop element that was created
xercesc::DOMElement* create_component_hop
(const xercesc::DOMElement* plink,
xercesc::DOMElement* vlink,
int endpoint_interface,
const xercesc::DOMElement* prev_hop);
// Creates a component_hop for a trivial link
// Adds the hop to the vlink
// Returns the hop element that was created
xercesc::DOMElement* create_component_hop (xercesc::DOMElement* vlink);
// If the interface is the end point of a link/path, add two additional attributes to it
void set_interface_as_link_endpoint (xercesc::DOMElement* interface, const char* virtual_node_id, const char* virtual_interface_id);
// If the interface is the end point of a link/path,
// add two additional attributes to it
void set_interface_as_link_endpoint (xercesc::DOMElement* interface,
const char* virtual_node_id,
const char* virtual_interface_id);
// Finds the next link in the path returned by assign
xercesc::DOMElement* find_next_link_in_path (xercesc::DOMElement *prev, std::list<const char*>* links);
xercesc::DOMElement* find_next_link_in_path
(xercesc::DOMElement *prev,
std::list<const char*>* links);
// Copies the component spec from the source to the destination
void copy_component_spec(const xercesc::DOMElement* src, xercesc::DOMElement* dst);
void copy_component_spec(const xercesc::DOMElement* src,
xercesc::DOMElement* dst);
// Copies the component hop from the auto-generated link to the requested link
void copy_component_hop(xercesc::DOMElement* requested_link, xercesc::DOMElement* component_hop);
// Copies the component hop from the auto-generated link
// to the requested link
void copy_component_hop(xercesc::DOMElement* requested_link,
xercesc::DOMElement* component_hop);
// Checks if the link contains an interface with virtual_interface_id = id
bool has_interface_with_id (std::string link_virtual_id, std::string id);
// Checks if the link contains an interface with
// virtual_interface_id = id
bool has_interface_with_id (std::string link_id, std::string id);
// Removes all the extra tags and generated elements from the XML document
// Removes all extra tags and generated elements from the XML document
void cleanup ();
// Checks whether an element of type tag with attr_name = attr_value is a generated element
bool is_generated_element (const char* tag, const char* attr_name, const char* attr_value);
// Checks whether an element of type tag
// with attr_name = attr_value is a generated element
bool is_generated_element (const char* tag,
const char* attr_name,
const char* attr_value);
};
#endif //for __ANNOTATE_RSPEC_H
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2009 University of Utah and the Flux Group.
* Copyright (c) 2000-2010 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -440,23 +440,19 @@ void print_help() {
cout << " -o - Allow overloaded pnodes to be considered." << endl;
cout << " -t <float> - Start the temperature at <float> instead of melting."
<< endl;
cout << " -u - Print a summary of the solution." << endl;
cout << " -c <float> - Use the 'connected' pnode finding algorithm " <<
"<float>*100%" << endl << " of the time." << endl;
cout << " -n - Don't anneal - just do the prechecks." << endl;
cout << " -x <file> - Specify a text ptop file" << endl;
#ifdef WITH_XML
cout << " -X <file> - Specify a XML ptop file" << endl;
#endif
cout << " -y <file> - Specify a text top file" << endl;
cout << " -u - Print a summary of the solution." << endl;
cout << " -c <float> - Use the 'connected' pnode finding algorithm ";
cout << "<float>*100%" << endl;
cout << " of the time." << endl;
cout << " -n - Don't anneal - just do the prechecks." << endl;
cout << " -x <file> - Specify a text ptop file" << endl;
cout << " -y <file> - Specify a text top file" << endl;
#ifdef WITH_XML
cout << " -Y <file> - Specify a XML vtop file" << endl;
#endif
#ifdef WITH_XML
cout << " -q <file> - Specify a rspec ptop file" << endl;
cout << " -w <file> - Specify a rspec vtop file" << endl;
cout << " -W <file> - Specify the output rspec file" << endl;
cout << " -W <file> - Specify the output rspec file" << endl;
cout << " -f <T>[/<T>] - Specify the ptop/vtop file formats " << endl;
cout << " T should be one of (text|xml|rspec)" << endl;
cout << " Specifying only one T is equivalent to -f T/T"<<endl;
#endif
cout << " -F - Apply additional checking to fixed nodes" << endl;
cout << " -D - Dump configuration options" << endl;
......@@ -851,7 +847,16 @@ int main(int argc,char **argv) {
char* vtopFilename = "";
char* vtopOutputFilename = 0;
while ((ch = getopt(argc,argv,"s:v:l:t:rpPTdH:oguc:nx:X:y:Y:q:w:W:FD")) != -1) {
#ifdef WITH_XML
char* ptopFileFormat;
char* vtopFileFormat;
char* delims = "/";
char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:W:FDf:";
#else
char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:FD";
#endif
while ((ch = getopt(argc,argv,flags)) != -1) {
switch (ch) {
case 's':
if (sscanf(optarg,"%d",&seed) != 1) {
......@@ -926,16 +931,8 @@ int main(int argc,char **argv) {
}
ptopFilename = optarg;
break;
#ifdef WITH_XML
case 'X':
ptop_xml_input = true;
if (strcmp(optarg, "") == 0) {
print_help();
}
ptopFilename = optarg;
break;
#endif
case 'y':
case 'y':
#ifdef WITH_XML
vtop_xml_input = false;
#endif
......@@ -944,44 +941,64 @@ int main(int argc,char **argv) {
}
vtopFilename = optarg;
break;
#ifdef WITH_XML
case 'Y':
vtop_xml_input = true;
if (strcmp(optarg, "") == 0) {
print_help();
}
vtopFilename = optarg;
case 'F':
check_fixed_nodes = true;
break;
#endif
#ifdef WITH_XML
case 'q':
ptop_rspec_input = true;
if (strcmp(optarg, "") == 0) {
print_help();
}
ptopFilename = optarg;
break;
case 'w':
vtop_rspec_input = true;
if (strcmp(optarg, "") == 0) {
print_help();
}
vtopFilename = optarg;
case 'W':
if (strcmp(optarg, "") == 0) {
print_help();
}
vtopOutputFilename = optarg;
break;
case 'W':
if (strcmp(optarg, "") == 0) {
print_help();
}
vtopOutputFilename = optarg;
break;
case 'f':
if (strcmp(optarg, "") == 0) {
print_help();
}
ptopFileFormat = strtok(optarg, delims);
vtopFileFormat = strtok(NULL, delims);
if (strcmp(ptopFileFormat, "text") == 0) {
ptop_xml_input = false;
}
else if (strstr(ptopFileFormat, "rspec") != NULL) {
ptop_rspec_input = true;
}
else if (strstr(ptopFileFormat, "xml") != NULL){
ptop_xml_input = true;
}
else {
print_help();
}
if (vtopFileFormat == NULL)
{
vtop_xml_input = ptop_xml_input;
vtop_rspec_input = ptop_rspec_input;
}
else
{
if (strcmp(vtopFileFormat, "text") == 0) {
vtop_xml_input = false;
}
else if (strstr(vtopFileFormat, "rspec") != NULL) {
vtop_rspec_input = true;
}
else if (strstr(vtopFileFormat, "xml") != NULL){
vtop_xml_input = true;
}
else {
print_help();
}
}
break;
#endif
case 'F':
check_fixed_nodes = true;
break;
default:
default:
print_help();
}
}
......@@ -1244,4 +1261,3 @@ int main(int argc,char **argv) {
exit(EXIT_SUCCESS);
}
}
......@@ -126,7 +126,11 @@ class fstring {
* Output/debugging functions
*/
friend ostream &operator<<(ostream &o, const fstring &s) {
return(o << s.str);
if (s.str != NULL) {
return(o << s.str);
} else {
return(o << "(null)");
}
}
......
......@@ -91,11 +91,6 @@ int parse_ptop_rspec(tb_pgraph &pg, tb_sgraph &sg, char *filename) {
parser->setDoSchema(true);
parser->setValidationSchemaFullChecking(true);
/*
* Must validate against the ptop schema
*/
parser -> setExternalSchemaLocation ("http://www.protogeni.net/resources/rspec/0.1 " SCHEMA_LOCATION);
/*
* Just use a custom error handler - must admin it's not clear to me why
* we are supposed to use a SAX error handler for this, but this is what
......
......@@ -94,11 +94,6 @@ int parse_vtop_rspec(tb_vgraph &vg, char *filename) {
parser->setDoSchema(true);
parser->setValidationSchemaFullChecking(true);
/*
* Must validate against the ptop schema
*/
parser -> setExternalSchemaLocation ("http://www.protogeni.net/resources/rspec/0.1 " SCHEMA_LOCATION);
/*
* Just use a custom error handler - must admin it's not clear to me why
* we are supposed to use a SAX error handler for this, but this is what
......
......@@ -88,8 +88,18 @@ void score_link_endpoints(pedge pe);
#define SDEBADD(amount) cerr << "SADD: " << #amount << "=" << amount << " from " << score;score+=amount;cerr << " to " << score << endl
#define SDEBSUB(amount) cerr << "SSUB: " << #amount << "=" << amount << " from " << score;score-=amount;cerr << " to " << score << endl
#ifdef SCORE_DEBUG_MAX
// Handy way to print only the first N debugging messages, since that's usually
// enough to get the idea
static unsigned long scoredebugcount = 0;
#endif
#ifdef SCORE_DEBUG
#ifdef SCORE_DEBUG_MAX
#define SDEBUG(a) if (scoredebugcount++ < SCORE_DEBUG_MAX) { a; }
#else
#define SDEBUG(a) a
#endif
#else
#define SDEBUG(a)
#endif
......@@ -207,7 +217,7 @@ void init_score()
float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
pvertex dest_pv, tb_vlink *vlink, tb_pnode *pnode, tb_pnode *dest_pnode,
bool flipped) {
SDEBUG(cerr << " finding link resolutions" << endl);
SDEBUG(cerr << " finding link resolutions from " << pnode->name << " to " << dest_pnode->name << endl);
/* We need to calculate all possible link resolutions, stick
* them in a nice datastructure along with their weights, and
* then select one randomly.
......@@ -245,7 +255,7 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
info.plinks.push_back(pe);
resolutions.push_back(info);
total_weight