Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Unable to use with_system_user with integration.ShellCase #20

@pass-by-value

Description

@pass-by-value

The following error is thrown if I use the with_system_user decorator with instances inheriting from integration.ShellCase

ERROR: test_pam_auth_valid_user (integration.shell.auth.AuthTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/src/salttesting/salttesting/helpers.py", line 48, in wrap
    return caller(cls)
  File "/home/ubuntu/src/salttesting/salttesting/helpers.py", line 542, in wrap
    create_user = cls.run_function('user.add', [username])
AttributeError: 'AuthTest' object has no attribute 'run_function'

AuthTest looks like

class AuthTest(integration.ShellCase):

    _call_binary_ = 'salt'
    is_root = os.geteuid() != 0
    @destructiveTest
    @skipIf(is_root, 'You must be logged in as root to run this test')
    @with_system_user('saltdev')
    def test_pam_auth_valid_user(self, username):
        '''
        test pam auth mechanism is working with a valid user
        '''
        alphabet =\
            "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        self.password = ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions