GEMINI/Tutorial/Images: gdcli_gec23.sh

File gdcli_gec23.sh, 1.2 KB (added by Hussamuddin Nasir, 4 years ago)
Line 
1#!/bin/bash
2
3SLICENAME=$2
4PROJECTNAME=$1
5
6if [ -z "$SLICENAME" ] ; then
7    echo "Missing Slicename"
8    echo "USAGE $0 <PROJECTNAME> <SLICENAME>"
9    exit 1;
10fi
11
12if [ -z "$PROJECTNAME" ] ; then
13    echo "Missing Projectname"
14    echo "USAGE $0 <PROJECTNAME> <SLICENAME>"
15    exit 1;
16fi
17
18echo "Performing GDCLI operation for SLICE=$SLICENAME PROJECT=$PROJECTNAME"
19
20echo "Running List nodes command"
21gdcli listnodes -s $SLICENAME -r $PROJECTNAME
22
23echo "Installing iperf on all nodes"
24gdcli run -s $SLICENAME -r $PROJECTNAME -n "node-0,node-1" -c "sudo apt-get -y update;sudo apt-get -y install iperf"
25
26echo "Starting iperf server in daemon mode on node-0"
27gdcli run -s $SLICENAME -r $PROJECTNAME -n "node-0" -c "iperf -s -D> /dev/null 2>&1"
28
29echo "Starting iperf client on node-1"
30echo Connecting to node-0 blasting traffic at 10Gb/s for 30 seconds"
31gdcli run -s $SLICENAME -r $PROJECTNAME -n "node-1" -c "iperf -t 30 -c node-0 -b 10000M
32
33echo "Fetch graph for data collected on link at interface on node-0"
34gdcli getpng -s $SLICENAME -r $PROJECTNAME  -g linkbytes -l link-0 -n node-0 -o ~/Desktop/mygraphs
35
36echo "Open Folder $HOME/Desktop/mygraphs to view graphs just downloaded"