From a0d67adf3f8c6f2a869fd2440c0b862860e1479d Mon Sep 17 00:00:00 2001 From: Qiaowei Ren Date: Tue, 20 Mar 2018 13:44:22 +0800 Subject: [PATCH] Add k8s test case Change-Id: I7ef6fd6aa31fae47cca446d31b6b54d13454df9c Signed-off-by: Qiaowei Ren --- requirements.txt | 1 + setup.cfg | 5 +---- stor4nfv_tests/main.py | 6 ------ stor4nfv_tests/stor4nfv_k8s.py | 26 ++++++++++++++++++++++++++ 4 files changed, 28 insertions(+), 10 deletions(-) delete mode 100644 stor4nfv_tests/main.py create mode 100644 stor4nfv_tests/stor4nfv_k8s.py diff --git a/requirements.txt b/requirements.txt index c290b99..818eef3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ # process, which may cause wedges in the gate later. opnfv # Apache-2.0 functest # Apache-2.0 +functest-kubernetes # Apache-2.0 xtesting # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 0ce95bc..b46a7db 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,4 @@ home-page = https://wiki.opnfv.org/display/PROJ/Stor4NFV [files] packages = stor4nfv_tests - -[entry_points] -console_scripts = - stor4nfv-test = stor4nfv_tests.main:main +scripts = stor4nfv_tests/stor4nfv_k8s.py diff --git a/stor4nfv_tests/main.py b/stor4nfv_tests/main.py deleted file mode 100644 index 1bbe352..0000000 --- a/stor4nfv_tests/main.py +++ /dev/null @@ -1,6 +0,0 @@ -import sys - - -def main(): - """stor4nfv main""" - print ('This is main of stor4nfv test case') diff --git a/stor4nfv_tests/stor4nfv_k8s.py b/stor4nfv_tests/stor4nfv_k8s.py new file mode 100644 index 0000000..541cf36 --- /dev/null +++ b/stor4nfv_tests/stor4nfv_k8s.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# +# Copyright (c) 2018 All rights reserved +# This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# + +import sys +import os +import subprocess + +import functest_kubernetes.k8stest as k8stest + + +class K8sStor4nfvTest(k8stest.K8sTesting): + + """Stor4NFV Kubernetes test suite""" + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs.get("case_name", 'stor4nfv_k8s') + super(K8sStor4nfvTest, self).__init__(**kwargs) + self.check_envs() + self.cmd = ['/src/k8s.io/kubernetes/cluster/validate-cluster.sh'] -- 2.16.6