When I tried to 'make test' many of the existing tests fail because the positional arguments are setting the uid argument.
ERROR: tests.core.test_host.HelpersTest.test_doesnt_add_user_if_it_already_exists
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
File "/tmp/add_uid_gid/.venv/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/tmp/add_uid_gid/tests/core/test_host.py", line 560, in test_doesnt_add_user_if_it_already_exists
result = host.adduser(username, password)
File "/tmp/add_uid_gid/charmhelpers/core/host.py", line 198, in adduser
user_info = pwd.getpwuid(uid)
TypeError: an integer is required
When I tried to 'make test' many of the existing tests fail because the positional arguments are setting the uid argument.
ERROR: tests.core. test_host. HelpersTest. test_doesnt_ add_user_ if_it_already_ exists ------- ------- ------- ------- ------- ------- ------- ------- ------- uid_gid/ .venv/local/ lib/python2. 7/site- packages/ mock.py" , line 1201, in patched uid_gid/ tests/core/ test_host. py", line 560, in test_doesnt_ add_user_ if_it_already_ exists username, password) uid_gid/ charmhelpers/ core/host. py", line 198, in adduser
-------
_StringException: Traceback (most recent call last):
File "/tmp/add_
return func(*args, **keywargs)
File "/tmp/add_
result = host.adduser(
File "/tmp/add_
user_info = pwd.getpwuid(uid)
TypeError: an integer is required
FAIL: tests.core. test_host. HelpersTest. test_adds_ a_user_ if_it_doesnt_ exist ['useradd' , '--create-home', '--shell', '/bin/bash', '--password', 'eodnho ['useradd' , '--uid eodnhoj', '--system', '-g', 'johndoe', 'johndoe'])
AssertionError: Expected call: check_call(
j', '-g', 'johndoe', 'johndoe'])
Actual call: check_call(
FAIL: tests.core. test_host. HelpersTest. test_adds_ a_user_ with_different_ shell ['useradd' , '--create-home', '--shell', '/bin/zsh', '--password', 'eodnhoj ['useradd' , '--uid eodnhoj', '--system', 'johndoe'])
AssertionError: Expected call: check_call(
', 'johndoe'])
Actual call: check_call(
FAIL: tests.core. test_host. HelpersTest. test_adduser_ with_groups ['useradd' , '--create-home', '--shell', '/bin/bash', '--password', 'eodnho ['useradd' , '--uid eodnhoj', '--system', '-g', 'foo', '-G', 'bar,qux', 'johndoe'])
AssertionError: Expected call: check_call(
j', '-g', 'foo', '-G', 'bar,qux', 'johndoe'])
Actual call: check_call(
The tests need to pass before this change can be accepted.