From 56075367e9df6198121f2b7ed1737d00e7f9c837 Mon Sep 17 00:00:00 2001 From: "ma0178@student.uni-lj.si" Date: Tue, 13 Jan 2015 10:45:57 +0000 Subject: git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@174 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/radius_mysql_pam/task.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'kpov_judge/tasks/radius_mysql_pam') diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py index 0beb8e7..db8af8d 100644 --- a/kpov_judge/tasks/radius_mysql_pam/task.py +++ b/kpov_judge/tasks/radius_mysql_pam/task.py @@ -65,11 +65,13 @@ params_meta = { 'MYSQL_DB_NAME': {'descriptions': {'si': 'Ime baze v mysql'}, 'w': True, 'public':True, 'type': '', 'generated': False}, 'MYSQL_ADMIN_USER':{'descriptions': {'si': 'Username za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'username', 'generated': False}, 'MYSQL_ADMIN_PASSWORD': {'descriptions': {'si': 'Geslo za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'passwd', 'generated': True}, + 'MYSQL_TEST_USER':{'descriptions': {'si': 'Username za testiranje PA;M'}, 'w': False, 'public':False, 'type': 'username', 'generated': True}, + 'MYSQL_TEST_PASSWORD': {'descriptions': {'si': 'Geslo za testiranje PAM'}, 'w': False, 'public':False, 'type': 'passwd', 'generated': True}, 'MYSQL_PAM_USERNAME': {'descriptions': {'si': 'Username v MySQL'}, 'w': True, 'public': True, 'type': 'IP', 'generated': False}, 'MYSQL_PAM_PASSWORD': {'descriptions': {'si': 'Geslo za uporabnika v MySQL'}, 'w': True, 'public': True, 'type': 'passwd', 'generated': False}, } -def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQL_ADMIN_PASSWORD, MYSQL_PAM_USERNAME, MYSQL_PAM_PASSWORD, MYSQL_DB_NAME): +def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQL_ADMIN_PASSWORD, MYSQL_TEST_USER, MYSQL_TEST_PASSWORD, MYSQL_PAM_USERNAME, MYSQL_PAM_PASSWORD, MYSQL_DB_NAME): import pxssh results = dict() peer_user = 'student' @@ -85,6 +87,11 @@ def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USE # Testiranje podatkovne base mysql results['mysql_login'] = sR.run('mysql -u {MYSQL_ADMIN_USER} -p {MYSQL_ADMIN_PASSWORD}'.format(**locals())) results['database_connect'] = sR.run('USE {MYSQL_DB_NAME}'.format(**locals())) + results['select_from_users'] = sR.run('SELECT username, password FROM users;') + sR.run('INSERT INTO users (username, password) VALUES ({MYSQL_TEST_USER}, {MYSQL_TEST_PASSWORD});') + sR.run('\q'); + # Testiranje PAM s testnim uporabnikom + sT.login(IP_RS, MYSQL_TEST_USER, MYSQL_TEST_PASSWORD) return results -- cgit v1.2.1