Merge pull request #44364 from Ch3LL/fix_size_test

Include disk size check for test_spm_build_big_file test
This commit is contained in:
Nicole Thomas 2017-11-01 09:57:24 -04:00 committed by GitHub
commit aea9f4a115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,8 +39,14 @@ class SPMBuildTest(SPMCase, ModuleCase):
@skipIf(salt.utils.which('fallocate') is None, 'fallocate not installed')
def test_spm_build_big_file(self):
'''
test spm build
test spm build with a big file
'''
# check to make sure there is enough space to run this test
check_space = self.run_function('status.diskusage', ['/'])
space = check_space['/']['available']
if space < 2000000:
self.skipTest('Not enough space on host to run this test')
big_file = self.run_function('cmd.run',
['fallocate -l 1G {0}'.format(os.path.join(self.formula_sls_dir,
'bigfile.txt'))])
@ -56,7 +62,7 @@ class SPMBuildTest(SPMCase, ModuleCase):
def test_spm_build_exclude(self):
'''
test spm build
test spm build while excluding directory
'''
git_dir = os.path.join(self.formula_sls_dir, '.git')
os.makedirs(git_dir)