summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"])