Commit 430515ea authored by Eteri's avatar Eteri

add local-ipv4

parent 829360b8
...@@ -109,4 +109,8 @@ command-line = ...@@ -109,4 +109,8 @@ command-line =
${buildout:bin-directory}/runTestSuite ${buildout:bin-directory}/runTestSuite
--python_interpreter=${buildout:bin-directory}/${eggs:interpreter} --python_interpreter=${buildout:bin-directory}/${eggs:interpreter}
--source_code_path_list=$${slapos:location}/software/erp5testnode/testsuite/fluentTest/tests/ --source_code_path_list=$${slapos:location}/software/erp5testnode/testsuite/fluentTest/tests/
####################################################
\ No newline at end of file environment =
PATH=${buildout:bin-directory}:/usr/bin/:/bin/
LOCAL_IPV4=$${slap-network-information:local-ipv4}
GLOBAL_IPV6=$${slap-network-information:global-ipv6}
\ No newline at end of file
...@@ -16,8 +16,6 @@ parts = ...@@ -16,8 +16,6 @@ parts =
instance-profile instance-profile
template-fluentdConfig template-fluentdConfig
[setup-develop-egg] [setup-develop-egg]
recipe = zc.recipe.egg:develop recipe = zc.recipe.egg:develop
...@@ -32,7 +30,6 @@ setup = ${slapos-repository:location}/software/erp5testnode/testsuite/fluentTest ...@@ -32,7 +30,6 @@ setup = ${slapos-repository:location}/software/erp5testnode/testsuite/fluentTest
egg = erp5.util[testnode] egg = erp5.util[testnode]
setup = ${erp5.util-repository:location} setup = ${erp5.util-repository:location}
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
...@@ -98,7 +95,7 @@ mode = 0644 ...@@ -98,7 +95,7 @@ mode = 0644
[template-fluentdConfig] [template-fluentdConfig]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/fluentd-conf.cnf.in url = ${:_profile_base_location_}/templates/fluentd-conf.cnf.in
md5sum = fd896793455e1d04082449212d285b55 #md5sum = 63b8bea7fcc18af68e8bdf2afc33a92d
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
...@@ -134,7 +131,7 @@ mode = 0644 ...@@ -134,7 +131,7 @@ 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 = ac6f4d735716c1a4e5226f1dfad2966d #md5sum = 0faafb57e55c6e1a310433c11e781133
output = ${buildout:directory}/instance-caddy-fluentd.cfg.in output = ${buildout:directory}/instance-caddy-fluentd.cfg.in
mode = 0644 mode = 0644
......
...@@ -11,13 +11,14 @@ import SocketServer ...@@ -11,13 +11,14 @@ import SocketServer
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import os import os
import threading
import time import time
import utils import utils
import multiprocessing
test_msg = "dummyInputSimpleIngest" test_msg = "dummyInputSimpleIngest"
url = "http://$${caddy-configuration:local_ip}:8443" #url = "http://$${caddy-configuration:local_ip}:8443"
url = "http://10.0.46.242:8443"
caddy_pidfile = "$${directory:etc}/caddy_pidfile" caddy_pidfile = "$${directory:etc}/caddy_pidfile"
...@@ -68,22 +69,36 @@ class TestServerHandler(BaseHTTPRequestHandler): ...@@ -68,22 +69,36 @@ class TestServerHandler(BaseHTTPRequestHandler):
class TestIngestion(FluentdPluginTestCase): class TestIngestion(FluentdPluginTestCase):
def setUp(self): @classmethod
def startServer(cls):
port=9443 port=9443
server_address = ('$${slap-network-information:local-ipv4}', port) #server_address = ('$${slap-network-information:local-ipv4}', port)
httpd = HTTPServer(server_address, TestServerHandler) server_address = ('0.0.0.0', port)
thread = threading.Thread(target=httpd.serve_forever) #ip = os.environ.get('LOCAL_IPV4', '127.0.1.1')
thread.start() server = HTTPServer(server_address, TestServerHandler)
print 'Starting http...' cls.server_process = multiprocessing.Process(target=server.serve_forever)
time.sleep(15) cls.server_process.start()
def tearDown(self): @classmethod
def stopServer(cls):
cls.server_process.terminate()
httpd.shutdown() def setUp(self):
print("all posted data : ") self.startServer()
print(all_data) # port=9443
# server_address = ('$${slap-network-information:local-ipv4}', port)
# httpd = HTTPServer(server_address, TestServerHandler)
# thread = threading.Thread(target=httpd.serve_forever)
# thread.start()
# print 'Starting http...'
# time.sleep(15)
def tearDown(self):
self.stopServer()
time.sleep(10)
# httpd.shutdown()
# print("all posted data : ")
# print(all_data)
def test_1_get(self): def test_1_get(self):
print("############## TEST 1 ##############") print("############## TEST 1 ##############")
......
...@@ -95,8 +95,8 @@ class SlapOSInstanceTestCase(unittest.TestCase): ...@@ -95,8 +95,8 @@ class SlapOSInstanceTestCase(unittest.TestCase):
# Some tests are expecting that local IP is not set to 127.0.0.1 # Some tests are expecting that local IP is not set to 127.0.0.1
ipv4_address = os.environ.get('LOCAL_IPV4', '127.0.1.1') ipv4_address = os.environ.get('LOCAL_IPV4', '127.0.1.1')
#ipv6_address = os.environ['GLOBAL_IPV6'] ipv6_address = os.environ['GLOBAL_IPV6']
ipv6_address = '' #ipv6_address = ''
config['proxy_host'] = config['ipv4_address'] = ipv4_address config['proxy_host'] = config['ipv4_address'] = ipv4_address
config['ipv6_address'] = ipv6_address config['ipv6_address'] = ipv6_address
......
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