summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks
diff options
context:
space:
mode:
authorma0178@student.uni-lj.si <ma0178@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-13 10:45:57 +0000
committerma0178@student.uni-lj.si <ma0178@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-13 10:45:57 +0000
commit56075367e9df6198121f2b7ed1737d00e7f9c837 (patch)
treeb291aaef27c52ae61b0d91b3f517b4f773a8773f /kpov_judge/tasks
parent702d7e77a4fbde39bbb93186f8a6400fc6b689af (diff)
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@174 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r--kpov_judge/tasks/radius_mysql_pam/task.py9
1 files changed, 8 insertions, 1 deletions
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