Skip to content

Commit

Permalink
add pam plugin in cleartext mode to test mysql_cleartext_password plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Sep 12, 2015
1 parent 5d3904b commit 3d8dfc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ install:
sudo apt-get install ${EXTRAPKG};
fi
- if [ -n "${PAMCLEAR}" ]; then
echo -e '[mysqld]\n\nplugin-load=auth_pam.so\npam-use-cleartext-plugin' | sudo tee -a /etc/mysql/pam-cleartext.cnf;
echo -e '[mysqld]\n\npam-use-cleartext-plugin' | sudo tee -a /etc/mysql/conf.d/pam-cleartext.cnf;
mysql -u root -e "install plugin pam soname 'auth_pam.so'";
sudo service mysql restart;
export PASSWORD=travis;
export PAMSERVICE=chfn;
fi
- export PASSWORD=travis;
- export PAMSERVICE=chfn;
- pip install -U tox coveralls

before_script:
Expand All @@ -81,7 +82,7 @@ before_script:
- mysql -e 'create database test_pymysql2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'
- mysql -u root -e "create user travis_pymysql2 identified by 'some password'; grant all on test_pymysql2.* to travis_pymysql2;"
- mysql -u root -e "create user travis_pymysql2@localhost identified by 'some password'; grant all on test_pymysql2.* to travis_pymysql2@localhost;"
- mysql -e 'select VERSION();'
- mysql -e 'select VERSION()'
- rm -f ~/.my.cnf # set in .travis.initialize.db.sh for the above commands - we should be using database.json however
- export COVERALLS_PARALLEL=true

Expand Down
1 change: 0 additions & 1 deletion pymysql/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ def realTestPamAuth(self):
c = pymysql.connect(user=TestAuthentication.osuser, **db)
except pymysql.OperationalError as e:
self.assertEqual(1045, e.args[0])
return
# else we had 'bad guess at password' work with pam. Well cool
with self.assertRaises(pymysql.err.OperationalError):
pymysql.connect(user=TestAuthentication.osuser + '@localhost', plugin_map={b'mysql_cleartext_password': TestAuthentication.DefectiveHandler}, **self.db)
Expand Down

0 comments on commit 3d8dfc1

Please sign in to comment.