Skip to content

Commit

Permalink
[test_env] Create explicitly named tmux windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Jun 22, 2015
1 parent 1e9b37a commit 935e34d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/program/snabbnfv/test_env/test_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export qemu=qemu/obj/x86_64-softmmu/qemu-system-x86_64
export tmux_session=""

function tmux_launch {
command="$1 2>&1 | tee $2"
command="$2 2>&1 | tee $3"
if [ -z "$tmux_session" ]; then
tmux_session=test_env-$$
tmux new-session -d -s $tmux_session "$command"
tmux new-session -d -n "$1" -s $tmux_session "$command"
else
tmux new-window -a -t $tmux_session:0 "$command"
tmux new-window -a -n "$1" -t $tmux_session:0 "$command"
fi
}

Expand All @@ -65,6 +65,7 @@ function snabb_log {

function snabb {
tmux_launch \
"snabb$snabb_n" \
"numactl --cpunodebind=$(pci_node $1) --membind=$(pci_node $1) ./snabb $2" \
$(snabb_log)
snabb_n=$(expr $snabb_n + 1)
Expand Down Expand Up @@ -130,6 +131,7 @@ function qemu {
export mqueues=",queues=$QUEUES"
fi
tmux_launch \
"qemu$qemu_n" \
"numactl --cpunodebind=$(pci_node $1) --membind=$(pci_node $1) \
$assets/$qemu \
-kernel $assets/bzImage \
Expand All @@ -148,7 +150,7 @@ function qemu {


function on_exit {
[ -n "$tmux_session" ] && tmux kill-session -t $tmux_session
[ -n "$tmux_session" ] && tmux kill-session -t $tmux_session 2>&1 >/dev/null
rm -f $sockets
exit
}
Expand Down

0 comments on commit 935e34d

Please sign in to comment.