Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2017.7.2] Mac test_auth tests failing #504

Closed
Ch3LL opened this issue Sep 5, 2017 · 3 comments
Closed

[2017.7.2] Mac test_auth tests failing #504

Ch3LL opened this issue Sep 5, 2017 · 3 comments

Comments

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 5, 2017

The following tests are failing on macosx on 2017.7.2

integration.shell.test_auth.AuthTest.test_pam_auth_valid_group
integration.shell.test_auth.AuthTest.test_pam_auth_valid_user

I did a git bisect and it showed this commit: 462d65308236e0fd81d5dc938d432031dc904966

Which is this PR saltstack/salt#42885

I'm guessing this is related to this change in the teardown. Maybe the user is not getting deleted on mac. Going to track this down first thing tomorrow morning.

@Ch3LL Ch3LL self-assigned this Sep 5, 2017
@Ch3LL
Copy link
Contributor Author

Ch3LL commented Sep 12, 2017

okay i think i'm figuring out what is going on here:

  1. salt-call --local user.add createhome=False saltadm -ldebug (successful)
  2. successful pwd.getpwnam in python interpreter:
>>> pwd.getpwnam('saltadm')
pwd.struct_passwd(pw_name='saltadm', pw_passwd='********', pw_uid=502, pw_gid=20, pw_gecos='', pw_dir='/Users/saltadm', pw_shell='/bin/bash')
  1. salt-call --local user.delete saltadm -ldebug (successful)

But if i go back to the same python interpreter and run getpwname again it still returns the users data:

>>> pwd.getpwnam('saltadm')
pwd.struct_passwd(pw_name='saltadm', pw_passwd='********', pw_uid=502, pw_gid=20, pw_gecos='', pw_dir='/Users/saltadm', pw_shell='/bin/bash')

but if i get out of that python interpeter and go back in then it says that user does not exist:

In [2]: pwd.getpwnam('saltadm')
--------------------------------------------------------------------------- 
KeyError                                  Traceback (most recent call last)
│<ipython-input-2-2ca490ca49c2> in <module>()
----> 1 pwd.getpwnam('saltadm') 

KeyError: 'getpwnam(): name not found: saltadm'

Might be an issue with getpwnam on macosx...looking more into it. So essentially when we check if the user exists with getpwnam its still returning the data that tells the test the user still exists and will not create the user and when we got to the test where it starts running tests agains the user they don't pass because the user does not exist.

@Ch3LL
Copy link
Contributor Author

Ch3LL commented Sep 12, 2017

I think this is only related to macosx and this module, because it reports fine on linux. I even upgraded to 2.7.13 from 2.7.12 on the macosx and still saw the same behavior.

@Ch3LL
Copy link
Contributor Author

Ch3LL commented Sep 18, 2017

ping @terminalmage I was hoping to revert this PR https://github.com/saltstack/salt/pull/42885/files because its causing the issue documented in this issue. It believe there is an issue with python and mac pwd's module where it reports the user still exists even though it was just deleted. I didn't want to revert the PR until I heard from you to make sure there wasn't a separate issue as to why you decided to create this separate teardown other then just its standard practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants