blob: add607b1616201ac52fce29c4a3ba62f66343c06 [file] [log] [blame]
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# Test utility to spawn an iTerm window for testing against current cell.
4#-------------------------------------------------------------------------------
5
6cellName=$ONOS_CELL
Claudine Chiu45312d02016-06-15 13:17:12 +00007nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ')
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -07008
9osascript -e "
10tell application \"iTerm\"
11
12 set cellName to \"$cellName\"
13 set paneCount to $nodeCount
14
15 set theTerm to (make new terminal)
16
17 tell theTerm
18 set number of columns to 292
19 set number of rows to 24
20 launch session \"Default\"
21 tell the current session
22 set name to \"ONOS Shell 1\"
23 write text \"cell \" & cellName
24 write text \"oi 1 && clear && echo Node \$OCI\"
25 end tell
26 end tell
27
28 tell theTerm
29 repeat with thePane from 2 to paneCount
30 tell the current session
31 tell application \"System Events\" to keystroke \"d\" using command down
32 set name to \"ONOS Shell \" & thePane
33 write text \"cell \" & cellName
34 write text \"oi \" & thePane & \" && clear && echo Node \$OCI\"
35 end tell
36 end repeat
37 end tell
38
39 tell application \"System Events\" to keystroke \"I\" using command down
40
41end tell
42"