blob: 0926772f8c44f5b24721267b1c2d8f7335ecb59e [file] [log] [blame]
Ray Milkey5d35f9c2018-04-02 08:54:51 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Remotely pushes routing scripts a remote mininet test machine.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9routing="${ONOS_ROUTING:-}"
10routing_root="${ONOS_ROUTING:-}"
11
12if [ -z "$routing_root" ]; then
13 routing_root=$(mktemp -d /tmp/routing.XXXXX)
14 ( cd $routing_root && git init && git clone https://gerrit.onosproject.org/routing )
15 routing=$routing_root/routing
16fi
17
18[ ! -d "$routing" ] && echo "routing source tree not found" >&2 && exit 1
19
20node=${1:-$OCN}
21
22ssh $ONOS_USER@$node sudo rm -rf routing
23scp -qr $routing $ONOS_USER@$node:
24
25echo "@stc routing_root=$routing_root"
26echo "@stc routing=$routing"