Change barometer module to load
authorJose Lausuch <jose.lausuch@ericsson.com>
Tue, 13 Jun 2017 03:26:52 +0000 (11:26 +0800)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 20 Jun 2017 14:02:51 +0000 (16:02 +0200)
As [1] is merged, the way to call the barometer test case is
different as it is hosted in Barometer repo instead of Functest.
The former files are also simply removed too.

baro-tests is no longer a requirement. It is installed as any
third party project.

[1] https://gerrit.opnfv.org/gerrit/#/c/35927/

Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: Iea56b48fa781600eb3a6ac74662ea8a29f556f99
Signed-off-by: Jose Lausuch <jose.lausuch@ericsson.com>
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/Dockerfile
docker/Dockerfile.aarch64
docker/thirdparty-requirements.txt [new file with mode: 0644]
functest/ci/testcases.yaml
functest/opnfv_tests/features/__init__.py [deleted file]
functest/opnfv_tests/features/barometer.py [deleted file]
functest/tests/unit/features/__init__.py [deleted file]
functest/tests/unit/features/test_barometer.py [deleted file]
requirements.txt
tox.ini

index d18c6c9..80864ed 100644 (file)
@@ -79,11 +79,12 @@ RUN mkdir -p ${FUNCTEST_REPO_DIR} \
 
 RUN git config --global http.sslVerify false
 
+COPY thirdparty-requirements.txt thirdparty-requirements.txt
 RUN pip install \
   git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
   git+https://gerrit.opnfv.org/gerrit/releng@$BRANCH#egg=opnfv\&subdirectory=modules \
-  git+https://gerrit.opnfv.org/gerrit/barometer@$BRANCH#egg=baro_tests \
-  git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps
+  git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps \
+  -r thirdparty-requirements.txt
 
 # Hook required by hardcoded paths in Functest
 RUN ln -s /usr/local/lib/python2.7/dist-packages/functest ${FUNCTEST_REPO_DIR}/functest
index eea475a..4fbfeac 100644 (file)
@@ -78,11 +78,12 @@ RUN mkdir -p ${FUNCTEST_REPO_DIR} \
 
 RUN git config --global http.sslVerify false
 
+COPY thirdparty-requirements.txt thirdparty-requirements.txt
 RUN pip install \
   git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
   git+https://gerrit.opnfv.org/gerrit/releng@$BRANCH#egg=opnfv\&subdirectory=modules \
-  git+https://gerrit.opnfv.org/gerrit/barometer@$BRANCH#egg=baro_tests \
-  git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps
+  git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps \
+  -r thirdparty-requirements.txt
 
 # Hook required by hardcoded paths in Functest
 RUN ln -s /usr/local/lib/python2.7/dist-packages/functest ${FUNCTEST_REPO_DIR}/functest
diff --git a/docker/thirdparty-requirements.txt b/docker/thirdparty-requirements.txt
new file mode 100644 (file)
index 0000000..51d21f2
--- /dev/null
@@ -0,0 +1 @@
+git+https://gerrit.opnfv.org/gerrit/barometer#egg=baro_tests
index 7d51832..c30292b 100644 (file)
@@ -447,7 +447,7 @@ tiers:
                     installer: 'fuel'
                     scenario: 'kvm_ovs_dpdk_bar'
                 run:
-                     module: 'functest.opnfv_tests.features.barometer'
+                     module: 'baro_tests.barometer'
                      class: 'BarometerCollectd'
 
     -
diff --git a/functest/opnfv_tests/features/__init__.py b/functest/opnfv_tests/features/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/functest/opnfv_tests/features/barometer.py b/functest/opnfv_tests/features/barometer.py
deleted file mode 100644 (file)
index e210f33..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-#
-# 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
-
-import logging
-
-from baro_tests import collectd
-
-import functest.core.feature as base
-
-
-class BarometerCollectd(base.Feature):
-    '''
-    Class for executing barometercollectd testcase.
-    '''
-
-    __logger = logging.getLogger(__name__)
-
-    def execute(self):
-        return collectd.main(self.__logger)
diff --git a/functest/tests/unit/features/__init__.py b/functest/tests/unit/features/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/functest/tests/unit/features/test_barometer.py b/functest/tests/unit/features/test_barometer.py
deleted file mode 100644 (file)
index 8c2585d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2017 Orange and others.
-#
-# 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
-
-# pylint: disable=missing-docstring
-
-import logging
-import sys
-import unittest
-
-import mock
-
-from functest.core import testcase
-with mock.patch('functest.utils.functest_utils.get_parameter_from_yaml'):
-    from functest.opnfv_tests.features import barometer
-
-
-class BarometerTesting(unittest.TestCase):
-
-    _case_name = "barometercollectd"
-    _project_name = "barometer"
-
-    def setUp(self):
-        self.barometer = barometer.BarometerCollectd(
-            case_name=self._case_name, project_name=self._project_name)
-
-    def test_init(self):
-        self.assertEqual(self.barometer.project_name, self._project_name)
-        self.assertEqual(self.barometer.case_name, self._case_name)
-
-    def test_run_ko(self):
-        sys.modules['baro_tests'].collectd.main = mock.Mock(return_value=1)
-        self.assertEqual(self.barometer.run(),
-                         testcase.TestCase.EX_RUN_ERROR)
-
-    def test_run(self):
-        sys.modules['baro_tests'].collectd.main = mock.Mock(return_value=0)
-        self.assertEqual(self.barometer.run(), testcase.TestCase.EX_OK)
-
-
-if __name__ == "__main__":
-    logging.disable(logging.CRITICAL)
-    unittest.main(verbosity=2)
index 10d83e1..6384f96 100644 (file)
@@ -26,5 +26,4 @@ iniparse==0.4
 PrettyTable<0.8,>=0.7.1 # BSD
 six>=1.9.0 # MIT
 opnfv
-baro-tests
 snaps
diff --git a/tox.ini b/tox.ini
index c8d4545..bdc32ea 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -7,7 +7,6 @@ deps =
   -r{toxinidir}/requirements.txt
   -r{toxinidir}/test-requirements.txt
   git+https://gerrit.opnfv.org/gerrit/releng#egg=opnfv&subdirectory=modules
-  git+https://gerrit.opnfv.org/gerrit/barometer#egg=baro_tests
   git+https://gerrit.opnfv.org/gerrit/snaps#egg=snaps
 commands = nosetests --with-xunit \
   --with-coverage \