mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
move destroy to tearDown
This commit is contained in:
parent
e6432ee049
commit
c35e413ec2
2 changed files with 21 additions and 19 deletions
|
@ -59,12 +59,12 @@ platforms:
|
|||
driver_config:
|
||||
run_command: /lib/systemd/systemd
|
||||
provision_command:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev gcc git
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev gcc git locales console-data
|
||||
- name: debian
|
||||
driver_config:
|
||||
run_command: /lib/systemd/systemd
|
||||
provision_command:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev gcc git
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev gcc git locales console-data
|
||||
<% end %>
|
||||
|
||||
<% if File.exists?('suites.yml') %>
|
||||
|
|
|
@ -25,27 +25,38 @@ class KitchenTestCase(TestCase):
|
|||
cls.use_vt = int(os.environ.get('TESTS_LOG_LEVEL')) >= 3
|
||||
cmd.run('python setup.py sdist', cwd=cls.topdir)
|
||||
cmd.run('bundle install', cwd=CURRENT_DIR)
|
||||
cls.env = {
|
||||
'KITCHEN_YAML': os.path.join(CURRENT_DIR, '.kitchen.yml'),
|
||||
'SALT_SDIST_PATH': os.path.join(cls.topdir, 'dist', 'salt-{0}.tar.gz'.format(setup.__version__)),
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
del cls.topdir
|
||||
del cls.env
|
||||
|
||||
def tearDown(self):
|
||||
cmd.run(
|
||||
'bundle exec kitchen destroy all',
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', self.testdir),
|
||||
env=self.env,
|
||||
use_vt=self.use_vt,
|
||||
)
|
||||
del self.testdir
|
||||
|
||||
|
||||
def func_builder(testdir):
|
||||
def func(self):
|
||||
env = {
|
||||
'KITCHEN_YAML': os.path.join(CURRENT_DIR, '.kitchen.yml'),
|
||||
'SALT_SDIST_PATH': os.path.join(self.topdir, 'dist', 'salt-{0}.tar.gz'.format(setup.__version__)),
|
||||
}
|
||||
self.testdir = testdir
|
||||
if 'TESTS_XML_OUTPUT_DIR' in os.environ:
|
||||
env['TEST_JUNIT_XML_PREFIX'] = '--junit-xml {0}/kitchen.tests.{1}.%s.%s.xml'.format(
|
||||
os.environ.get('TESTS_XML_OUTPUT_DIR'),
|
||||
testdir,
|
||||
self.testdir,
|
||||
)
|
||||
self.assertEqual(
|
||||
cmd.retcode(
|
||||
'bundle exec kitchen create -c 4 all',
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', testdir),
|
||||
'bundle exec kitchen converge -c 999 all',
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', self.testdir),
|
||||
env=env,
|
||||
use_vt=self.use_vt,
|
||||
),
|
||||
|
@ -54,16 +65,7 @@ def func_builder(testdir):
|
|||
self.assertEqual(
|
||||
cmd.retcode(
|
||||
'bundle exec kitchen verify all',
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', testdir),
|
||||
env=env,
|
||||
use_vt=self.use_vt,
|
||||
),
|
||||
0
|
||||
)
|
||||
self.assertEqual(
|
||||
cmd.retcode(
|
||||
'bundle exec kitchen destroy all',
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', testdir),
|
||||
cwd=os.path.join(CURRENT_DIR, 'tests', self.testdir),
|
||||
env=env,
|
||||
use_vt=self.use_vt,
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue