summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-30 15:41:56 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-30 15:41:56 +0000
commitc0a84e259ef720e7ca6cd93730611b195ebb7553 (patch)
tree09acdce0c9f09567826c07ec855eeb55aca5ea07 /kpov_judge/tasks
parent26bbab6fc75f82f3e505eeaa9d08ad1c543f102b (diff)
Started fixing task no. 4
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@254 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/task.py37
1 files changed, 20 insertions, 17 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
index a321bc2..28b76c9 100644
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
+++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
@@ -73,10 +73,12 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_malishell': {'descriptions': {'si': 'Naslov malishell'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'file_creator_random_seed': {'descriptions': {'si': 'random file creator seed'}, 'w': False, 'public':False, 'type': None, 'generated': True},
}
def task():
+ import pxssh
# TODO: (polz) this has to be changed! Get a move on!
#
# sv: Z primozem lavricem sva skusala nekaj narediti
@@ -85,35 +87,36 @@ def task():
# v mojimenik se nahaja mojimenikfile
# mama2 vsebuje "mama"
#Stirje subt-aski dodani.By Mihec.
-
- import subprocess
- results = dict()
- p = subprocess.check_output(["ls","-a", "/home/student/Desktop/Mapa"])
- results['preimenuj'] = p
-
+ results = dict()
+ conn = pxssh.pxssh()
+ conn.login(IP_malishell, 'student', 'vaje')
+ conn.sendline('ls -a /home/student/Desktop')
+ conn.prompt()
+ results['preimenuj'] = conn.before()
+ conn.logout()
# ta more met mojimenikfile
- results['novi'] = subprocess.check_output(["ls", "/home/student/Desktop/Mapa/novi"])
+ # results['novi'] = subprocess.check_output(["ls", "/home/student/Desktop/Mapa/novi"])
# ta more bit prazen
- results['mojimenik'] = subprocess.check_output(["ls", "/home/student/Desktop/Mapa/mojimenik"])
+ #results['mojimenik'] = subprocess.check_output(["ls", "/home/student/Desktop/Mapa/mojimenik"])
# ta more met mama2
- results['mamatxt'] = subprocess.check_output(["cat", "/home/student/Desktop/mama.txt"])
+ #results['mamatxt'] = subprocess.check_output(["cat", "/home/student/Desktop/mama.txt"])
# ta pa grep: mojimenik: Is a directory, grep: novi: Is a directory
- results['napaketxt'] = subprocess.check_output(["cat", "/home/student/Desktop/napake.txt"])
+ #results['napaketxt'] = subprocess.check_output(["cat", "/home/student/Desktop/napake.txt"])
- results['curl'] = subprocess.check_output(["cat","/home/student/Desktop/website.txt"])
+ #results['curl'] = subprocess.check_output(["cat","/home/student/Desktop/website.txt"])
- results['chkimages'] = subprocess.check_output(["curl www.24ur.com >> dlg.txt && cat dlg.txt | grep -c ","images"])
+ #results['chkimages'] = subprocess.check_output(["curl www.24ur.com >> dlg.txt && cat dlg.txt | grep -c ","images"])
- results['count'] = subprocess.check_output(["wc","/home/student/Desktop/count.txt"])
+ #results['count'] = subprocess.check_output(["wc","/home/student/Desktop/count.txt"])
- results['lines'] = subprocess.check_output(["cat","/home/student/Desktop/lines.txt"])
+ #results['lines'] = subprocess.check_output(["cat","/home/student/Desktop/lines.txt"])
- results['cowsay'] = subprocess.check_output(["dpkg --get-selections | grep","cowsay"])
+ #results['cowsay'] = subprocess.check_output(["dpkg --get-selections | grep","cowsay"])
- results['phttp'] = subprocess.check_output(["lsof -i ",":8080"])
+ #results['phttp'] = subprocess.check_output(["lsof -i ",":8080"])