From 118f63e4601329c9f4a1068d95018d6bf3f610c2 Mon Sep 17 00:00:00 2001 From: kudkudak Date: Wed, 14 May 2014 18:41:36 +0200 Subject: [PATCH] Added missing paths and fixed bug in don corleone --- don_corleone/don_corleone.py | 2 +- scripts/ocean_init_graph.py | 2 +- scripts/ocean_small_exemplary_data.py | 9 +++++++-- tests/spidercrab_1000_test.py | 12 ++++++++++-- tests/spidercrab_correctness_test.py | 5 +++-- tests/spidercrab_integrity_test.py | 5 +++-- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/don_corleone/don_corleone.py b/don_corleone/don_corleone.py index d9bdeea..b1116ea 100755 --- a/don_corleone/don_corleone.py +++ b/don_corleone/don_corleone.py @@ -307,7 +307,7 @@ def _terminate_service(service_id): cmd = "(cd {0} && {1})".format( os.path.join(m[SERVICE_HOME],"don_corleone"), - "./scripts/{0}_terminate.sh".format(m[SERVICE])) + "./scripts/run.sh terminating_job ./scripts/{0}_terminate.sh".format(m[SERVICE])) status, output = cautious_run_cmd_over_ssh(cmd, m[NODE_ID],m) diff --git a/scripts/ocean_init_graph.py b/scripts/ocean_init_graph.py index 08948a5..73ccbc7 100755 --- a/scripts/ocean_init_graph.py +++ b/scripts/ocean_init_graph.py @@ -139,4 +139,4 @@ ) print 'Graph populated successfully.' - print 'NOTE: Remember to restart Lionfish ODM server.' \ No newline at end of file + print 'NOTE: Remember to restart Lionfish ODM server.' diff --git a/scripts/ocean_small_exemplary_data.py b/scripts/ocean_small_exemplary_data.py index 28c11d7..12ccbb9 100755 --- a/scripts/ocean_small_exemplary_data.py +++ b/scripts/ocean_small_exemplary_data.py @@ -26,8 +26,13 @@ if __name__ == '__main__': - # Create connection - graph_db = neo4j.GraphDatabaseService('http://ocean-lionfish.no-ip.biz:16/db/data/') + # Create connection + neo4j_port = None + neo4j_host = None + graph_db = neo4j.GraphDatabaseService( + 'http://{0}:{1}/db/data/'.format(neo4j_host if neo4j_host else + get_configuration("neo4j","host"), neo4j_port if neo4j_port else get_configuration("neo4j", "port")) + ) # graph_db = neo4j.GraphDatabaseService('http://localhost:7474/db/data/') print 'Running', __file__ diff --git a/tests/spidercrab_1000_test.py b/tests/spidercrab_1000_test.py index 29f60a8..156a26d 100755 --- a/tests/spidercrab_1000_test.py +++ b/tests/spidercrab_1000_test.py @@ -10,7 +10,8 @@ import os import threading import time - +import sys +sys.path.append(os.path.abspath("..")) from don_corleone import don_utils as du def run_master(): @@ -32,10 +33,17 @@ def run_slave(): if __name__ == '__main__': + #TODO: use os.path.join not + - it is bug prone OCEAN_ROOT = du.get_ocean_root_dir() DATA_FILE = OCEAN_ROOT + '/data/contentsource_nodes_1000' + if not os.path.exists(DATA_FILE): + #TODO: add logger + print "Please download contentsource_nodes_1000 for Ocean Don Corleone" + print "You can use this command: scp root@ocean-don.no-ip.biz:/webapps/ocean/data/contentsource_nodes_1000 . " + + TEMP_SPIDERCRAB_CONFIG = OCEAN_ROOT + '/data/spidercrab_1000_test_config' TEMP_SPIDERCRAB_STATS_EXPORT = \ OCEAN_ROOT + '/data/spidercrab_1000_test_stats' @@ -142,4 +150,4 @@ def run_slave(): if not os.path.isfile(temp_file): print '... no such a file or file.' else: - os.remove(temp_file) \ No newline at end of file + os.remove(temp_file) diff --git a/tests/spidercrab_correctness_test.py b/tests/spidercrab_correctness_test.py index a0be784..26e6c65 100755 --- a/tests/spidercrab_correctness_test.py +++ b/tests/spidercrab_correctness_test.py @@ -9,7 +9,8 @@ import os import time - +import sys +sys.path.append(os.path.abspath("..")) from don_corleone import don_utils as du if __name__ == '__main__': @@ -114,4 +115,4 @@ # Security stuff for temp_file in files: print 'Removing', temp_file - os.remove(temp_file) \ No newline at end of file + os.remove(temp_file) diff --git a/tests/spidercrab_integrity_test.py b/tests/spidercrab_integrity_test.py index c250483..4d951eb 100755 --- a/tests/spidercrab_integrity_test.py +++ b/tests/spidercrab_integrity_test.py @@ -5,7 +5,8 @@ Testing of availability and communication of dependent system elements NOTE: Does not harm graph database. """ - +import sys, os +sys.path.append(os.path.abspath("..")) from graph_workers import odm_client from don_corleone import don_utils as du @@ -69,4 +70,4 @@ def warn_if_not_local(): print '\nChecking communication...' assert(check_lionfish_communication()) - print 'PASSED' \ No newline at end of file + print 'PASSED'