Adopt functional test to changes into ramdisk-func-test
ramdisk-func-test bring mixin for base test class. Also it provides more comfort way to address template folders. Change-Id: Iea8c92491b9d7a58a8ec806f9da7bf204c3f974e
This commit is contained in:
parent
c1711febfc
commit
af70312e49
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Copyright 2016 Cray Inc. All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import pkg_resources
|
||||
import ramdisk_func_test
|
||||
import unittest2
|
||||
|
||||
|
||||
class TestCase(ramdisk_func_test.TestCaseMixin, unittest2.TestCase):
|
||||
_rft_template_path = pkg_resources.resource_filename(
|
||||
__name__, 'node_templates')
|
@ -13,22 +13,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import unittest2
|
||||
import utils
|
||||
|
||||
from ramdisk_func_test.environment import Environment
|
||||
from bareon import tests_functional
|
||||
from bareon.tests_functional import utils
|
||||
|
||||
|
||||
class DataRetentionTestCase(unittest2.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(DataRetentionTestCase, cls).setUpClass()
|
||||
cls.env = Environment(
|
||||
node_templates="./bareon/tests_functional/node_templates"
|
||||
)
|
||||
cls.env.setupclass()
|
||||
|
||||
class DataRetentionTestCase(tests_functional.TestCase):
|
||||
def setUp(self):
|
||||
super(DataRetentionTestCase, self).setUp()
|
||||
self.images = [
|
||||
@ -106,15 +95,6 @@ Number Start End Size File system Flags
|
||||
1 0.00B 106MB 106MB ext4
|
||||
"""
|
||||
|
||||
def tearDown(self):
|
||||
super(DataRetentionTestCase, self).tearDown()
|
||||
self.env.teardown()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super(DataRetentionTestCase, cls).tearDownClass()
|
||||
cls.env.teardownclass()
|
||||
|
||||
def _assert_vda_equal_to_goldenimage(self, node):
|
||||
self._assert_vda_root_equal_to_goldenimage(node)
|
||||
self._assert_vda_usr_equal_to_goldenimage(node)
|
||||
|
@ -13,31 +13,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import unittest2
|
||||
import utils
|
||||
|
||||
from ramdisk_func_test.environment import Environment
|
||||
from bareon import tests_functional
|
||||
|
||||
|
||||
class LvmTestCase(unittest2.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(LvmTestCase, cls).setUpClass()
|
||||
cls.env = Environment(
|
||||
node_templates="./bareon/tests_functional/node_templates"
|
||||
)
|
||||
cls.env.setupclass()
|
||||
|
||||
def tearDown(self):
|
||||
super(LvmTestCase, self).tearDown()
|
||||
self.env.teardown()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super(LvmTestCase, cls).tearDownClass()
|
||||
cls.env.teardownclass()
|
||||
|
||||
class LvmTestCase(tests_functional.TestCase):
|
||||
def test_multi_volume_multi_group(self):
|
||||
deploy_conf = {
|
||||
"images": [
|
||||
|
@ -15,10 +15,9 @@
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
import unittest2
|
||||
import utils
|
||||
|
||||
from ramdisk_func_test.environment import Environment
|
||||
from bareon import tests_functional
|
||||
|
||||
|
||||
PROVISION_SAMPLE_DATA = {
|
||||
@ -234,25 +233,7 @@ PROVISION_SAMPLE_DATA = {
|
||||
}
|
||||
|
||||
|
||||
class TestNailgun(unittest2.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestNailgun, cls).setUpClass()
|
||||
cls.env = Environment(
|
||||
node_templates="./bareon/tests_functional/node_templates"
|
||||
)
|
||||
cls.env.setupclass()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestNailgun, self).tearDown()
|
||||
self.env.teardown()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super(TestNailgun, cls).tearDownClass()
|
||||
cls.env.teardownclass()
|
||||
|
||||
class TestNailgun(tests_functional.TestCase):
|
||||
def test_provision(self):
|
||||
data = deepcopy(PROVISION_SAMPLE_DATA)
|
||||
data['ks_meta']['image_data']['/']['uri'] = self.env.get_url_for_image(
|
||||
|
@ -14,31 +14,13 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import unittest2
|
||||
import utils
|
||||
import uuid
|
||||
|
||||
from ramdisk_func_test.environment import Environment
|
||||
from bareon import tests_functional
|
||||
|
||||
|
||||
class SingleProvisioningTestCase(unittest2.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(SingleProvisioningTestCase, cls).setUpClass()
|
||||
cls.env = Environment(
|
||||
node_templates="./bareon/tests_functional/node_templates"
|
||||
)
|
||||
cls.env.setupclass()
|
||||
|
||||
def tearDown(self):
|
||||
super(SingleProvisioningTestCase, self).tearDown()
|
||||
self.env.teardown()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super(SingleProvisioningTestCase, cls).tearDownClass()
|
||||
cls.env.teardownclass()
|
||||
|
||||
class SingleProvisioningTestCase(tests_functional.TestCase):
|
||||
def test_provision_two_disks_swift(self):
|
||||
DEPLOY_DRIVER = 'swift'
|
||||
deploy_conf = {
|
||||
@ -208,24 +190,7 @@ Number Start End Size File system Name Flags
|
||||
utils.assertNoDiff(expected, actual)
|
||||
|
||||
|
||||
class MultipleProvisioningTestCase(unittest2.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(MultipleProvisioningTestCase, cls).setUpClass()
|
||||
cls.env = Environment(
|
||||
node_templates="./bareon/tests_functional/node_templates"
|
||||
)
|
||||
cls.env.setupclass()
|
||||
|
||||
def tearDown(self):
|
||||
super(MultipleProvisioningTestCase, self).tearDown()
|
||||
self.env.teardown()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super(MultipleProvisioningTestCase, cls).tearDownClass()
|
||||
cls.env.teardownclass()
|
||||
|
||||
class MultipleProvisioningTestCase(tests_functional.TestCase):
|
||||
def test_multiple_provisioning(self):
|
||||
DEPLOY_DRIVER = 'swift'
|
||||
image_url = self.env.get_url_for_image(
|
||||
|
Loading…
x
Reference in New Issue
Block a user