diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-24 21:05:27 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-24 21:05:27 +0100 |
commit | 8081a5520a441b43a8a7a73f3a90c7aacfaa8e10 (patch) | |
tree | c7f49bd33ed19d53afc0ee9df8b2c82c200c5910 /kpov_judge/tasks/public_ip_ssh | |
parent | 9963b74f777edf985540eac71b1ca095f88b8bca (diff) |
Move everything one level up
Diffstat (limited to 'kpov_judge/tasks/public_ip_ssh')
-rw-r--r-- | kpov_judge/tasks/public_ip_ssh/task.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/kpov_judge/tasks/public_ip_ssh/task.py b/kpov_judge/tasks/public_ip_ssh/task.py deleted file mode 100644 index 8dcb858..0000000 --- a/kpov_judge/tasks/public_ip_ssh/task.py +++ /dev/null @@ -1,52 +0,0 @@ -# kpov_util should be imported by add_assignment.py - -instructions = { - 'si':""" -<pre>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.</pre> -""" -} - -computers = { - 'SimpleArbiter': { - 'disks':[ - { 'name': 'simpleArbiter' }], - 'network_interfaces':[{'network':'net1'}], - }, - 'A': { - 'disks':[], - 'network_interfaces':[{'network':'net2'}], - } - -} - -networks = { 'net1': {'public': True}, 'net2': {'public': True} } - -params_meta = { - 'peer_ip': {'descriptions': {'si': 'Naslov ssh strežnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False}, - 'peer_user': {'descriptions': {'si': 'ime uporabnika'}, 'w': False, 'public': True, 'type': 'username', 'generated': True}, - 'peer_passwd': {'descriptions': {'si': '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 kpov_util.default_gen(user_id, params_meta) - -def task_check(results, params): - from pexpect import pxssh - ip, user, passwd = params['peer_ip'], params['peer_user'], params['peer_passwd'] - results = {} - try: - s = pxssh.pxssh(encoding='utf-8') - s.login(ip, user, passwd) - s.logout() - return 10, [] - except Exception as ex: - return 0, [str(ex)] - -def prepare_disks(templates, task_params, global_params): - write_default_config(templates['simpleArbiter'], global_params) |