mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge branch 'develop' into #8976
* develop: Integration testing for #8976
This commit is contained in:
commit
8c31d96e17
@ -1,11 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
from salttesting.helpers import (ensure_in_syspath, destructiveTest)
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
import integration
|
||||
from salt.modules import disk
|
||||
|
||||
# Import Python libs
|
||||
import os
|
||||
import shutil
|
||||
|
||||
class DiskModuleVirtualizationTest(integration.ModuleCase):
|
||||
'''
|
||||
Test to make sure we return a clean result under Docker. Refs #8976
|
||||
|
||||
This is factored into its own class so that we can have some certainty that setUp() and tearDown() are run.
|
||||
'''
|
||||
@destructiveTest
|
||||
def setUp(self):
|
||||
# Make /etc/mtab unreadable
|
||||
if os.path.isfile('/etc/mtab'):
|
||||
shutil.move('/etc/mtab', '/tmp/mtab')
|
||||
|
||||
@destructiveTest
|
||||
def test_no_mtab(self):
|
||||
ret = self.run_function('disk.usage')
|
||||
self.assertDictEqual(ret, {})
|
||||
|
||||
@destructiveTest
|
||||
def tearDown(self):
|
||||
if os.path.isfile('/tmp/mtab'):
|
||||
shutil.move('/tmp/mtab', '/etc/mtab')
|
||||
|
||||
|
||||
class DiskModuleTest(integration.ModuleCase):
|
||||
|
Loading…
Reference in New Issue
Block a user