-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
''' | ||
A simple PyREM script to run iperf between two machines. | ||
''' | ||
|
||
import time | ||
from pyrem.host import RemoteHost | ||
|
||
# Declare two hosts. | ||
HOST1 = RemoteHost('tradewars.cs.washington.edu') | ||
HOST2 = RemoteHost('spyhunter.cs.washington.edu') | ||
|
||
# Create tasks to be run on the hosts. | ||
server = HOST1.run(['iperf -s'], quiet=True) | ||
client = HOST2.run(['iperf -c tradewars.cs.washington.edu']) | ||
|
||
# Start the server task. | ||
server.start() | ||
|
||
# Wait for servers to be ready. | ||
time.sleep(1) | ||
|
||
# Run the client task. | ||
client.start(wait=True) | ||
|
||
# Clean up. | ||
server.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#/bin/bash | ||
''' | ||
A simple shell script to run iperf between two machines. | ||
''' | ||
|
||
HOST1='tradewars.cs.washington.edu' | ||
HOST2='spyhunter.cs.washington.edu' | ||
|
||
ssh $HOST1 "iperf -s &" | ||
|
||
sleep 1 | ||
|
||
ssh $HOST2 "iperf -c $HOST1" | ||
|
||
ssh $HOST1 "pkill -u $USER iperf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
''' | ||
A PyREM script to run iperf between multiple machines. | ||
''' | ||
|
||
import time | ||
from pyrem.host import RemoteHost, LocalHost | ||
from pyrem.task import Parallel, Sequential | ||
|
||
# Declare the hosts. | ||
SERVER_HOSTS = [RemoteHost(name + '.cs.washington.edu') for name in | ||
['zork', 'spyhunter', 'tradewars']] | ||
CLIENT_HOST = LocalHost() | ||
|
||
# Create tasks to be run on the hosts. | ||
servers = Parallel([host.run(['iperf -s'], quiet=True) | ||
for host in SERVER_HOSTS]) | ||
client = Sequential([CLIENT_HOST.run(['iperf -c', host.hostname], shell=True) | ||
for host in SERVER_HOSTS]) | ||
|
||
# Start all the servers in parallel. | ||
servers.start() | ||
|
||
# Wait for servers to be ready. | ||
time.sleep(1) | ||
|
||
# Run the client task. | ||
client.start(wait=True) | ||
|
||
# Clean up. | ||
servers.stop() |