mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Add test case for numeric GECOS data
This commit is contained in:
parent
c8e5381aae
commit
e618befaf8
@ -127,6 +127,25 @@ class UserTest(integration.ModuleCase,
|
||||
ret = self.run_state('group.absent', name='salt_test')
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
||||
@destructiveTest
|
||||
@skipIf(os.geteuid() != 0, 'you must be root to run this test')
|
||||
def test_user_present_gecos(self):
|
||||
'''
|
||||
This is a DESTRUCTIVE TEST it creates a new user on the on the minion.
|
||||
|
||||
It ensures that numeric GECOS data will be properly coerced to strings,
|
||||
otherwise the state will fail because the GECOS fields are written as
|
||||
strings (and show up in the user.info output as such). Thus the
|
||||
comparison will fail, since '12345' != 12345.
|
||||
'''
|
||||
ret = self.run_state(
|
||||
'user.present', name='salt_test', fullname=12345, roomnumber=123,
|
||||
workphone=1234567890, homephone=1234567890
|
||||
)
|
||||
self.assertSaltTrueReturn(ret)
|
||||
ret = self.run_state('user.absent', name='salt_test')
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
Loading…
Reference in New Issue
Block a user