Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: StackStorm/st2-auth-backend-pam
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7469db1ad3fb50fef348bcddc21576e8684d0b38
Choose a base ref
..
head repository: StackStorm/st2-auth-backend-pam
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0415f4eecc74cde7d398712224a14d7a03334934
Choose a head ref
Showing with 4 additions and 7 deletions.
  1. +0 −3 scripts/prepare-integration.sh
  2. +3 −3 tests/integration/test_authenticate.py
  3. +1 −1 tox.ini
3 changes: 0 additions & 3 deletions scripts/prepare-integration.sh
Original file line number Diff line number Diff line change
@@ -16,14 +16,11 @@ create_user() {
echo "############################# Creating test user #######################################"
echo "########################################################################################"
SALT='mkpasswd'
set -x
useradd ${TESTUSER} -p `mkpasswd --method=sha-512 $TESTPASSWD ${SALT}`
set +x
fi
}

# mkpasswd requires whois package
#apt-get update
apt-get install -y whois

create_user
6 changes: 3 additions & 3 deletions tests/integration/test_authenticate.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ def test_non_root_user(self, mock_get_euid):
mock_get_euid.return_value = 100

expected_msg = 'st2auth process needs to run as "root"'
self.assertRaisesRegexp(ValueError, expected_msg,
self.assertRaisesRegex(ValueError, expected_msg,
pam_backend.PAMAuthenticationBackend)

# non root, but check for root is disabled
@@ -37,14 +37,14 @@ def test_non_root_user(self, mock_get_euid):
mock_get_euid.return_value = 0
pam_backend.PAMAuthenticationBackend()

# See scrips/travis/prepare-integration.sh for right username + password.
# See scrips/prepare-integration.sh for right username + password.
@mock.patch('os.geteuid', mock.Mock(return_value=0))
def test_good_password(self):
pam = pam_backend.PAMAuthenticationBackend()
self.assertEqual(pam.authenticate('pammer', 'spammer'), True,
'Valid credentials should return True.')

# See scrips/travis/prepare-integration.sh for right username + password.
# See scrips/prepare-integration.sh for right username + password.
@mock.patch('os.geteuid', mock.Mock(return_value=0))
def test_bad_password(self):
pam = pam_backend.PAMAuthenticationBackend()
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ envlist = py38,py39,py310,py311,lint

[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = pytest
commands = pytest -slv

[testenv:py38]
basepython = python3.8