blob: 02f82e9a620d4829e521e621cb3c7b1e3f543037 [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
Thomas Vachuskaf3e12d02017-01-09 15:46:18 -080015 set theTerm to (create window with default profile)
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -070016
17 tell theTerm
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -070018 launch session \"Default\"
19 tell the current session
Thomas Vachuskaf3e12d02017-01-09 15:46:18 -080020 set columns to 256
21 set rows to 24
Thomas Vachuskaeef7f3a2015-03-18 21:01:04 -070022 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"