diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-07 20:21:31 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-07 20:21:31 +0200 |
commit | 80f050080ce11c6a0cce67c9b0281c09702b00d6 (patch) | |
tree | b486e1f6342bc757dda87df4856084f652895791 /kpov_judge/tasks/vlc_stream_rtp | |
parent | 43d7ef057b4ae752a60b947e523b3a56782bf5cd (diff) | |
parent | dbf585c2a59dbcb7f6d803d5756826b562cd7f43 (diff) |
Merge branch 'fix-tasks'
Fixes pexpect usage in most tasks. Several other cleanups and minor
refactoring.
Diffstat (limited to 'kpov_judge/tasks/vlc_stream_rtp')
-rw-r--r-- | kpov_judge/tasks/vlc_stream_rtp/task.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/kpov_judge/tasks/vlc_stream_rtp/task.py b/kpov_judge/tasks/vlc_stream_rtp/task.py index 5c8011b..bfdfb4f 100644 --- a/kpov_judge/tasks/vlc_stream_rtp/task.py +++ b/kpov_judge/tasks/vlc_stream_rtp/task.py @@ -1,7 +1,5 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +# kpov_util should be imported by add_assignment.py -# kpov_random_helpers should be imported by add_assignment.py # Postavi nek film na Internet tako, da ga bodo lahko ostali videli. # TODO: finish this @@ -37,12 +35,7 @@ computers = { 'SimpleArbiter': { 'disks': [ { 'name': 'simpleArbiter', - # attempt automount }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, ], 'network_interfaces': [{'network': 'test-net'}], 'flavor': 'm1.tiny', @@ -51,12 +44,7 @@ computers = { 'StudentVLC': { 'disks': [ { 'name': 'student-VLC', - # attempt automount }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, ], 'network_interfaces': [{'network': 'test-net'}], 'flavor': 'm1.tiny', @@ -79,17 +67,16 @@ def task(NASLOV, TOK): results['ps'] = pexpect.run('ps xa') results['tcpdump_hex'] = pexpect.run('sudo /usr/sbin/tcpdump -x -c 2 dst host 239.255.255.255 and port 9875'.format(NASLOV)) results['tcpdump'] = pexpect.run('sudo /usr/sbin/tcpdump -c 8 dst host {}'.format(NASLOV)) - # print("HAHA") return results def gen_params(user_id, params_meta): params = dict() r = random.Random(user_id) - net = kpov_random_helpers.IPv4_net_gen(r, min_hosts = 16, + net = kpov_util.IPv4_net_gen(r, min_hosts = 16, local=True, multicast=True) - params['NASLOV'] = kpov_random_helpers.IPv4_addr_gen(r, net, 1)[0] + params['NASLOV'] = kpov_util.IPv4_addr_gen(r, net, 1)[0] params['PORT'] = str(r.randint(5000, 6000)) - params['TOK'] = kpov_random_helpers.hostname_gen(r) + params['TOK'] = kpov_util.hostname_gen(r) return params def task_check(results, params): |