blob: fc33594539d4e728bc52be9b1ee4ef0bb7be55a0 [file] [log] [blame]
demx8as653d47d42021-05-31 12:44:37 +02001#!/usr/bin/env python
2################################################################################
3# Copyright 2021 highstreet technologies GmbH
4#
5# Licensed under the Apache License, Version 2.0 (the 'License');
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an 'AS IS' BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18from libtmux import Pane, Server, Window, exc
19from libtmux.common import has_gte_version
20
21def createLoggingWindow():
22 logging = session.new_window(attach=False, window_name="logging")
23 sdnr = logging.list_panes()[0]
24 sdnr.send_keys('echo "sdnr"', enter=True)
25 sdnr.send_keys('docker exec -it sdnr tail -f /opt/opendaylight/data/log/karaf.log', enter=True)
26
27 ntsim = logging.split_window(attach=False, vertical=True)
28 ntsim.send_keys('echo "ntsim"', enter=True)
29 ntsim.send_keys('docker exec -it ntsim-ng-o-du-1122 tail -f /opt/dev/ntsim-ng/log/log.txt', enter=True)
30
31 ves = logging.split_window(attach=False, vertical=False)
32 ves.send_keys('echo "ves"', enter=True)
33 ves.send_keys('docker logs -f ves-collector', enter=True)
34
35 env = ntsim.split_window(attach=False, vertical=False)
36 env.send_keys('htop', enter=True)
37
38# main
39server = Server()
40session = server.find_where({ "session_name": "integration" })
41
42workspace = session.select_window("workspace")
43pane = workspace.list_panes()[0]
44# pane.send_keys('clear', enter=True)
45pane.send_keys('docker-compose up -d', enter=True)
46pane.send_keys('docker-compose ps', enter=True)
47
48# create logging window, if needed
49logging = session.find_where({'window_name':'logging'})
50if logging is None:
51 createLoggingWindow()
52
53
54