options for create_snapshot and for predefined_tar
This commit is contained in:
parent
661345e934
commit
f7b833b313
@ -2,6 +2,8 @@ from fuel_test.cobbler.cobbler_test_case import CobblerTestCase
|
||||
from fuel_test.helpers import is_not_essex
|
||||
import unittest
|
||||
from fuel_test.manifest import Manifest, Template
|
||||
from fuel_test.settings import CREATE_SNAPSHOTS
|
||||
|
||||
|
||||
class CompactTestCase(CobblerTestCase):
|
||||
def deploy_compact(self, quantum=True, loopback=True):
|
||||
@ -25,7 +27,8 @@ class CompactTestCase(CobblerTestCase):
|
||||
quantums=self.nodes().quantums,
|
||||
quantum=True)
|
||||
self.deploy_compact()
|
||||
self.environment().snapshot('compact', force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot('compact', force=True)
|
||||
|
||||
def test_deploy_compact_wo_quantum(self):
|
||||
Manifest().write_openstack_manifest(
|
||||
@ -35,7 +38,8 @@ class CompactTestCase(CobblerTestCase):
|
||||
quantums=self.nodes().quantums,
|
||||
quantum=False)
|
||||
self.deploy_compact(quantum=False)
|
||||
self.environment().snapshot('compact_wo_quantum', force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot('compact_wo_quantum', force=True)
|
||||
|
||||
def test_deploy_compact_wo_loopback(self):
|
||||
Manifest().write_openstack_manifest(
|
||||
@ -45,7 +49,9 @@ class CompactTestCase(CobblerTestCase):
|
||||
quantums=self.nodes().quantums,
|
||||
quantum=False, loopback=False, use_syslog=False)
|
||||
self.deploy_compact(quantum=False, loopback=False)
|
||||
self.environment().snapshot('compact_woloopback', force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot('compact_woloopback', force=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -2,6 +2,8 @@ import unittest
|
||||
from fuel_test.cobbler.cobbler_test_case import CobblerTestCase
|
||||
from fuel_test.helpers import is_not_essex
|
||||
from fuel_test.manifest import Manifest, Template
|
||||
from fuel_test.settings import CREATE_SNAPSHOTS
|
||||
|
||||
|
||||
class FullTestCase(CobblerTestCase):
|
||||
def test_full(self):
|
||||
@ -25,9 +27,8 @@ class FullTestCase(CobblerTestCase):
|
||||
self.validate(self.nodes().proxies, 'puppet agent --test')
|
||||
Manifest().write_nagios_manifest(remote=self.remote())
|
||||
self.validate(self.nodes().controllers[:1], 'puppet agent --test')
|
||||
|
||||
def snapshot(self):
|
||||
self.environment().snapshot('full', force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot('full', force=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -2,6 +2,8 @@ import unittest
|
||||
from fuel_test.cobbler.cobbler_test_case import CobblerTestCase
|
||||
from fuel_test.helpers import is_not_essex
|
||||
from fuel_test.manifest import Manifest, Template
|
||||
from fuel_test.settings import CREATE_SNAPSHOTS
|
||||
|
||||
|
||||
class MinimalTestCase(CobblerTestCase):
|
||||
def test_minimal(self):
|
||||
@ -18,7 +20,8 @@ class MinimalTestCase(CobblerTestCase):
|
||||
if is_not_essex():
|
||||
self.validate(self.nodes().quantums, 'puppet agent --test')
|
||||
self.validate(self.nodes().computes, 'puppet agent --test')
|
||||
self.environment().snapshot('minimal', force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot('minimal', force=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1,7 +1,8 @@
|
||||
import unittest
|
||||
from fuel_test.cobbler.cobbler_test_case import CobblerTestCase
|
||||
from fuel_test.manifest import Manifest
|
||||
from fuel_test.settings import OPENSTACK_SNAPSHOT
|
||||
from fuel_test.settings import OPENSTACK_SNAPSHOT, CREATE_SNAPSHOTS
|
||||
|
||||
|
||||
class SimpleTestCase(CobblerTestCase):
|
||||
def test_simple(self):
|
||||
@ -12,7 +13,8 @@ class SimpleTestCase(CobblerTestCase):
|
||||
self.validate(
|
||||
self.nodes().controllers + self.nodes().computes,
|
||||
'puppet agent --test')
|
||||
self.environment().snapshot(OPENSTACK_SNAPSHOT, force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot(OPENSTACK_SNAPSHOT, force=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1,7 +1,8 @@
|
||||
import unittest
|
||||
from fuel_test.cobbler.cobbler_test_case import CobblerTestCase
|
||||
from fuel_test.manifest import Manifest
|
||||
from fuel_test.settings import OPENSTACK_SNAPSHOT
|
||||
from fuel_test.settings import OPENSTACK_SNAPSHOT, CREATE_SNAPSHOTS
|
||||
|
||||
|
||||
class SingleTestCase(CobblerTestCase):
|
||||
def test_single(self):
|
||||
@ -13,7 +14,8 @@ class SingleTestCase(CobblerTestCase):
|
||||
self.validate(
|
||||
self.nodes().controllers,
|
||||
'puppet agent --test')
|
||||
self.environment().snapshot(OPENSTACK_SNAPSHOT, force=True)
|
||||
if CREATE_SNAPSHOTS:
|
||||
self.environment().snapshot(OPENSTACK_SNAPSHOT, force=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -6,7 +6,7 @@ from devops.helpers.helpers import wait
|
||||
import os
|
||||
import re
|
||||
from fuel_test.cobbler.cobbler_client import CobblerClient
|
||||
from fuel_test.settings import OS_FAMILY, PUPPET_CLIENT_PACKAGE, PUPPET_VERSION, PUPPET_MASTER_SERVICE
|
||||
from fuel_test.settings import OS_FAMILY, PUPPET_CLIENT_PACKAGE, PUPPET_VERSION, PUPPET_MASTER_SERVICE, EXIST_TAR
|
||||
from root import root
|
||||
|
||||
def get_file_as_string(path):
|
||||
@ -183,9 +183,12 @@ def upload_recipes(remote, remote_dir="/etc/puppet/modules/"):
|
||||
recipes_dir = root('deployment', 'puppet')
|
||||
tar_file = None
|
||||
try:
|
||||
tar_file = remote.open('/tmp/recipes.tar', 'wb')
|
||||
with tarfile.open(fileobj=tar_file, mode='w') as tar:
|
||||
tar.add(recipes_dir, arcname='')
|
||||
if EXIST_TAR:
|
||||
remote.upload(EXIST_TAR, '/tmp/recipes.tar')
|
||||
else:
|
||||
tar_file = remote.open('/tmp/recipes.tar', 'wb')
|
||||
with tarfile.open(fileobj=tar_file, mode='w') as tar:
|
||||
tar.add(recipes_dir, arcname='')
|
||||
remote.mkdir(remote_dir)
|
||||
remote.check_call('tar -xf /tmp/recipes.tar -C %s' % remote_dir)
|
||||
finally:
|
||||
|
@ -98,3 +98,5 @@ POOLS = {
|
||||
}
|
||||
|
||||
TEST_REPO = os.environ.get('TEST_REPO', 'false') == 'true'
|
||||
EXIST_TAR = os.environ.get('EXIST_TAR', None)
|
||||
CREATE_SNAPSHOTS = os.environ.get('CREATE_SNAPSHOTS', 'true') == 'true'
|
||||
|
Loading…
Reference in New Issue
Block a user