summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-05-17 14:30:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-05-17 14:30:05 +0000
commit553ffefcdaa3d4a0ae61f9ce233b620d51b91d51 (patch)
tree08af5f667dd9009a494b1b1d7876b4457b538b22
parent111944995df899b3895a74fb7de3066d4f4a7bd3 (diff)
parentdd050db125143c682b28a0712ae950301ad659ea (diff)
Merge changes from topics 'YARDSTICK-1154', 'YARDSTICK-1160'
* changes: Kubernetes API "delete_service" missing parameter Bump Kubernetes Python client to version 6.0.0 Avoid "volumeMounts" with "configMap" fixed permissions
-rw-r--r--requirements.txt2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml8
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml4
-rw-r--r--yardstick/common/kubernetes_utils.py13
-rw-r--r--yardstick/orchestrator/kubernetes.py2
-rw-r--r--yardstick/tests/unit/orchestrator/test_kubernetes.py2
6 files changed, 21 insertions, 10 deletions
diff --git a/requirements.txt b/requirements.txt
index 4679bc8fb..76cd0534c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -29,7 +29,7 @@ influxdb==4.1.1 # MIT License; OSI Approved MIT License
IxNetwork==8.40.1124.9 # MIT License; OSI Approved MIT License
jinja2schema==0.1.4 # OSI Approved BSD License
keystoneauth1==3.1.0 # OSI Approved Apache Software License
-kubernetes==3.0.0a1 # OSI Approved Apache Software License
+kubernetes==6.0.0 # OSI Approved Apache Software License
mock==2.0.0 # OSI Approved BSD License; `BSD License`_; http://github.com/testing-cabal/mock/blob/master/LICENSE.txt
msgpack-python==0.4.8 # OSI Approved Apache Software License
netaddr==0.7.19 # BSD License; OSI Approved BSD License; OSI Approved MIT License
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
index 0da296297..5fe902419 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
@@ -40,8 +40,12 @@ context:
host:
image: openretriever/yardstick
command: /bin/bash
- args: ['-c', 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;while true ; do sleep 10000; done']
+ args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.;
+ chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;
+ while true ; do sleep 10000; done']
target:
image: openretriever/yardstick
command: /bin/bash
- args: ['-c', 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;while true ; do sleep 10000; done']
+ args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.;
+ chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;
+ while true ; do sleep 10000; done']
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
index fc7eb006c..fc6496bad 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
@@ -42,7 +42,9 @@ contexts:
host:
image: openretriever/yardstick
command: /bin/bash
- args: ['-c', 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;while true ; do sleep 10000; done']
+ args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.;
+ chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;
+ while true ; do sleep 10000; done']
-
type: Heat
name: openstack
diff --git a/yardstick/common/kubernetes_utils.py b/yardstick/common/kubernetes_utils.py
index 0cf7b9eab..d60c9b23a 100644
--- a/yardstick/common/kubernetes_utils.py
+++ b/yardstick/common/kubernetes_utils.py
@@ -41,6 +41,7 @@ def create_service(template,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
metadata = client.V1ObjectMeta(**template.get('metadata', {}))
@@ -63,7 +64,8 @@ def delete_service(name,
**kwargs): # pragma: no cover
core_v1_api = get_core_api()
try:
- core_v1_api.delete_namespaced_service(name, namespace, **kwargs)
+ body = client.V1DeleteOptions()
+ core_v1_api.delete_namespaced_service(name, namespace, body, **kwargs)
except ApiException:
LOG.exception('Delete Service failed')
@@ -86,7 +88,7 @@ def create_replication_controller(template,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
-
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
try:
core_v1_api.create_namespaced_replication_controller(namespace,
@@ -101,7 +103,7 @@ def delete_replication_controller(name,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
-
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
body = kwargs.get('body', client.V1DeleteOptions())
kwargs.pop('body', None)
@@ -119,7 +121,7 @@ def delete_pod(name,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
-
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
body = kwargs.get('body', client.V1DeleteOptions())
kwargs.pop('body', None)
@@ -147,6 +149,7 @@ def read_pod(name,
def read_pod_status(name, namespace='default', **kwargs): # pragma: no cover
+ # pylint: disable=unused-argument
return read_pod(name).status.phase
@@ -155,6 +158,7 @@ def create_config_map(name,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
metadata = client.V1ObjectMeta(name=name)
body = client.V1ConfigMap(data=data, metadata=metadata)
@@ -169,6 +173,7 @@ def delete_config_map(name,
namespace='default',
wait=False,
**kwargs): # pragma: no cover
+ # pylint: disable=unused-argument
core_v1_api = get_core_api()
body = kwargs.get('body', client.V1DeleteOptions())
kwargs.pop('body', None)
diff --git a/yardstick/orchestrator/kubernetes.py b/yardstick/orchestrator/kubernetes.py
index 198eeac6d..ac3a09ed1 100644
--- a/yardstick/orchestrator/kubernetes.py
+++ b/yardstick/orchestrator/kubernetes.py
@@ -74,7 +74,7 @@ class KubernetesObject(object):
def _add_container(self):
container_name = '{}-container'.format(self.name)
- ssh_key_mount_path = "/root/.ssh/"
+ ssh_key_mount_path = '/tmp/.ssh/'
container = {
"args": self.args,
diff --git a/yardstick/tests/unit/orchestrator/test_kubernetes.py b/yardstick/tests/unit/orchestrator/test_kubernetes.py
index f2bc5b0f4..58971f515 100644
--- a/yardstick/tests/unit/orchestrator/test_kubernetes.py
+++ b/yardstick/tests/unit/orchestrator/test_kubernetes.py
@@ -47,7 +47,7 @@ service ssh restart;while true ; do sleep 10000; done"
"name": "host-k8s-86096c30-container",
"volumeMounts": [
{
- "mountPath": "/root/.ssh/",
+ "mountPath": "/tmp/.ssh/",
"name": "k8s-86096c30-key"
}
]