From ee1fc1603d774676e80bcef6c96946efa87965ce Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Thu, 2 Jul 2020 11:11:32 +0200 Subject: Create runtime setup for the script Change-Id: I1a1207173b065c3b88b4b62e134c2fda33e0e6ec Issue-ID: INT-1642 Signed-off-by: Bartek Grzybowski --- test/security/check_for_ingress_and_nodeports.py | 10 ++++----- test/security/requirements.txt | 2 ++ test/security/setup.py | 28 ++++++++++++++++++++++++ test/security/tox.ini | 9 ++++++++ 4 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 test/security/requirements.txt create mode 100644 test/security/setup.py create mode 100644 test/security/tox.ini diff --git a/test/security/check_for_ingress_and_nodeports.py b/test/security/check_for_ingress_and_nodeports.py index f2b7be09e..e7950a0d7 100755 --- a/test/security/check_for_ingress_and_nodeports.py +++ b/test/security/check_for_ingress_and_nodeports.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # COPYRIGHT NOTICE STARTS HERE # -# Copyright 2019 Samsung Electronics Co., Ltd. +# Copyright 2020 Samsung Electronics Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,13 +25,13 @@ # with self signed certificate (HTTPU). # Verbose option retrives HTTP header and prints it for each service # -# Dependencies: +# To setup runtime environment execute: # -# pip3 install kubernetes -# pip3 install colorama +# $ tox +# $ source .tox/security/bin/activate # # Environment: -# This script should be run on the local machine which has network access to the onap K8S cluster. +# This script should be run on on a host with access to the Onap K8S cluster API. # It requires k8s cluster config file on local machine. # # Example usage: diff --git a/test/security/requirements.txt b/test/security/requirements.txt new file mode 100644 index 000000000..8683da168 --- /dev/null +++ b/test/security/requirements.txt @@ -0,0 +1,2 @@ +kubernetes +colorama diff --git a/test/security/setup.py b/test/security/setup.py new file mode 100644 index 000000000..7e71bda03 --- /dev/null +++ b/test/security/setup.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +# COPYRIGHT NOTICE STARTS HERE +# +# Copyright 2020 Samsung Electronics Co., Ltd. +# +# 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. +# +# COPYRIGHT NOTICE ENDS HERE + +import setuptools + +setuptools.setup( + install_requires=[ + 'kubernetes', + 'colorama' + ] +) diff --git a/test/security/tox.ini b/test/security/tox.ini new file mode 100644 index 000000000..fde5cd49c --- /dev/null +++ b/test/security/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = security +skipsdist = True + +[testenv] +deps = -r{toxinidir}/requirements.txt + +[testenv:security] +basepython = python3 -- cgit 1.2.3-korg