diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-06 23:56:03 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-07 01:55:26 +0200 |
commit | 9c51bbe5016495c714789f5df01806a6d366e11a (patch) | |
tree | 19be73e896838cfbe3e87b04bd63c9fdd930c27e /kpov_judge/tasks/smb_nfs | |
parent | e33085889f26c76587fdab2ad600ed336dc028b5 (diff) |
Rename kpov_random_helpers to kpov_util
Diffstat (limited to 'kpov_judge/tasks/smb_nfs')
-rw-r--r-- | kpov_judge/tasks/smb_nfs/task.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kpov_judge/tasks/smb_nfs/task.py b/kpov_judge/tasks/smb_nfs/task.py index 5ea7695..b0a3c02 100644 --- a/kpov_judge/tasks/smb_nfs/task.py +++ b/kpov_judge/tasks/smb_nfs/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpov_random_helpers should be imported by add_assignment.py +# kpov_util should be imported by add_assignment.py # TODO: dokoncaj! instructions = { 'si':""" @@ -84,8 +84,8 @@ def task(FILESERVER_IP, FILESERVER_NAME, NFS_MOUNT, SMB_SHARENAME, SHARED_FILE_S results['ls_smbmount'] = pexpect.run('ls /mnt/smb') results['ls_nfs'] = pexpect.run('ls /mnt/nfs') r = random.Random(SHARED_FILE_SEED) - testfile = kpov_random_helpers.fname_gen(r) - teststring = kpov_random_helpers.alnum_gen(r, 200) + testfile = kpov_util.fname_gen(r) + teststring = kpov_util.alnum_gen(r, 200) with open('/mnt/nfs/{}'.format(testfile),'w') as f: f.write(teststring) results['filestr'] = pexpect.run( @@ -99,22 +99,22 @@ def task(FILESERVER_IP, FILESERVER_NAME, NFS_MOUNT, SMB_SHARENAME, SHARED_FILE_S return results def gen_params(user_id, params_meta): - d = kpov_random_helpers.default_gen(user_id, params_meta) + d = kpov_util.default_gen(user_id, params_meta) r = random.Random(user_id) - d['FILESERVER_NAME'] = kpov_random_helpers.hostname_gen(r) - d['SMB_SHARENAME'] = kpov_random_helpers.hostname_gen(r) - d['NFS_MOUNT'] = "/srv/nfs/" + kpov_random_helpers.fname_gen(r, False) - d['SHARED_FILENAME'] = kpov_random_helpers.fname_gen(r) - d['SHARED_CONTENT'] = kpov_random_helpers.fortune(r, 4096) - d['SHARED_FILE_SEED'] = kpov_random_helpers.alnum_gen(r, 42) + d['FILESERVER_NAME'] = kpov_util.hostname_gen(r) + d['SMB_SHARENAME'] = kpov_util.hostname_gen(r) + d['NFS_MOUNT'] = "/srv/nfs/" + kpov_util.fname_gen(r, False) + d['SHARED_FILENAME'] = kpov_util.fname_gen(r) + d['SHARED_CONTENT'] = kpov_util.fortune(r, 4096) + d['SHARED_FILE_SEED'] = kpov_util.alnum_gen(r, 42) return d def task_check(results, params): score = 0 hints = [] r = random.Random(params['SHARED_FILE_SEED']) - testfile = kpov_random_helpers.fname_gen(r) - teststring = kpov_random_helpers.alnum_gen(r, 200) + testfile = kpov_util.fname_gen(r) + teststring = kpov_util.alnum_gen(r, 200) # no need to check results['mount'] or results['try_mount_nfs'] # or results['try_mount_smb'] if results['mount_after'].find('//{}/{} on /mnt/smb type cifs'.format( |