Commit 7ba6255b authored by Eteri's avatar Eteri

cleanup: remove empty lines, remove unnecessary comments, fix local_ip

parent 52cd7d79
{{local_ip}}:4443 {{local_ip}}:4443
proxy / 0.0.0.0:9443 proxy / {{local_ip}}:9443
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
@type debug_agent @type debug_agent
@id debug_agent_input @id debug_agent_input
bind 127.0.0.1 bind {{local_ip}}
port 24230 port 24230
</source> </source>
......
...@@ -34,7 +34,6 @@ output = $${directory:bin}/runTestSuite ...@@ -34,7 +34,6 @@ output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory} buildout-directory = $${buildout:directory}
mode = 0700 mode = 0700
[runTest-instance] [runTest-instance]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${template-test:output} url = ${template-test:output}
...@@ -42,27 +41,24 @@ output = $${directory:bin}/testIngestion.py ...@@ -42,27 +41,24 @@ output = $${directory:bin}/testIngestion.py
buildout-directory = $${buildout:directory} buildout-directory = $${buildout:directory}
mode = 0700 mode = 0700
################################# #################################
# fluentd service # fluentd service
################################# #################################
[fluentdConfig] [fluentdConfig]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${template-fluentdConfig:location}/${template-fluentdConfig:filename} template = ${template-fluentdConfig:location}/${template-fluentdConfig:filename}
rendered = $${directory:etc}/fluentd-conf.cnf rendered = $${directory:etc}/fluentd-conf.cnf
mode = 0600 mode = 0600
context = context =
key local_ip caddy-configuration:local_ip key local_ip caddy-configuration:local_ip
[fluentd-service] [fluentd-service]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/fluentd-service wrapper-path = $${directory:services}/fluentd-service
path = ${fluentd:location} path = ${fluentd:location}
command-line = ${fluentd:location}/bin/fluentd command-line = ${fluentd:location}/bin/fluentd
-c $${directory:etc}/fluentd-conf.cnf -p ${fluentd-plugin-dev-repository:location}/lib/fluent/plugin/ -c $${directory:etc}/fluentd-conf.cnf -p ${fluentd-plugin-dev-repository:location}/lib/fluent/plugin/
environment = environment =
GEM_PATH= ${fluentd:location}/lib/ruby/gems/1.8/ GEM_PATH= ${fluentd:location}/lib/ruby/gems/1.8/
output = $${:wrapper-path} output = $${:wrapper-path}
...@@ -94,11 +90,7 @@ error_log = $${directory:log}/caddy-error.log ...@@ -94,11 +90,7 @@ error_log = $${directory:log}/caddy-error.log
local_ip = $${slap-network-information:local-ipv4} local_ip = $${slap-network-information:local-ipv4}
context = context =
key local_ip caddy-configuration:local_ip key local_ip caddy-configuration:local_ip
[publish-connection-information] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
secure_access = http://$${caddy-configuration:local_ip}:4443} secure_access = http://$${caddy-configuration:local_ip}:4443}
\ No newline at end of file
...@@ -53,8 +53,6 @@ def main(): ...@@ -53,8 +53,6 @@ def main():
test_line_dict = {} test_line_dict = {}
######!!!!!!!!!!!!!! uncomment this !!!!!!!!
# result.errors, result.failures, stream.read()
num_of_tests, errors, failures, stdout = testIngestion.main() num_of_tests, errors, failures, stdout = testIngestion.main()
result = testIngestion.main() result = testIngestion.main()
......
...@@ -50,7 +50,7 @@ interpreter = pythonwitheggs ...@@ -50,7 +50,7 @@ interpreter = pythonwitheggs
[template-fluentdConfig] [template-fluentdConfig]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/fluentd-conf.cnf.in url = ${:_profile_base_location_}/fluentd-conf.cnf.in
#md5sum = 3132b99d65c75b72fc6dacb702ddca0b md5sum = fd896793455e1d04082449212d285b55
filename = fluentd-conf.cnf.in filename = fluentd-conf.cnf.in
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644 mode = 0644
...@@ -79,14 +79,14 @@ mode = 0644 ...@@ -79,14 +79,14 @@ mode = 0644
[template-caddyfile] [template-caddyfile]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/Caddyfile.in url = ${:_profile_base_location_}/Caddyfile.in
md5sum = 3132b99d65c75b72fc6dacb702ddca0b md5sum = 8644e98038ab76a8e5a499e22f92660a
output = ${buildout:directory}/Caddyfile.in output = ${buildout:directory}/Caddyfile.in
mode = 0644 mode = 0644
[template-caddy-fluentd] [template-caddy-fluentd]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-caddy-fluentd.cfg.in url = ${:_profile_base_location_}/instance-caddy-fluentd.cfg.in
md5sum = 599d4650e9b96ce15fceb512316651ae md5sum = 4e0c6e0464ad1b2f1adadda10771bb86
output = ${buildout:directory}/instance-caddy-fluentd.cfg.in output = ${buildout:directory}/instance-caddy-fluentd.cfg.in
mode = 0644 mode = 0644
......
...@@ -23,8 +23,6 @@ caddy_pidfile = "$${directory:etc}/caddy_pidfile" ...@@ -23,8 +23,6 @@ caddy_pidfile = "$${directory:etc}/caddy_pidfile"
posted_data = None posted_data = None
all_data = [] all_data = []
request_tag = "" request_tag = ""
with open(caddy_pidfile) as f:
caddy_pid = f.readline()
class TestServerHandler(BaseHTTPRequestHandler): class TestServerHandler(BaseHTTPRequestHandler):
...@@ -60,8 +58,6 @@ class TestServerHandler(BaseHTTPRequestHandler): ...@@ -60,8 +58,6 @@ class TestServerHandler(BaseHTTPRequestHandler):
class TestPost(unittest.TestCase): class TestPost(unittest.TestCase):
posted_data = ""
def test_1_get(self): def test_1_get(self):
print("############## TEST 1 ##############") print("############## TEST 1 ##############")
resp = requests.get(url) resp = requests.get(url)
...@@ -90,6 +86,8 @@ class TestPost(unittest.TestCase): ...@@ -90,6 +86,8 @@ class TestPost(unittest.TestCase):
def test_4_delay_15_mins(self): def test_4_delay_15_mins(self):
print("############## TEST 4 ##############") print("############## TEST 4 ##############")
# sleep 15mins to test that connections doesn't break after long delay
# and data is ingested correctly after the delay.
time.sleep(900) time.sleep(900)
start_fluentd_cat("dummyInputDelay", "tag_test_4") start_fluentd_cat("dummyInputDelay", "tag_test_4")
time.sleep(15) time.sleep(15)
...@@ -147,18 +145,13 @@ def start_fluentd_cat(test_msg, tag): ...@@ -147,18 +145,13 @@ def start_fluentd_cat(test_msg, tag):
def kill_caddy(caddy_pid): def kill_caddy(caddy_pid):
print("caddy pid = ") os.system("kill -TSTP %s" % caddy_pid)
print(caddy_pid) print("Caddy is stopped.")
kill_caddy_cmd = "kill -TSTP " + caddy_pid
os.system(kill_caddy_cmd)
print("Caddy is stopped")
def start_caddy(caddy_pid): def start_caddy(caddy_pid):
start_caddy_cmd = "kill -CONT " + caddy_pid os.system("kill -CONT %s" % caddy_pid)
os.system(start_caddy_cmd) print("Caddy is restarted.")
print("Caddy is restarted")
def find_tag(s, start, end): def find_tag(s, start, end):
return (s.split(start))[1].split(end)[0] return (s.split(start))[1].split(end)[0]
...@@ -166,7 +159,7 @@ def find_tag(s, start, end): ...@@ -166,7 +159,7 @@ def find_tag(s, start, end):
def main(): def main():
port=9443 port=9443
server_address = ('0.0.0.0', port) server_address = ('$${slap-network-information:local-ipv4}', port)
httpd = HTTPServer(server_address, TestServerHandler) httpd = HTTPServer(server_address, TestServerHandler)
thread = threading.Thread(target=httpd.serve_forever) thread = threading.Thread(target=httpd.serve_forever)
thread.start() thread.start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment