Commit a9dc0086 authored by Mike Hibler's avatar Mike Hibler

Merge remote branch 'origin/tpm-tmcd' into tpm-tmcd

Conflicts:
	db/libdb.pm.in
	event/stated/stated.in
parents 1f6ba160 f4cca17f
event/trafgen/tg2.0
.merge-build
......@@ -117,3 +117,25 @@ check: $(TESTS)
fi \
done
endif
ifeq ($(MERGE_BUILD),1)
.PRECIOUS: ${SRCDIR}/*
#
# I really want to say something like:
# ${TESTBED_SRCDIR}/.merged: $(wildcard ${OBJDIR}/${MERGE_BUILD_SANDBOX}/${SUBDIR}/*)
# but that causes problems if one the prereq. has a rule for it (such
# as when both GNUmakefile and GNUmakefile.in exist in the source tree),
# thus I do the equivalent manually
#
newest=$(shell ls -rtd "${OBJDIR}/${MERGE_BUILD_SANDBOX}/${SUBDIR}/"* "${TESTBED_SRCDIR}/.merged" | tail -n 1)
ifneq ($(newest),${TESTBED_SRCDIR}/.merged)
${TESTBED_SRCDIR}/.merged:
cd ${TESTBED_SRCDIR} && utils/merge-build sync
.PHONY: ${TESTBED_SRCDIR}/.merged
else
${TESTBED_SRCDIR}/.merged:
endif
${SRCDIR}/*: ${TESTBED_SRCDIR}/.merged
endif
......@@ -91,4 +91,7 @@ STANDALONE_CLEARINGHOUSE = @STANDALONE_CLEARINGHOUSE@
NODE_USAGE_SUPPORT = @NODE_USAGE_SUPPORT@
MERGE_BUILD = @MERGE_BUILD@
MERGE_BUILD_SANDBOX = @MERGE_BUILD_SANDBOX@
EXP_VIS_SUPPORT = @EXP_VIS_SUPPORT@
This diff is collapsed.
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -72,6 +72,7 @@ use lib "@prefix@/lib";
use libaudit;
use libdb;
use libtestbed;
use User;
#
# Function prototypes
......
......@@ -158,6 +158,10 @@ if (@ARGV < 1) {
my $orgunit = shift(@ARGV);
my $uuid = (@ARGV ? shift(@ARGV) : undef);
# Moved before uuid generation. Might be a race, might not.
TBScriptLock("mkusercert") == 0 or
fatal("Could not get the lock!");
# Generate/confirm uuid
if (!defined($uuid)) {
$uuid = NewUUID();
......@@ -176,9 +180,6 @@ if (!defined($email)) {
chdir("$WORKDIR") or
fatal("Could not chdir to $WORKDIR: $!");
TBScriptLock("mkusercert") == 0 or
fatal("Could not get the lock!");
#
# Need an index file, which is the openssl version of the DB.
#
......
......@@ -584,8 +584,8 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg,
tb_plink *phys_link =
new tb_plink(componentId.c_str(),
tb_plink::PLINK_NORMAL, str_first_type.c_str(),
srcMac.c_str(), dstMac.c_str(),
shortNames[src_iface], shortNames[dst_iface]);
src_pnode->name, srcMac.c_str(), shortNames[src_iface],
dst_pnode->name, dstMac.c_str(), shortNames[dst_iface]);
phys_link->delay_info.bandwidth = bandwidth;
phys_link->delay_info.delay = latency;
......
......@@ -269,8 +269,8 @@ int parse_ptop(tb_pgraph &pg, tb_sgraph &sg, istream& input)
for (int cur = 0;cur<num;++cur) {
pedge pe = (add_edge(srcv,dstv,pg)).first;
tb_plink *pl = new
tb_plink(name,tb_plink::PLINK_NORMAL,link_type,srcmac,dstmac,
srciface,dstiface);
tb_plink(name,tb_plink::PLINK_NORMAL,link_type,srcnode->name,srcmac,
srciface,dstnode->name,dstmac,dstiface);
put(pedge_pmap,pe,pl);
pl->delay_info.bandwidth = ibw;
pl->delay_info.delay = idelay;
......
......@@ -407,7 +407,8 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg) {
// other stuff if I remove them... bummer!
tb_plink *phys_link =
new tb_plink(name.c(), tb_plink::PLINK_NORMAL, str_first_type,
"(null)", "(null)", src_iface.c(), dst_iface.c());
src_pnode->name, "(null)", src_iface.c(),
dst_pnode->name, "(null)", dst_iface.c());
phys_link->delay_info.bandwidth = bandwidth.i();
phys_link->delay_info.delay = latency.i();
......
......@@ -360,10 +360,11 @@ public:
typedef enum {PLINK_NORMAL,PLINK_INTERSWITCH,PLINK_LAN} plinkType;
typedef hash_set<fstring> type_set;
tb_plink(fstring _name, plinkType _is_type, fstring _type, fstring _srcmac, fstring
_dstmac, fstring _srciface, fstring _dstiface)
tb_plink(fstring _name, plinkType _is_type, fstring _type, fstring _srcnode, fstring _srcmac,
fstring _srciface, fstring _dstnode, fstring _dstmac, fstring _dstiface)
: name(_name), srcmac(_srcmac), dstmac(_dstmac), is_type(_is_type),
srciface(_srciface), dstiface(_dstiface),
srcnode(_srcnode), dstnode(_dstnode),
delay_info(), bw_used(0), emulated(0), nonemulated(0),
penalty(0.0), fixends(false), current_endpoints(), current_count(0),
vedge_counts() {
......@@ -371,6 +372,7 @@ public:
}
fstring name; // the name
fstring srcnode,dstnode; // source and destination node names
fstring srcmac,dstmac; // source and destination MAC addresses.
fstring srciface, dstiface; // source and destination interface names
......
......@@ -60,7 +60,7 @@ extern tb_sgraph SG; // switch fabric
void score_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode);
void unscore_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode);
bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
pedge &out_edge, bool flipped, bool check_src_iface,
pedge &out_edge, bool check_src_iface,
bool check_dst_iface);
int find_interswitch_path(pvertex src_pv,pvertex dest_pv,
int bandwidth,pedge_path &out_path,
......@@ -250,13 +250,25 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
pedge pe;
// Direct link (have to check both interfaces if they are fixed)
if (find_best_link(dest_pv,pv,vlink,pe,flipped,true,true)) {
if (find_best_link(dest_pv,pv,vlink,pe,true,true)) {
tb_link_info info(tb_link_info::LINK_DIRECT);
info.plinks.push_back(pe);
resolutions.push_back(info);
total_weight += LINK_RESOLVE_DIRECT;
SDEBUG(cerr << " added a direct_link " << pe << endl);
}
/*
* IMPORTANT NOTE ABOUT find_best_link -
*
* We have to tell it whether it is supposed to check the source of the
* vlink, the dest of the vlink, or both, for fixed interfaces. Of course, we
* only want to check the 'node' side, not the switch side, of interswitch
* and intraswitch paths. Of course, which end we're looking at depends on
* the order we're traversing the vlink - the flipped variable. This is why
* you see 'flipped' and '!flipped' passed to find_best_link() below.
*/
// Intraswitch link
pedge first,second;
for (pvertex_set::iterator switch_it = pnode->switches.begin();
......@@ -291,9 +303,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
if (first_link) {
SDEBUG(cerr << " intraswitch: finding first link" << endl;)
// Check only whether the source interface is fixed - this is the
// first link in a multi-hop path
if (!find_best_link(pv,*switch_it,vlink,first,flipped,true,false)) {
// See note above
if (!find_best_link(pv,*switch_it,vlink,first,!flipped,flipped)) {
SDEBUG(cerr << " intraswitch failed - no link first" <<
endl;)
// No link to this switch
......@@ -302,11 +313,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
}
if (second_link) {
// Check only whether the dest interface is fixed - this is the
// last link in a multi-hop path
SDEBUG(cerr << " intraswitch: finding second link (" << ")" << endl;)
if (!find_best_link(dest_pv,*switch_it,vlink,second,flipped,
false,true)) {
// See note above
if (!find_best_link(dest_pv,*switch_it,vlink,second,flipped,!flipped)) {
// No link to this switch
SDEBUG(cerr << " intraswitch failed - no link second" <<
endl;)
......@@ -375,10 +384,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
// Get link objects
if (first_link) {
// Check only whether the source interface is fixed - this is the
// first link in a multi-hop path
if (!find_best_link(pv,*source_switch_it,vlink,first,flipped,
true,false)) {
// See note above
if (!find_best_link(pv,*source_switch_it,vlink,first,!flipped,flipped)) {
// No link to this switch
SDEBUG(cerr << " interswitch failed - no first link"
<< endl;)
......@@ -387,11 +394,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
}
if (second_link) {
// Check only whether the dest interface is fixed - this is the
// last link in a multi-hop path
if (!find_best_link(dest_pv,*dest_switch_it,vlink,second,flipped,
false,true)) {
// No link to tshis switch
// See note above
if (!find_best_link(dest_pv,*dest_switch_it,vlink,second,flipped,!flipped)) {
// No link to this switch
SDEBUG(cerr << " interswitch failed - no second link" << endl;)
continue;
}
......@@ -521,6 +526,7 @@ void resolve_link(vvertex vv, pvertex pv, tb_vnode *vnode, tb_pnode *pnode,
if (dest_vv == vv) {
dest_vv = source(edge,VG);
SDEBUG(cerr << " dest_vv is backwards" << endl);
}
/*
......@@ -1482,8 +1488,19 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip
return 0;
}
/*
* Find the best link between two physical nodes, making sure it matches the
* requirements of the given vlink. Returns results in the out_edge parameter
* NOTE: assumes the caller has done enough bookkeeping to know whether the
* source and dest interfaces need to be checked for fixed interfaces - that
* is: check_src_iface should be set if:
* this is a direct link OR
* we're mapping the end of an inter or intra switch link that connects to
* the 'source' vnode in the vlink structure
* Similar rules apply to check_dst_iface
*/
bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
pedge &out_edge, bool flipped, bool check_src_iface,
pedge &out_edge, bool check_src_iface,
bool check_dst_iface)
{
pvertex dest_pv;
......@@ -1506,58 +1523,62 @@ bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
continue;
}
// XXX: Not 100% sure it's better to do this inside find_best_link rather
// than in the caller
// if (flipped) {
// // If the endpoints are flipped, then we need to flip our notion of
// // which ones need to be compared.
// bool tmp = check_src_iface;
// check_src_iface = check_dst_iface;
// check_dst_iface = tmp;
// SDEBUG(cerr << " find_best_link: flipping interface comparisons" << endl;)
// }
SDEBUG(cerr << " find_best_link: fix_src_iface = " <<
vlink->fix_src_iface << " check_src_iface = " << check_src_iface
<< " fix_dst_iface = " << vlink->fix_dst_iface
<< " check_dst_iface = " << check_dst_iface
<< " flipped = " << flipped << endl);
<< " check_dst_iface = " << check_dst_iface << endl;)
// Whether we check the 'source' or 'destination' on the vlink against
// the phyisical link's source interface depends on whether the
// interface order in the in the pedge matches the interface order in
// the vlink
bool plink_order_reversed;
tb_vnode *src_vnode = get(vvertex_pmap,vlink->src);
tb_pnode *src_pnode = get(pvertex_pmap,src_vnode->assignment);
if (src_pnode->name != plink->srcnode) {
SDEBUG(cerr << " find_best_link: plink and vlink in " <<
"different order (" << src_pnode->name << " != " <<
plink->srcnode << ")" << endl;)
plink_order_reversed = true;
} else {
SDEBUG(cerr << " find_best_link: plink and vlink in " <<
"same order (" << src_pnode->name << " == " <<
plink->srcnode << ")" << endl;)
plink_order_reversed = false;
}
// If the vlink has a fixed source interface, and it doesn't match
// this plink, skip it
if (vlink->fix_src_iface && check_src_iface) {
// Whether we check the 'source' or 'destination' on the vlink against
// the phyisical link's source interface depends on whether we're
// traversing the link if forward or reverse (flipped) order
// fstring compare_iface = vlink->src_iface;
fstring compare_iface = (flipped? vlink->dst_iface : vlink->src_iface);
if (plink->srciface != compare_iface) {
// The interface name we compare to on the plink depends on wether it
// goes in the same 'direction' as the vlink
fstring compare_iface = (plink_order_reversed? plink->dstiface : plink->srciface);
if (vlink->src_iface != compare_iface) {
SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix source: " << plink->srciface << " != " <<
"): Fix source: " << vlink->src_iface << " != " <<
compare_iface << endl);
continue;
} else {
SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix source: " << plink->srciface << " == " <<
"): Fix source: " << vlink->src_iface << " == " <<
compare_iface << endl);
}
}
// Same for destination
// Yes, this really is srciface
// XXX: This only works because we always have the node as the 'source'
// of a plink! Shouldn't depend on this!
if (vlink->fix_dst_iface && check_dst_iface) {
// fstring compare_iface = vlink->dst_iface;
fstring compare_iface = (flipped? vlink->src_iface : vlink->dst_iface);
if (plink->srciface != compare_iface) {
// The interface name we compare to on the plink depends on wether it
// goes in the same 'direction' as the vlink
fstring compare_iface = (plink_order_reversed? plink->srciface : plink->dstiface);
if (vlink->dst_iface != compare_iface) {
SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix dst: " << plink->srciface << " != " <<
"): Fix dst: " << vlink->dst_iface << " != " <<
compare_iface << endl);
continue;
} else {
SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix dst: " << plink->srciface << " == " <<
"): Fix dst: " << vlink->dst_iface << " == " <<
compare_iface << endl);
}
}
......
......@@ -51,7 +51,9 @@ use libdb;
use libtestbed;
use User;
use Project;
use OSinfo;
use Image;
use Node;
# Protos
sub fatal($);
......
......@@ -52,6 +52,8 @@ use libtestbed;
use User;
use Project;
use Image;
use OSinfo;
use Node;
# Protos
sub fatal($);
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007, 2008 University of Utah and the Flux Group.
# Copyright (c) 2007-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -53,6 +53,7 @@ $| = 1;
use lib "@prefix@/lib";
use libdb;
use libtestbed;
use User;
#
# We don't want to run this script unless its the real version.
......
......@@ -44,6 +44,8 @@
#undef ISOLATEADMINS
#undef DYNAMICROOTPASSWORDS
#undef TPM
#undef NOSHAREDFS
#undef NFSRACY
#undef HAVE_SRANDOMDEV
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ AC_SUBST(PATH)
CPPFLAGS="-I/usr/local/include"
# BEGIN Python detection.
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
AC_PATH_PROGS(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2)
if test x"$PYTHON" = x""; then
AC_MSG_ERROR([python not detected])
......@@ -219,6 +219,8 @@ AC_SUBST(GMAP_API_KEY)
AC_SUBST(NODE_USAGE_SUPPORT)
AC_SUBST(NOSTACKMIB)
AC_SUBST(EXP_VIS_SUPPORT)
AC_SUBST(NOSHAREDFS)
AC_SUBST(SELFLOADER_DATA)
#
# Offer both versions of the email addresses that have the @ escaped
......@@ -307,6 +309,9 @@ STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0
NOSTACKMIB=0
NOSHAREDFS=0
NFSRACY=1
SELFLOADER_DATA="__DATA__"
#
# XXX You really don't want to change these!
......@@ -423,7 +428,12 @@ fi
if test $TPM -eq 1; then
AC_DEFINE_UNQUOTED(TPM, 1)
fi
if test $NOSHAREDFS -eq 1; then
AC_DEFINE_UNQUOTED(NOSHAREDFS, 1)
fi
if test $NFSRACY -eq 1; then
AC_DEFINE_UNQUOTED(NFSRACY, 1)
fi
LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED)
......@@ -546,6 +556,13 @@ if test -z "$EVENTSERVER"; then
fi
AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER")
#
# Perl SelfLoader
# XXX this is a hack which enables us to disable it on versions of perl
# where there are problems with taint checking in the SelfLoader module.
#
AC_DEFINE_UNQUOTED(SELFLOADER_DATA, "$SELFLOADER_DATA")
#
# LEDA library path
#
......@@ -674,6 +691,7 @@ else
event/etc/elvind-boss.conf event/etc/elvind-ops.conf \
event/etc/elvind-inetd.conf event/etc/GNUmakefile\
event/sched/GNUmakefile \
event/new_sched/GNUmakefile \
event/tbgen/GNUmakefile \
event/example/GNUmakefile event/example/tbsend.pl \
event/example/tbrecv.pl event/example/tbsend-short.pl \
......@@ -692,7 +710,6 @@ else
event/linktest/GNUmakefile \
event/linktest/iperf/GNUmakefile \
event/linktest/rude/GNUmakefile \
event/linktest/linktest.pl \
event/linktest/weblinktest event/linktest/linktest.proxy \
event/linktest/linktest_control \
event/linktest/run_linktest.pl";
......@@ -738,7 +755,6 @@ else
AC_DEFINE_UNQUOTED(WINSUPPORT, 1)
fi
#
# Check for ulsshxmlrpc header
#
......@@ -813,6 +829,28 @@ if test "$TBMAINSITE" = 1; then
FANCYBANNER=1
fi
#
# Merge build
#
MERGE_BUILD=0
MERGE_BUILD_SANDBOX=
if test -e "$srcdir/.merge-build"; then
merge_sandbox=`grep source-tree "$srcdir/.merge-build" | cut -d' ' -f2`
merge_tree=`grep merge-tree "$srcdir/.merge-build" | cut -d' ' -f2`
if test "$srcdir" -ef "$srcdir/$merge_sandbox/$merge_tree"; then
MERGE_BUILD=1
MERGE_BUILD_SANDBOX=$srcdir/$merge_sandbox
echo "#/bin/sh" > sync
echo >> sync
echo "cd \"$srcdir\"" >> sync
echo "utils/merge-build sync" >> sync
chmod +x sync
echo "Merge-build enabled"
fi
fi
AC_SUBST(MERGE_BUILD)
AC_SUBST(MERGE_BUILD_SANDBOX)
outfiles="$outfiles Makeconf GNUmakefile \
assign/GNUmakefile \
named/GNUmakefile firewall/GNUmakefile \
......@@ -838,7 +876,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
lib/GNUmakefile lib/libtb/GNUmakefile \
os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
os/imagezip/ffs/GNUmakefile os/imagezip/extfs/GNUmakefile os/imagezip/ext4fs/GNUmakefile \
os/imagezip/shd/GNUmakefile os/imagezip/hashmap/GNUmakefile \
os/imagezip/hashmap/GNUmakefile \
os/frisbee.redux/GNUmakefile os/growdisk/GNUmakefile \
os/syncd/GNUmakefile os/dijkstra/GNUmakefile \
os/genhostsfile/GNUmakefile os/zapdisk/GNUmakefile \
......@@ -975,6 +1013,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
apache/GNUmakefile apache/httpd.conf \
xmlrpc/GNUmakefile xmlrpc/emulabclient.py xmlrpc/emulabserver.py \
xmlrpc/sshxmlrpc_client.py xmlrpc/sshxmlrpc_server.py \
xmlrpc/sslxmlrpc_client.py xmlrpc/sslxmlrpc_server.py \
xmlrpc/webxmlrpc xmlrpc/script_wrapper.py xmlrpc/libxmlrpc.pm \
xmlrpc/emulab xmlrpc/node xmlrpc/experiment xmlrpc/fs xmlrpc/user \
xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \
......
......@@ -14,7 +14,6 @@ use vars qw(@ISA @EXPORT);
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
use libdb;
use libtestbed;
use Project;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2009 University of Utah and the Flux Group.
# Copyright (c) 2009, 2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -33,7 +33,6 @@ sub FWTEARDOWN() { return 4; }
my $cnetstack = "-S Control";
my $cnetvlanname = "Control";
use lib '@prefix@/lib';
use emdbi;
use libdb;
use libtestbed;
......
#
# 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.
#
SRCDIR = @srcdir@
......@@ -29,7 +29,8 @@ LIBEXEC_SCRIPTS = $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) xmlconvert
LIB_SCRIPTS = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \
NodeType.pm Interface.pm User.pm Group.pm Project.pm \
Image.pm OSinfo.pm Archive.pm Logfile.pm Lan.pm emdbi.pm \
emdb.pm emutil.pm Firewall.pm VirtExperiment.pm libGeni.pm
emdb.pm emutil.pm Firewall.pm VirtExperiment.pm libGeni.pm \
libEmulab.pm EmulabConstants.pm TraceUse.pm EmulabFeatures.pm
# Stuff installed on plastic.
USERSBINS = genelists.proxy dumperrorlog.proxy backup
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-2009 University of Utah and the Flux Group.
# Copyright (c) 2005-2010 University of Utah and the Flux Group.
# All rights reserved.
#
package Group;
......@@ -665,7 +665,7 @@ sub Trust($$)
#
# User must be active to be trusted.
#
return PROJMEMBERTRUST_NONE
return PROJMEMBERTRUST_NONE()
if ($user->status() ne USERSTATUS_ACTIVE());
#
......@@ -676,7 +676,7 @@ sub Trust($$)
#
# No membership is the same as no trust. True? Maybe an error instead?
#
return PROJMEMBERTRUST_NONE