Merge pull request #42062 from terminalmage/arch-grains-test

Add debug logging for grains tests
This commit is contained in:
Mike Place 2017-06-30 16:58:15 -05:00 committed by GitHub
commit 5b2ae2dd04

View File

@ -5,6 +5,7 @@ Test the grains module
# Import python libs
from __future__ import absolute_import
import logging
import os
import time
@ -13,6 +14,8 @@ from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tests.support.helpers import destructiveTest
log = logging.getLogger(__name__)
class TestModulesGrains(ModuleCase):
'''
@ -109,11 +112,12 @@ class TestModulesGrains(ModuleCase):
'''
test to ensure some core grains are returned
'''
grains = ['os', 'os_family', 'osmajorrelease', 'osrelease', 'osfullname', 'id']
grains = ('os', 'os_family', 'osmajorrelease', 'osrelease', 'osfullname', 'id')
os = self.run_function('grains.get', ['os'])
for grain in grains:
get_grain = self.run_function('grains.get', [grain])
log.debug('Value of \'%s\' grain: \'%s\'', grain, get_grain)
if os == 'Arch' and grain in ['osmajorrelease']:
self.assertEqual(get_grain, '')
continue