Skip to content

Commit

Permalink
Add a test for creating a user with an existing GID.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashea committed Sep 30, 2015
1 parent 0b4e3f9 commit e6a7223
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/pyanaconda_tests/user_create_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ def create_user_uid_exists_test(self):

self.assertRaises(ValueError, self.users.createUser, "test_user", uid=1000, root=self.tmpdir)

def create_user_gid_exists_test(self):
"""Create a user with a GID of an existing group."""
self.users.createGroup("test_group", gid=5000, root=self.tmpdir)
self.users.createUser("test_user", gid=5000, root=self.tmpdir)

passwd_fields = self._readFields("/etc/passwd", "test_user")
self.assertIsNotNone(passwd_fields)
self.assertEqual(passwd_fields[3], "5000")

def set_user_ssh_key_test(self):
keydata = "THIS IS TOTALLY A SSH KEY"

Expand Down

0 comments on commit e6a7223

Please sign in to comment.