Commit 3a99095b authored by Mike Hibler's avatar Mike Hibler
Browse files

A couple of fixes for linktest on openvz vnodes.

Don't try to run rude/crude with increased priority as it will fail.
For truely unshaped links (tb-set-noshaping + 0 delay + 0 loss) don't
check for a specific latency as it can be extremely low. We still do the
ping tests, we just check to make sure that ping packets get through without
checking the RTT; i.e., it is not just a connectivity test.
parent 9129398c
#!/usr/bin/perl -w -T
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -150,7 +150,8 @@ struct ( edge => {
mac => '$',
mpxstyle => '$',
dstyle => '$',
symlanignore => '$'});
symlanignore => '$',
isunshaped => '$'});
struct ( host => {
name => '$',
......@@ -218,6 +219,7 @@ my $total_error_count = 0;
my $warn_partial_test = 0;
my $warn_unshaped_links = 0;
my $warn_totallyunshaped_links = 0;
my $listener_iperf;
my $listener_crude;
......@@ -503,6 +505,10 @@ if (&dotest(TEST_BW)) {
if (&dotest(TEST_LOSS)) {
if ($printsched) {
&schedlog("start crude listener");
} elsif ($platform eq LINUX && $hostmap{$hostname}->isvnode) {
# XXX Linux vnodes (openvz) cannot change their priority
$listener_crude = &start_listener($PATH_CRUDE,"-l",CRUDE_DAT);
$listeners++;
} else {
$listener_crude = &start_listener($PATH_CRUDE,"-l",CRUDE_DAT,
"-P",CRUDE_PRI);
......@@ -542,8 +548,16 @@ if ($warn_partial_test) {
&post_event(EVENT_REPORT, $msg);
&debug("\n$msg\n\n");
}
if ($warn_totallyunshaped_links && &dotest(TEST_LATENCY)) {
my $msg = "*** WARNING: no shaping on one or more".
" zero-latency, zero-loss vnode-to-vnode links;".
" checking only connectivity and not latency for those links.";
&sim_event(EVENT_LOG, $msg);
&post_event(EVENT_REPORT, $msg);
&debug("\n$msg\n\n");
}
if ($warn_unshaped_links && &dotest(TEST_BW)) {
my $msg = "*** WARNING: tb-set-noshaping used on one or more links,".
my $msg = "*** WARNING: no BW shaping on one or more links;".
" skipping BW tests for those links.";
&sim_event(EVENT_LOG, $msg);
&post_event(EVENT_REPORT, $msg);
......@@ -979,9 +993,14 @@ sub loss_test {
# So, we add the extra rude option if conditions are met.
#
if ($numvnodes && $hostmap{$hostname}->isvnode) {
my $hz = `/sbin/sysctl kern.clockrate 2>/dev/null`;
if ($hz =~ /\shz = (\d+),/) {
$rude_arg = "-C $1";
if ($platform eq BSD) {
my $hz = `/sbin/sysctl kern.clockrate 2>/dev/null`;
if ($hz =~ /\shz = (\d+),/) {
$rude_arg = "-C $1";
}
} else {
# assume linux runs at 1K HZ
$rude_arg = "-C 1000";
}
}
......@@ -997,6 +1016,9 @@ sub loss_test {
&get_loss_sample_size($edge) .
", time=" .
LOSS_TEST_DURATION . "s, psize=20)");
} elsif ($platform eq LINUX &&
$hostmap{$hostname}->isvnode) {
&my_system($PATH_RUDE,"-s", RUDE_CFG, $rude_arg);
} else {
&my_system($PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI,
$rude_arg);
......@@ -1021,6 +1043,9 @@ sub loss_test {
&get_loss_sample_size($edge) .
", time=" .
LOSS_TEST_DURATION . "s, psize=20)");
} elsif ($platform eq LINUX &&
$hostmap{$hostname}->isvnode) {
&my_system($PATH_RUDE,"-s", RUDE_CFG, $rude_arg);
} else {
&my_system($PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI,
$rude_arg);
......@@ -1415,9 +1440,23 @@ sub latency_test {
while(&has_elems(\@edge_copy)) {
my ($edge,$other_edge) = &get_twoway_assign(\@edge_copy, 0);
if(defined($edge) && defined($other_edge)) {
if($hostname eq $edge->src ) {
# todo: consider ignoring latency if no delay node.
if($hostname eq $edge->src) {
if(&valid_latency($edge) && &valid_latency($other_edge)) {
my $unshaped = 0;
#
# If both ends of the link are vnodes and there is no
# shaping on the link, then latency could be anything
# depending on the virtual interface implementation.
# In this case we still ping just to ensure connectivity.
#
if ($hostmap{$edge->src}->isvnode &&
$edge->isunshaped &&
$hostmap{$other_edge->src}->isvnode &&
$other_edge->isunshaped) {
&debug("Testing connectivity only for " . &print_link($edge) . " to " . &print_link($other_edge) . "\n");
$unshaped = 1;
}
#
# Tell ping to wait at least one round-trip time.
......@@ -1449,7 +1488,7 @@ sub latency_test {
&print_edge($edge) .
": count/avg/stddev = ".
"$result_cnt/$sample_avg/$sample_dev ".
"(expected $u)\n");
($unshaped?"":"(expected $u)\n"));
exit(EXIT_OK);
}
......@@ -1459,7 +1498,7 @@ sub latency_test {
my $errmsg = "No packets received (n=$n)\n";
&error(NAME_LATENCY, $edge, $errmsg);
exit(EXIT_NOT_OK);
} else {
} elsif (!$unshaped) {
my $u = &link_rtt($edge, $other_edge);
my $x_bar = $sample_avg;
......@@ -2214,6 +2253,7 @@ sub get_topo {
$edge->mac($row[4]);
$edge->mpxstyle($row[5]);
$edge->dstyle($row[6]);
$edge->isunshaped(0);
#
# If the link is not doing BW shaping
......@@ -2226,6 +2266,19 @@ sub get_topo {
if ($edge->dstyle =~ /(\w+)-nobw$/) {
$edge->bw(LIMIT_BW_HI+1);
$edge->dstyle($1);
#
# If there is also no delay or loss specified,
# then there is no shaping being done at all
# and we make a note of this as it can cause
# extremely low latency to be seen.
#
if ($edge->delay == 0 && $edge->loss == 0) {
$edge->isunshaped(1);
if ($hostmap{$edge->src}->isvnode &&
$hostmap{$edge->dst}->isvnode) {
$warn_totallyunshaped_links++;
}
}
$warn_unshaped_links++;
}
......
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