Commit 7ba6255b authored by Eteri's avatar Eteri

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

parent 52cd7d79
{{local_ip}}:4443
proxy / 0.0.0.0:9443
proxy / {{local_ip}}:9443
......@@ -65,7 +65,7 @@
@type debug_agent
@id debug_agent_input
bind 127.0.0.1
bind {{local_ip}}
port 24230
</source>
......
......@@ -34,7 +34,6 @@ output = $${directory:bin}/runTestSuite
buildout-directory = $${buildout:directory}
mode = 0700
[runTest-instance]
recipe = slapos.recipe.template
url = ${template-test:output}
......@@ -42,27 +41,24 @@ output = $${directory:bin}/testIngestion.py
buildout-directory = $${buildout:directory}
mode = 0700
#################################
# fluentd service
#################################
[fluentdConfig]
recipe = slapos.recipe.template:jinja2
template = ${template-fluentdConfig:location}/${template-fluentdConfig:filename}
rendered = $${directory:etc}/fluentd-conf.cnf
mode = 0600
context =
context =
key local_ip caddy-configuration:local_ip
[fluentd-service]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/fluentd-service
path = ${fluentd:location}
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 =
GEM_PATH= ${fluentd:location}/lib/ruby/gems/1.8/
output = $${:wrapper-path}
......@@ -94,11 +90,7 @@ error_log = $${directory:log}/caddy-error.log
local_ip = $${slap-network-information:local-ipv4}
context =
key local_ip caddy-configuration:local_ip
[publish-connection-information]
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():
test_line_dict = {}
######!!!!!!!!!!!!!! uncomment this !!!!!!!!
# result.errors, result.failures, stream.read()
num_of_tests, errors, failures, stdout = testIngestion.main()
result = testIngestion.main()
......
......@@ -50,7 +50,7 @@ interpreter = pythonwitheggs
[template-fluentdConfig]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/fluentd-conf.cnf.in
#md5sum = 3132b99d65c75b72fc6dacb702ddca0b
md5sum = fd896793455e1d04082449212d285b55
filename = fluentd-conf.cnf.in
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
......@@ -79,14 +79,14 @@ mode = 0644
[template-caddyfile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/Caddyfile.in
md5sum = 3132b99d65c75b72fc6dacb702ddca0b
md5sum = 8644e98038ab76a8e5a499e22f92660a
output = ${buildout:directory}/Caddyfile.in
mode = 0644
[template-caddy-fluentd]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-caddy-fluentd.cfg.in
md5sum = 599d4650e9b96ce15fceb512316651ae
md5sum = 4e0c6e0464ad1b2f1adadda10771bb86
output = ${buildout:directory}/instance-caddy-fluentd.cfg.in
mode = 0644
......
......@@ -23,8 +23,6 @@ caddy_pidfile = "$${directory:etc}/caddy_pidfile"
posted_data = None
all_data = []
request_tag = ""
with open(caddy_pidfile) as f:
caddy_pid = f.readline()
class TestServerHandler(BaseHTTPRequestHandler):
......@@ -60,8 +58,6 @@ class TestServerHandler(BaseHTTPRequestHandler):
class TestPost(unittest.TestCase):
posted_data = ""
def test_1_get(self):
print("############## TEST 1 ##############")
resp = requests.get(url)
......@@ -90,6 +86,8 @@ class TestPost(unittest.TestCase):
def test_4_delay_15_mins(self):
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)
start_fluentd_cat("dummyInputDelay", "tag_test_4")
time.sleep(15)
......@@ -147,18 +145,13 @@ def start_fluentd_cat(test_msg, tag):
def kill_caddy(caddy_pid):
print("caddy pid = ")
print(caddy_pid)
kill_caddy_cmd = "kill -TSTP " + caddy_pid
os.system(kill_caddy_cmd)
print("Caddy is stopped")
os.system("kill -TSTP %s" % caddy_pid)
print("Caddy is stopped.")
def start_caddy(caddy_pid):
start_caddy_cmd = "kill -CONT " + caddy_pid
os.system(start_caddy_cmd)
print("Caddy is restarted")
os.system("kill -CONT %s" % caddy_pid)
print("Caddy is restarted.")
def find_tag(s, start, end):
return (s.split(start))[1].split(end)[0]
......@@ -166,7 +159,7 @@ def find_tag(s, start, end):
def main():
port=9443
server_address = ('0.0.0.0', port)
server_address = ('$${slap-network-information:local-ipv4}', port)
httpd = HTTPServer(server_address, TestServerHandler)
thread = threading.Thread(target=httpd.serve_forever)
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