Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
09a9cd61
Commit
09a9cd61
authored
Dec 13, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel
parents
d3791318
be6af5b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
215 additions
and
9 deletions
+215
-9
event/linktest/CHANGES
event/linktest/CHANGES
+4
-0
event/linktest/ROADMAP.standalone
event/linktest/ROADMAP.standalone
+19
-7
event/linktest/linktest.pl
event/linktest/linktest.pl
+136
-1
event/linktest/run-standalone
event/linktest/run-standalone
+47
-0
event/linktest/standalone.sh
event/linktest/standalone.sh
+1
-1
protogeni/lib/GeniXML.pm.in
protogeni/lib/GeniXML.pm.in
+8
-0
No files found.
event/linktest/CHANGES
View file @
09a9cd61
...
@@ -84,4 +84,8 @@ Other changes:
...
@@ -84,4 +84,8 @@ Other changes:
"kilobits" to be 1024 bits, not 1000 bits as we were assuming. So we now
"kilobits" to be 1024 bits, not 1000 bits as we were assuming. So we now
specify bandwidth in raw bits rather than kilobits.
specify bandwidth in raw bits rather than kilobits.
* Added support for standalone mode (see ROADMAP.standalone)
* Added initial attempt at unlinktest as level 5.
event/linktest/ROADMAP.standalone
View file @
09a9cd61
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
Running in Standalone Mode
Running in Standalone Mode
--------------------------
--------------------------
run-standalone <run-level> <run-path> <log-path> <host-list> [node-list]
run-standalone <run-level> <run-path> <
var-path> <
log-path> <host-list> [node-list]
Uses pssh to simultaneously run linktest in standalone mode for all
Uses pssh to simultaneously run linktest in standalone mode for all
hosts listed.
hosts listed.
...
@@ -10,7 +10,8 @@ hosts listed.
...
@@ -10,7 +10,8 @@ hosts listed.
run-level -- An integer betweeen 1 and 4 with higher numbers
run-level -- An integer betweeen 1 and 4 with higher numbers
performing more tests (see:
performing more tests (see:
http://users.emulab.net/trac/emulab/wiki/linktest).
http://users.emulab.net/trac/emulab/wiki/linktest).
run-path -- Contains the standalone package (manifest described below).
run-path -- Contains execution package (manifest described below).
var-path -- Contains configuration files (manifest described below).
log-path -- An empty directory where low-level error logs are kept.
log-path -- An empty directory where low-level error logs are kept.
host-list -- Comma-delimeted list of hostnames to run on.
host-list -- Comma-delimeted list of hostnames to run on.
node-list -- If the nodes have different control and experimental
node-list -- If the nodes have different control and experimental
...
@@ -25,7 +26,7 @@ Note: Currently node names (those listed in the node-list and the
...
@@ -25,7 +26,7 @@ Note: Currently node names (those listed in the node-list and the
nickname and syncserver hostname described below) are all assumed to
nickname and syncserver hostname described below) are all assumed to
be a single unqualified name (like node-0).
be a single unqualified name (like node-0).
standalone.sh <run-level> <run-path> <log-path> <node-list>
standalone.sh <run-level> <run-path> <
var-path> <
log-path> <node-list>
Invokes linktest with the appropriate arguments.
Invokes linktest with the appropriate arguments.
...
@@ -34,7 +35,7 @@ Invokes linktest with the appropriate arguments.
...
@@ -34,7 +35,7 @@ Invokes linktest with the appropriate arguments.
Standalone Package Manifest
Standalone Package Manifest
---------------------------
---------------------------
Executables:
Executables
in run-path
:
standalone.sh -- Invokes linktest in standalone mode
standalone.sh -- Invokes linktest in standalone mode
linktest.pl -- Main linktest script
linktest.pl -- Main linktest script
...
@@ -45,15 +46,24 @@ bin/emulab-sync -- Sync client for synchronizing different clients
...
@@ -45,15 +46,24 @@ bin/emulab-sync -- Sync client for synchronizing different clients
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Configuration:
Configuration
in var-path
:
boot/nickname -- Contains a single line with the hostname of the
boot/nickname -- Contains a single line with the hostname of the
experimental interface on this node.
experimental interface on this node.
Example:
Example:
node0
node0
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
boot/controlif -- Contains a single line with the control interface
name. This is the interface which is not brought up
or down or modified when doing unlinktest.
Example:
eth4
-------------------------------------------------------------------------------
boot/syncserver -- Contains a single line with the hostname of the sync server.
boot/syncserver -- Contains a single line with the hostname of the sync server.
Example:
Example:
node4
node4
...
@@ -116,7 +126,9 @@ L <first-node> <second-node> <link-name> <mac-address> <mpx-style> <dstyle>
...
@@ -116,7 +126,9 @@ L <first-node> <second-node> <link-name> <mac-address> <mpx-style> <dstyle>
first-node, second-node -- node names of link
first-node, second-node -- node names of link
link-name -- Name of link or lan. All pairs in the link/lan in every
link-name -- Name of link or lan. All pairs in the link/lan in every
direction must be represented.
direction must be represented.
mac-address -- MAC address of specified interface. Used for debugging output.
mac-address -- MAC address of specified interface. Used for debugging
output and unlinktest when determining whether or not
to test this interface node.
mpxstyle -- If 'veth' for virtual ethernet device, changes header size
mpxstyle -- If 'veth' for virtual ethernet device, changes header size
calculations.
calculations.
dstyle -- If ends in '-nobw', skips bandwidth test for this link. If
dstyle -- If ends in '-nobw', skips bandwidth test for this link. If
...
...
event/linktest/linktest.pl
View file @
09a9cd61
...
@@ -39,6 +39,7 @@ sub usage()
...
@@ -39,6 +39,7 @@ sub usage()
"
[LOGDIR=<path/to/log/root>]
\n
"
.
"
[LOGDIR=<path/to/log/root>]
\n
"
.
"
[BINDIR=<path/to/binary/files>]
\n
"
.
"
[BINDIR=<path/to/binary/files>]
\n
"
.
"
[VARDIR=<path/to/config/files>]
\n
"
.
"
[VARDIR=<path/to/config/files>]
\n
"
.
"
[STANDALONE=<1|0>]
\n
"
.
"
[EVENTSERVER=<eventserver hostname>]
\n
");
"
[EVENTSERVER=<eventserver hostname>]
\n
");
print
("
<test step>: 1=conn/latency, 2=routing, 3=loss, 4=BW
\n
"
.
print
("
<test step>: 1=conn/latency, 2=routing, 3=loss, 4=BW
\n
"
.
"
COMPAT=<version>: remain compatible with version <version> or earlier
\n
"
.
"
COMPAT=<version>: remain compatible with version <version> or earlier
\n
"
.
...
@@ -109,12 +110,14 @@ use constant TEST_LATENCY => 1; # direct link connectivity & latency
...
@@ -109,12 +110,14 @@ use constant TEST_LATENCY => 1; # direct link connectivity & latency
use
constant
TEST_RT_STATIC
=>
2
;
# prior plus static routing
use
constant
TEST_RT_STATIC
=>
2
;
# prior plus static routing
use
constant
TEST_LOSS
=>
3
;
# prior plus loss
use
constant
TEST_LOSS
=>
3
;
# prior plus loss
use
constant
TEST_BW
=>
4
;
# prior plus bandwidth
use
constant
TEST_BW
=>
4
;
# prior plus bandwidth
use
constant
TEST_UNLINK
=>
5
;
# prior plus unconnected interfaces
# test names
# test names
use
constant
NAME_RT_STATIC
=>
"
Routing
";
use
constant
NAME_RT_STATIC
=>
"
Routing
";
use
constant
NAME_LATENCY
=>
"
Latency
";
use
constant
NAME_LATENCY
=>
"
Latency
";
use
constant
NAME_LOSS
=>
"
Loss
";
use
constant
NAME_LOSS
=>
"
Loss
";
use
constant
NAME_BW
=>
"
Bandwidth
";
use
constant
NAME_BW
=>
"
Bandwidth
";
use
constant
NAME_UNLINK
=>
"
Unlink
";
# error suffix for logs
# error suffix for logs
use
constant
SUFFIX_ERROR
=>
"
.error
";
use
constant
SUFFIX_ERROR
=>
"
.error
";
...
@@ -240,6 +243,7 @@ our $LOGDIR = "";
...
@@ -240,6 +243,7 @@ our $LOGDIR = "";
our
$SHAREDDIR
=
"";
our
$SHAREDDIR
=
"";
our
$EVENTSERVER
=
"";
our
$EVENTSERVER
=
"";
our
$EVENTID
=
"";
our
$EVENTID
=
"";
our
$STANDALONE
=
0
;
#
#
# Parse command arguments. Since Linktest is run via the event system,
# Parse command arguments. Since Linktest is run via the event system,
...
@@ -295,6 +299,11 @@ foreach my $arg (@ARGV) {
...
@@ -295,6 +299,11 @@ foreach my $arg (@ARGV) {
if
(
$arg
=~
/EVENTSERVER=(.+)/
)
{
if
(
$arg
=~
/EVENTSERVER=(.+)/
)
{
$EVENTSERVER
=
$
1
;
$EVENTSERVER
=
$
1
;
}
}
if
(
$arg
=~
/STANDALONE=(.+)/
)
{
if
(
$
1
eq
"
1
")
{
$STANDALONE
=
1
;
}
}
}
}
$compat
=
99
$compat
=
99
...
@@ -307,6 +316,7 @@ if ($compat < 1.2) {
...
@@ -307,6 +316,7 @@ if ($compat < 1.2) {
# path to applications and files
# path to applications and files
our
$PATH_NICKNAME
=
"
$VARDIR
/boot/nickname
";
our
$PATH_NICKNAME
=
"
$VARDIR
/boot/nickname
";
our
$PATH_CONTROL_IF
=
"
$VARDIR
/boot/controlif
";
our
$PATH_KEYFILE
=
"
$VARDIR
/boot/eventkey
";
our
$PATH_KEYFILE
=
"
$VARDIR
/boot/eventkey
";
our
$PATH_RUDE
=
"
$BINDIR
/emulab-rude
";
our
$PATH_RUDE
=
"
$BINDIR
/emulab-rude
";
our
$PATH_CRUDE
=
"
$BINDIR
/emulab-crude
";
our
$PATH_CRUDE
=
"
$BINDIR
/emulab-crude
";
...
@@ -378,7 +388,9 @@ $ptopology_file = $PATH_PTOPOFILE;
...
@@ -378,7 +388,9 @@ $ptopology_file = $PATH_PTOPOFILE;
# the NFS server.
# the NFS server.
#
#
sleep
(
int
(
rand
(
5
)));
sleep
(
int
(
rand
(
5
)));
&my_system
(
$PATH_RCTOPO
,
"
reconfig
");
if
(
!
$STANDALONE
)
{
&my_system
(
$PATH_RCTOPO
,
"
reconfig
");
}
&get_topo
(
$topology_file
,
$ptopology_file
);
&get_topo
(
$topology_file
,
$ptopology_file
);
&debug_top
();
&debug_top
();
...
@@ -639,6 +651,22 @@ if(&dotest(TEST_BW)){
...
@@ -639,6 +651,22 @@ if(&dotest(TEST_BW)){
&report_status
(
NAME_BW
);
&report_status
(
NAME_BW
);
}
}
if
(
&dotest
(
TEST_UNLINK
))
{
my
$stamp
=
TimeStamp
();
my
$msg
=
"
Testing Unconnected Interfaces ...
$stamp
";
&post_event
(
EVENT_REPORT
,
$msg
);
&sim_event
(
EVENT_LOG
,
$msg
);
# Ick, this barrier makes sure the above message gets into the log
# first, so as not to confuse Mike
if
(
$printsched
)
{
&schedlog
("
barrier
$barriers_hit
: pre-unlink test
");
}
&barrier
();
&debug
("
\n
$msg
\n\n
");
&unlink_test
;
&report_status
(
NAME_UNLINK
);
}
&cleanup
;
&cleanup
;
if
(
$printsched
)
{
if
(
$printsched
)
{
...
@@ -657,6 +685,113 @@ $msg = "Linktest Done";
...
@@ -657,6 +685,113 @@ $msg = "Linktest Done";
exit
(
EXIT_OK
);
exit
(
EXIT_OK
);
##############################################################################
# Unlink Test Functions
##############################################################################
our
$control_if
=
"";
our
%interfaces
=
();
sub
setup_interfaces
{
$control_if
=
`
cat
$PATH_CONTROL_IF
`;
chomp
(
$control_if
);
foreach
my
$link
(
@
{
$hostmap
{
$hostname
}
->
links
})
{
$interfaces
{
lc
(
$link
->
mac
)}
=
1
;
my
$foo
=
$link
->
mac
;
}
}
sub
get_iflist
{
my
$raw
=
`
/sbin/ifconfig -a
`;
my
@result
=
split
("
\n\n
",
$raw
);
return
\
@result
;
}
sub
gather_stats
{
my
@result
=
();
my
@iflist
=
@
{
&get_iflist
()
};
foreach
my
$ifline
(
@iflist
)
{
if
(
$ifline
=~
/^(\w+)\W.*RX packets:([0-9]+) /
)
{
if
(
$
1
ne
$control_if
)
{
push
(
@result
,
$
2
);
}
}
}
return
\
@result
;
}
sub
check_stats
{
my
@first
=
@
{
$_
[
0
]
};
my
@second
=
@
{
$_
[
1
]
};
my
$result
=
0
;
if
(
scalar
(
@first
)
==
scalar
(
@second
))
{
$result
=
1
;
for
(
my
$i
=
0
;
$i
<
scalar
(
@first
);
++
$i
)
{
if
(
$first
[
$i
]
!=
$second
[
$i
])
{
$result
=
0
;
last
;
}
}
}
return
$result
;
}
sub
arpping
{
my
@iflist
=
@
{
&get_iflist
()
};
foreach
my
$ifline
(
@iflist
)
{
if
(
$ifline
=~
/^(\w+)\W.*HWaddr ([0-9a-fA-F:]+)/
)
{
my
$ifname
=
$
1
;
my
$mac
=
lc
(
join
('',
split
('
:
',
$
2
)));
if
(
!
exists
(
$interfaces
{
$mac
})
&&
$ifname
ne
$control_if
)
{
my
$command
=
"
sudo /sbin/ifconfig
$ifname
up;
"
.
"
sudo /sbin/arping -c 1 -w 1 -I
$ifname
10.0.0.1;
"
.
"
sudo /sbin/ifconfig
$ifname
down
";
# print($command."\n");
system
(
$command
);
}
}
}
}
sub
modify_interfaces
{
my
(
$speed
,
$duplex
)
=
@_
;
my
@iflist
=
@
{
&get_iflist
()
};
foreach
my
$ifline
(
@iflist
)
{
if
(
$ifline
=~
/^(\w+)\W.*HWaddr ([0-9a-fA-F:]+)/
)
{
my
$ifname
=
$
1
;
my
$mac
=
lc
(
join
('',
split
('
:
',
$
2
)));
if
(
!
exists
(
$interfaces
{
$mac
})
&&
$ifname
ne
$control_if
)
{
my
$command
=
"
sudo /sbin/ethtool -s
$ifname
speed
$speed
"
.
"
duplex
$duplex
autoneg off
";
# print($command."\n");
system
(
$command
);
}
}
}
}
sub
unlink_test
{
my
@speeds
=
('
10
',
'
100
',
'
1000
');
my
@duplexes
=
('
half
',
'
full
');
&setup_interfaces
();
my
$start
=
&gather_stats
();
&barrier
();
&arpping
();
foreach
my
$speed
(
@speeds
)
{
foreach
my
$duplex
(
@duplexes
)
{
&modify_interfaces
(
$speed
,
$duplex
);
&arpping
();
}
}
&barrier
();
my
$end
=
&gather_stats
();
if
(
!
&check_stats
(
$start
,
$end
))
{
&error
(
NAME_UNLINK
,
undef
,
"
Some interfaces received packets
");
}
}
##############################################################################
##############################################################################
# Loss Test Functions
# Loss Test Functions
...
...
event/linktest/run-standalone
0 → 100755
View file @
09a9cd61
#!/usr/bin/perl -w
use
File::
Temp
qw/ tempfile /
;
if
(
scalar
(
@ARGV
)
<
5
)
{
print
STDERR
'
run-standalone <run-level> <run-path> <var-path> <log-path> <host-list> [node-list]
Uses pssh to simultaneously run linktest in standalone mode for all
hosts listed.
run-level -- An integer betweeen 1 and 4 with higher numbers
performing more tests (see:
http://users.emulab.net/trac/emulab/wiki/linktest).
run-path -- Contains execution package (manifest described below).
var-path -- Contains configuration files (manifest described below).
log-path -- An empty directory where low-level error logs are kept.
host-list -- Comma-delimeted list of hostnames to run on.
node-list -- If the nodes have different control and experimental
interfaces, the hostlist should contain the control
interface names (accessed via pssh) and the nodelist
should contain experimental interface names (used
internally in linktest). If the nodes do not have
separate control interfaces, the nodelist may be
omitted.
Note: Currently node names (those listed in the node-list and the
nickname and syncserver hostname described below) are all assumed to
be a single unqualified name (like node-0).
';
exit
(
1
);
}
(
$level
,
$runpath
,
$varpath
,
$logpath
,
$hosts
,
$nodes
)
=
@ARGV
;
(
$fh
,
$filename
)
=
tempfile
();
@hostList
=
split
("
,
",
$hosts
);
print
$fh
join
("
\n
",
@hostList
);
close
$fh
;
if
(
!
defined
(
$nodes
))
{
$nodes
=
$hosts
;
}
$command
=
"
sh -i -c 'pssh -h
$filename
-o out -e err -t 3000 sh
$runpath
/standalone.sh
$level
$runpath
$varpath
$logpath
$nodes
'
";
print
(
$command
.
"
\n
");
system
(
$command
);
event/linktest/standalone.sh
View file @
09a9cd61
sudo
perl
-w
-T
/proj/tbres/duerig/src/event/linktest/linktest.pl
STARTAT
=
1
STOPAT
=
$1
DOARP
=
0
LOGDIR
=
$3
BINDIR
=
$2
VARDIR
=
$2
sudo
perl
-w
-T
$2
/linktest.pl
STARTAT
=
1
STOPAT
=
$1
DOARP
=
0
LOGDIR
=
$4
BINDIR
=
$2
VARDIR
=
$3
STANDALONE
=
1
protogeni/lib/GeniXML.pm.in
View file @
09a9cd61
...
@@ -195,6 +195,14 @@ sub GetElementByVirtualId($$$)
...
@@ -195,6 +195,14 @@ sub GetElementByVirtualId($$$)
my
($
name
,
$
type
,
$
node
)
=
@
_
;
my
($
name
,
$
type
,
$
node
)
=
@
_
;
my
@
list
=
FindNodes
(
'n:'
.$
type
.
'[@virtual_id = "'
.$
name
.
'"]'
,
my
@
list
=
FindNodes
(
'n:'
.$
type
.
'[@virtual_id = "'
.$
name
.
'"]'
,
$
node
)->
get_nodelist
();
$
node
)->
get_nodelist
();
if
(
scalar
(@
list
)
==
0
)
{
@
list
=
FindNodes
(
'n:'
.$
type
.
'[@nickname = "'
.$
name
.
'"]'
,
$
node
)->
get_nodelist
();
}
if
(
scalar
(@
list
)
==
0
)
{
@
list
=
FindNodes
(
'n:'
.$
type
.
'[@client_id = "'
.$
name
.
'"]'
,
$
node
)->
get_nodelist
();
}
my
$
result
=
undef
;
my
$
result
=
undef
;
if
(
scalar
(@
list
)
>
0
)
if
(
scalar
(@
list
)
>
0
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment