diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-10-21 21:35:40 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-10-21 21:35:40 +0000 |
commit | f3e2c6f2add893710dc9a54098acff13c5934a90 (patch) | |
tree | 7e03f8787f9cc383a2b7b0c51cd30b9b66a61c13 /kpov_judge/tasks/public_ip_ssh | |
parent | be32ceb69271797a38b24d07930ac9afcd0c729f (diff) |
Separated tasks from lectures
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@2 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/public_ip_ssh')
-rw-r--r-- | kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/public_ip_ssh/task.py | 51 |
2 files changed, 53 insertions, 0 deletions
diff --git a/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt b/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt new file mode 100644 index 0000000..23f5dcc --- /dev/null +++ b/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt @@ -0,0 +1,2 @@ +Primer pristopnega kolokvija. Odgovori na vprašanja. Pogoste težave v Virtualbox. +X11, desktopi, nastavitve. diff --git a/kpov_judge/tasks/public_ip_ssh/task.py b/kpov_judge/tasks/public_ip_ssh/task.py new file mode 100644 index 0000000..0468b7d --- /dev/null +++ b/kpov_judge/tasks/public_ip_ssh/task.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# bson.son.SON an +# kpovRandomHelpers should be imported by add_assignment.py +OrderedDict = SON + +instructions = { + 'si':u""" +Ustvari dva navidezna računalnika. Za disk enega (imenujmo ga SimpleArbiter) uporabite +sliko diska Test. Na drugega (imenujmo ga A) namesti poljubno Linux distribucijo. Na SimpleArbiter +preberi uporabniško ime in geslo uporabnika, ki ga moraš ustvariti na A. Poskrbi, da se bo novoustvarjeni +uporabnik s svojim geslom lahko na A prijavil z Interneta. +""" +} + +computers = { + 'SimpleArbiter': { + 'disks':[ + { 'name': 'Test' }] + } +} + +params_meta = { + 'peer_ip': {'opis': 'Naslov ssh strežnika', 'w': True, 'public':True, 'type': 'IP', 'generated': False}, + 'peer_user': {'opis': 'ime uporabnika', 'w': False, 'public': True, 'type': 'username', 'generated': True}, + 'peer_passwd': {'opis': 'geslo uporabnika', 'w': False, 'public': True, 'type': 'password', 'generated': True}, +} + +def task(peer_ip, peer_user, peer_passwd): + return dict() + +def gen_params(user_id, params_meta): + return kpovRandomHelpers.default_gen(user_id, params_meta) + +def task_check(results, params): + import pxssh + import pexpect + results = dict() + s = pxssh.pxssh() + peer_ip, peer_user, peer_passwd = params['peer_ip'], params['peer_user'], params['peer_passwd'] + try: + s.login(peer_ip, peer_user, peer_passwd) + s.logout() + except: + return 0 + return 10 + +def prepare_disks(templates, params): + pass + # print d1.ls('/') |