diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-04-01 20:32:28 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-04-01 20:32:28 +0000 |
commit | 53fea983a90447865c429c2573bfb36cba179054 (patch) | |
tree | 42a0fa57a43103378144607d16e575e82071f7e1 /kpov_judge/tasks/ldap_search | |
parent | 2fe40ec78ce6ab3a8c2c5659713b7f947a5686fc (diff) |
added hints to task results
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@296 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/ldap_search')
-rw-r--r-- | kpov_judge/tasks/ldap_search/task.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kpov_judge/tasks/ldap_search/task.py b/kpov_judge/tasks/ldap_search/task.py index 5612c01..bbc636f 100644 --- a/kpov_judge/tasks/ldap_search/task.py +++ b/kpov_judge/tasks/ldap_search/task.py @@ -153,6 +153,7 @@ def gen_params(user_id, params_meta): def task_check(results, params): import re score = 0 + hints = [] s = """.*dn: dc={DOMAIN},dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si\r objectClass: top\r objectClass: dcObject\r @@ -163,27 +164,29 @@ objectClass: organization\r if re.match(s, results['ldapsearch_before'], re.DOTALL): score += 2 else: - print (s, results['ldapsearch_before']) + hints += [s + str(results['ldapsearch_before'])] s = ".*uid: {}.*".format(re.escape(params['LDAP_USERNAME'])) if re.search(s, results['ldapsearch_before']): score += 2 else: - print (s, results['ldapsearch_before']) + hints += [s + str(results['ldapsearch_before'])] s = ".*uid: {0}.*description: {1}.*".format( re.escape(params['LDAP_USERNAME']), re.escape(fortune[:40])) if re.match(s, results['ldapsearch_after'], re.DOTALL): score += 2 else: - print (s, results['ldapsearch_after']) + hints += [s + str(results['ldapsearch_after'])] if results['ldapsearch_before'][:100] == results['ldapsearch_after'][:100]: score += 2 + else: + hints += ["ldapsearch wrong"] s = '.*\r\nmodifying entry "uid={LDAP_USERNAME},ou=Users,dc={DOMAIN},dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si".*'.format( **params) if re.match(s, results['modify'], re.DOTALL): score += 2 else: - print (s, results['modify']) - return score + hints += [s + str(results['modify'])] + return score, hints def prepare_disks(templates, params): # d = templates['simpleArbiterDhcp'] |