Add CLI scripts from osken to be installed via setup.cfg
Instead of keeping hardcoded files in bin/ directory it is more flexible to install such files using setup.cfg file. It will for example install files with correct shebang for python2 and python3. This patch also removes tools/osken-manager.spec file as it was used by PyInstaller in Ryu and it isn't used in os-ken. Change-Id: Ie85c64d81c86f0059528ad4d8e238a4124d4e5b4
This commit is contained in:
parent
eb94ee01bc
commit
a74bac9100
20
bin/osken
20
bin/osken
@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
|
|
||||||
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
# implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
from os_ken.cmd.osken_base import main
|
|
||||||
main()
|
|
@ -1,19 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
# implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
from os_ken.cmd.manager import main
|
|
||||||
main()
|
|
@ -5,7 +5,7 @@ Components of OS-Ken
|
|||||||
Executables
|
Executables
|
||||||
===========
|
===========
|
||||||
|
|
||||||
bin/osken-manager
|
osken-manager
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
The main executable.
|
The main executable.
|
||||||
|
@ -102,7 +102,7 @@ Invoking Example
|
|||||||
================
|
================
|
||||||
The example is as follows::
|
The example is as follows::
|
||||||
|
|
||||||
% PYTHONPATH=. ./bin/osken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest
|
% osken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest
|
||||||
loading app os_ken.app.simple_isolation
|
loading app os_ken.app.simple_isolation
|
||||||
loading app os_ken.app.rest
|
loading app os_ken.app.rest
|
||||||
loading app os_ken.controller.ofp_handler
|
loading app os_ken.controller.ofp_handler
|
||||||
|
@ -87,7 +87,7 @@ Usage
|
|||||||
|
|
||||||
2. Run OS-Ken with sample application: ::
|
2. Run OS-Ken with sample application: ::
|
||||||
|
|
||||||
$ sudo ./bin/osken-manager os_ken/app/simple_switch_snort.py
|
$ sudo osken-manager os_ken/app/simple_switch_snort.py
|
||||||
|
|
||||||
The incoming packets will all mirror to **port 3** which should be connect to Snort network interface. You can modify the mirror port by assign a new value in the ``self.snort_port = 3`` of ``simple_switch_snort.py``
|
The incoming packets will all mirror to **port 3** which should be connect to Snort network interface. You can modify the mirror port by assign a new value in the ``self.snort_port = 3`` of ``simple_switch_snort.py``
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ The incoming packets will all mirror to **port 3** which should be connect to Sn
|
|||||||
|
|
||||||
2. Run OS-Ken with sample application (On the Controller): ::
|
2. Run OS-Ken with sample application (On the Controller): ::
|
||||||
|
|
||||||
$ ./bin/osken-manager os_ken/app/simple_switch_snort.py
|
$ osken-manager os_ken/app/simple_switch_snort.py
|
||||||
|
|
||||||
3. Run Snort (On the Snort machine): ::
|
3. Run Snort (On the Snort machine): ::
|
||||||
|
|
||||||
|
@ -187,4 +187,4 @@ Run test_of_config app::
|
|||||||
|
|
||||||
If you don't install os_ken and are working in the git repo directly::
|
If you don't install os_ken and are working in the git repo directly::
|
||||||
|
|
||||||
# PYTHONPATH=. ./bin/osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest
|
# osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest
|
||||||
|
@ -20,9 +20,9 @@ VRRPManager creates/deletes VRRPRouter, VRRPInterfaceMonitor
|
|||||||
dynamically as requested.
|
dynamically as requested.
|
||||||
|
|
||||||
Usage example
|
Usage example
|
||||||
PYTHONPATH=. ./bin/osken-manager --verbose \
|
osken-manager --verbose \
|
||||||
os_ken.services.protocols.vrrp.manager \
|
os_ken.services.protocols.vrrp.manager \
|
||||||
os_ken.services.protocols.vrrp.dumper
|
os_ken.services.protocols.vrrp.dumper
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
sample router manager.
|
sample router manager.
|
||||||
(un-)instantiate routers
|
(un-)instantiate routers
|
||||||
Usage example:
|
Usage example:
|
||||||
PYTHONPATH=. ./bin/osken-manager --verbose \
|
osken-manager --verbose \
|
||||||
os_ken.services.protocols.vrrp.manager \
|
os_ken.services.protocols.vrrp.manager \
|
||||||
os_ken.services.protocols.vrrp.dumper \
|
os_ken.services.protocols.vrrp.dumper \
|
||||||
os_ken.services.protocols.vrrp.sample_manager
|
os_ken.services.protocols.vrrp.sample_manager
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from os_ken.base import app_manager
|
from os_ken.base import app_manager
|
||||||
|
@ -20,10 +20,10 @@ a template for router implementation that support VRRP
|
|||||||
Those routers needs to be created by someone else.
|
Those routers needs to be created by someone else.
|
||||||
sample_manager.routerManager is an example.
|
sample_manager.routerManager is an example.
|
||||||
Usage example:
|
Usage example:
|
||||||
PYTHONPATH=. ./bin/osken-manager --verbose \
|
osken-manager --verbose \
|
||||||
os_ken.services.protocols.vrrp.manager \
|
os_ken.services.protocols.vrrp.manager \
|
||||||
os_ken.services.protocols.vrrp.dumper \
|
os_ken.services.protocols.vrrp.dumper \
|
||||||
os_ken.services.protocols.vrrp.sample_manager
|
os_ken.services.protocols.vrrp.sample_manager
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
@ -29,7 +29,7 @@ TIMEOUT = 60
|
|||||||
OSKEN_HOST = '127.0.0.1'
|
OSKEN_HOST = '127.0.0.1'
|
||||||
OSKEN_PORT = 6633
|
OSKEN_PORT = 6633
|
||||||
PYTHON_BIN = '.venv/bin/python'
|
PYTHON_BIN = '.venv/bin/python'
|
||||||
OSKEN_MGR = './bin/osken-manager'
|
OSKEN_MGR = 'osken-manager'
|
||||||
|
|
||||||
|
|
||||||
class OVS12KernelSwitch(OVSKernelSwitch):
|
class OVS12KernelSwitch(OVSKernelSwitch):
|
||||||
|
@ -33,7 +33,7 @@ Then run linc
|
|||||||
# rel/linc/bin/linc console
|
# rel/linc/bin/linc console
|
||||||
|
|
||||||
Then run os_ken
|
Then run os_ken
|
||||||
# PYTHONPATH=. ./bin/osken-manager --verbose \
|
# osken-manager --verbose \
|
||||||
os_ken/tests/integrated/test_of_config.py
|
os_ken/tests/integrated/test_of_config.py
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
r"""
|
r"""
|
||||||
Usage:
|
Usage:
|
||||||
PYTHONPATH=. ./bin/osken-manager --verbose \
|
osken-manager --verbose \
|
||||||
os_ken.services.protocols.vrrp.dumper \
|
os_ken.services.protocols.vrrp.dumper \
|
||||||
os_ken.services.protocols.vrrp.sample_manager.py \
|
os_ken.services.protocols.vrrp.sample_manager.py \
|
||||||
os_ken.tests.integrated.test_vrrp_linux_multi \
|
os_ken.tests.integrated.test_vrrp_linux_multi \
|
||||||
os_ken.app.rest
|
os_ken.app.rest
|
||||||
|
|
||||||
os_ken.services.protocols.vrrp.dumper is optional.
|
os_ken.services.protocols.vrrp.dumper is optional.
|
||||||
os_ken.app.rest is merely to prevent osken-manager from exiting.
|
os_ken.app.rest is merely to prevent osken-manager from exiting.
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
r"""
|
r"""
|
||||||
Usage:
|
Usage:
|
||||||
PYTHONPATH=. ./bin/osken-manager --verbose \
|
osken-manager --verbose \
|
||||||
os_ken.topology.switches \
|
os_ken.topology.switches \
|
||||||
os_ken.tests.integrated.test_vrrp_multi \
|
os_ken.tests.integrated.test_vrrp_multi \
|
||||||
os_ken.services.protocols.vrrp.dumper
|
os_ken.services.protocols.vrrp.dumper
|
||||||
|
|
||||||
os_ken.services.protocols.vrrp.dumper is optional.
|
os_ken.services.protocols.vrrp.dumper is optional.
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ run_tests() {
|
|||||||
run_pylint() {
|
run_pylint() {
|
||||||
echo "Running pylint ..."
|
echo "Running pylint ..."
|
||||||
PYLINT_OPTIONS="--rcfile=.pylintrc --output-format=parseable"
|
PYLINT_OPTIONS="--rcfile=.pylintrc --output-format=parseable"
|
||||||
PYLINT_INCLUDE="os_ken bin/osken bin/osken-manager os_ken/tests/bin/osken-client"
|
PYLINT_INCLUDE="os_ken os_ken/tests/bin/osken-client"
|
||||||
export PYTHONPATH=$PYTHONPATH:.os_ken
|
export PYTHONPATH=$PYTHONPATH:.os_ken
|
||||||
PYLINT_LOG=pylint.log
|
PYLINT_LOG=pylint.log
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@ classifier =
|
|||||||
packages =
|
packages =
|
||||||
os_ken
|
os_ken
|
||||||
|
|
||||||
|
[entry_points]
|
||||||
|
console_scripts =
|
||||||
|
osken = os_ken.cmd.osken_base:main
|
||||||
|
osken-manager = os_ken.cmd.manager:main
|
||||||
|
|
||||||
[compile_catalog]
|
[compile_catalog]
|
||||||
directory = os_ken/locale
|
directory = os_ken/locale
|
||||||
domain = os_ken
|
domain = os_ken
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
# -*- mode: python -*-
|
|
||||||
|
|
||||||
block_cipher = None
|
|
||||||
|
|
||||||
|
|
||||||
a = Analysis(['../bin/osken-manager'],
|
|
||||||
pathex=['../os_ken'],
|
|
||||||
binaries=None,
|
|
||||||
datas=None,
|
|
||||||
hiddenimports=['os_ken.controller.ofp_handler'],
|
|
||||||
hookspath=[],
|
|
||||||
runtime_hooks=[],
|
|
||||||
excludes=[],
|
|
||||||
win_no_prefer_redirects=False,
|
|
||||||
win_private_assemblies=False,
|
|
||||||
cipher=block_cipher)
|
|
||||||
pyz = PYZ(a.pure, a.zipped_data,
|
|
||||||
cipher=block_cipher)
|
|
||||||
exe = EXE(pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.zipfiles,
|
|
||||||
a.datas,
|
|
||||||
name='osken-manager',
|
|
||||||
debug=False,
|
|
||||||
strip=False,
|
|
||||||
upx=True,
|
|
||||||
console=True)
|
|
Loading…
Reference in New Issue
Block a user